The cocoOS used in PICmicro MID-RANGE MCU FAMILY

Configuring cocoOS

The cocoOS used in PICmicro MID-RANGE MCU FAMILY

Postby peter » Wed Apr 15, 2015 5:00 pm

Here is a short guide to get cocoOS compiled with the XC8 compiler:

Tested with Microchip MPLAB XC8 C Compiler (PRO Mode) V1.34( the MPLAP X IDE version2.35)

1. Download the latest source from

2. Create a project that includes all the .c and .h files.

3. Add #include <xc.h> and #include "cocoos.h" in projects main.c file.

4. In os_defines.h:
- Add #include <stdint.h> (This will be fixed in cocoOS 4.1.0)
- Define the number of tasks, queues, semaphores and events. Set to 0 if not used to reduce RAM usage.
- Comment the define for ROUND_ROBIN if priority based scheduling is desired.
- Define the size of memory pointers (for MID-RANGE family: typedef uint16_t Mem_t)

5. In os_port.h:
- add #include <xc.h>
- #define os_enable_interrupts() GIE=1
- #define os_disable_interrupts() GIE=0

6. Create HW timer ISR that calls os_tick() function. you decide the tick interval...

7. Create test programs as shown in &

8. Compile and run!
Site Admin
Posts: 18
Joined: Wed Mar 07, 2012 9:32 am

Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest