Exact steps to create a project in MPLAB without harmony

I just did the process that @rtel described above and I have 1 task running in the simulator.

  1. Create a new MPLAB project
  2. navigate to the project folder and git clone freertos-kernel into this folder. (you could just copy the folder as well)
  3. inside MPLAB right click on Source Files and select “Add existing items from folders”
  4. select the kernel folder that you just cloned (or copied) (make sure the file filter is .c and .S
  5. inside MPLAB right click on the Header Files and select “Add existing items from folders”
  6. select the kernel folder again. This time change the file filter to header files.
  7. open the new FreeRTOS-Kernel/portable folder that is now in your project and remove from the build ALL the ports that do not apply. Leave the MPLAB/pic24dsPIC folder in place.
  8. Add a FreeRTOSConfig.h to the headers folder. You could copy this one to get started.
  9. Remove the heap implementations that are not needed (only 1 should be in your project). I chose heap_1.c
  10. Select your project properties. Open XC16->XC16 (Global Options) and add the FreeRTOS include folder and the portable folder for the PIC24.
  11. Your project view should look something like this.
  12. Check the FreeRTOSConfig.h settings and adjust the clock speed & total heap size appropriately.j
  13. Add the following to your FreeRTOSConfig.h
#ifndef SIZE_MAX
    #define SIZE_MAX    ( ( size_t ) -1 )
#endif
  1. Add #includej <xc.h> at the top of the FreeRTOSConfig.h. You can remove any #includes that specifically reference a device. xc.h will use the project MCU settings.
  2. Provide a main function. Or use the one I have attached.
    main.c (986 Bytes)

You should be able run this and see count increment every 100msec in the simulator.
When I compile I get one warning related to a cast in heap_1.c

There is no harmony in this project and the port directly access timer 1 to provide the tick interrupt for FreeRTOS.

Good Luck