Creating a simple task with dspic33FJ16GS504

~~~

include <stdio.h>

include <stdlib.h>

include <p33Fxxxx.h>

include <libpic30.h>

int FBS attribute((space(prog), address(0xF80000))) = 0xFFFF ; //FBS( // BWRPWRPROTECTOFF & // Boot Segment Write Protect (Boot Segment may be written) // BSSNOFLASH // Boot Segment Program Flash Code Protection (No Boot program Flash segment) //); int FGS attribute((space(prog), address(0xF80004))) = 0xFFFF ; //FGS( // GWRPOFF & // General Code Segment Write Protect (General Segment may be written) // GSSOFF // General Segment Code Protection (User program memory is not code-protected) //); int FOSCSEL attribute((space(prog), address(0xF80006))) = 0xFFFF ; //FOSCSEL( // FNOSCFRCDIVN & // Oscillator Source Selection (Internal Fast RC (FRC) oscillator with postscaler) // IESOON // Internal External Switch Over Mode (Start up device with FRC, then automatically switch to user-selected oscillator source) //); int FOSC attribute((space(prog), address(0xF80008))) = 0xFFFF ; //FOSC( // POSCMDNONE & // Primary Oscillator Source (Primary oscillator disabled) // OSCIOFNCOFF & // OSC2 Pin Function (OSC2 is clock output) // IOL1WAYON & // Peripheral Pin Select Configuration (Allow only one reconfiguration) // FCKSMCSDCMD // Clock Switching and Monitor (Clock switching and Fail-Safe Clock Monitor are disabled, Mon Disabled) //); int FWDT attribute((space(prog), address(0xF8000A))) = 0xFFFF ; //FWDT( // WDTPOSTPS32768 & // Watchdog Timer Postscaler (1:32,768) // WDTPREPR128 & // WDT Prescaler (1:128) // WINDISOFF & // Watchdog Timer Window (Watchdog Timer in Non-Window mode) // FWDTENON // Watchdog Timer Enable (Watchdog timer always enabled) //); int FPOR attribute((space(prog), address(0xF8000C))) = 0xFFFF ; //FPOR( // FPWRTPWR128 // POR Timer Value (128ms) //); int FICD attribute((space(prog), address(0xF8000E))) = 0xFFDF ; //FICD( // ICSPGD1 & // Comm Channel Select (Communicate on PGC1/EMUC1 and PGD1/EMUD1) // JTAGENOFF // JTAG Port Enable (JTAG is disabled) //); /* * */ static void vCheckTask( void *pvParameters ); int main(void) { TRISA = 0x0000; TRISB = 0x0000; LATA = 0x0000; LATB = 0x0000; xTaskCreate( vCheckTask, “Check”, 105 * 2, NULL, 3, NULL );
/* Start the task that will control the LCD.  This returns the handle
to the queue used to write text out to the task. */
/* Finally start the scheduler. */
vTaskStartScheduler();
} static void vCheckTask( void *pvParameters ) { while(1) {
    LATA = 0xFFFF;
    LATB = 0xFFFF;

}
} ~~~ Ive been working on this for 2 days now. Im usingf ree RTOS because its need for our project. I dont have any background on RTOS. Ive succesfuly build the program and uploaded it to the controller but the LEDs does not turn on. I badly need your help

Creating a simple task with dspic33FJ16GS504

Not enough information to be able to help. Step into the vTaskStartScheduler function in the debugger to see how far it gets. Does the first task start? If you have a breakpoint in the first task, is it hit?

Creating a simple task with dspic33FJ16GS504

im so sorry sir, im so noob, im using MPLABX to code this. how do i know if the first task has started, and how do i go vTaskStartScheduler using the debugger?

Creating a simple task with dspic33FJ16GS504

sir can I give you my source code?

Creating a simple task with dspic33FJ16GS504

sir can I give you my source code?

Creating a simple task with dspic33FJ16GS504

I would suggest that you build and test the version of FreeRTOS from the demo site below on Microchip demo hardware to get familiar with FreeRTOS…. then, upgrade the files to current version 9.x of FreeRTOS… then port to your specific 33FJ16GS504 hardware. http://www.freertos.org/portpic24_dspic.html The dsPIC33FJ16GS504 is very limited in ram and flash memory and may not be the best candidate for using FreeRTOS without very careful attention to ram and flash usage… ~~ _/) ~~~~ _/) ~~~~ _/) ~~~~ _/) ~~ Tom Lafleur
On Nov 7, 2017, at 11:55 PM, Mark Lexther Ame kramema24@users.sf.net wrote: sir can I give you my source code? Creating a simple task with dspic33FCreating a simple task with dspic33FJ16GS504J16GS504 Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freertos/discussion/382005/ To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/