kramema24 wrote on Wednesday, November 08, 2017:
#include <stdio.h>
#include <stdlib.h>
#include <p33Fxxxx.h>
#include <libpic30.h>
int FBS __attribute__((space(prog), address(0xF80000))) = 0xFFFF ;
//_FBS(
// BWRP_WRPROTECT_OFF & // Boot Segment Write Protect (Boot Segment may be written)
// BSS_NO_FLASH // Boot Segment Program Flash Code Protection (No Boot program Flash segment)
//);
int FGS __attribute__((space(prog), address(0xF80004))) = 0xFFFF ;
//_FGS(
// GWRP_OFF & // General Code Segment Write Protect (General Segment may be written)
// GSS_OFF // General Segment Code Protection (User program memory is not code-protected)
//);
int FOSCSEL __attribute__((space(prog), address(0xF80006))) = 0xFFFF ;
//_FOSCSEL(
// FNOSC_FRCDIVN & // Oscillator Source Selection (Internal Fast RC (FRC) oscillator with postscaler)
// IESO_ON // 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(
// POSCMD_NONE & // Primary Oscillator Source (Primary oscillator disabled)
// OSCIOFNC_OFF & // OSC2 Pin Function (OSC2 is clock output)
// IOL1WAY_ON & // Peripheral Pin Select Configuration (Allow only one reconfiguration)
// FCKSM_CSDCMD // Clock Switching and Monitor (Clock switching and Fail-Safe Clock Monitor are disabled, Mon Disabled)
//);
int FWDT __attribute__((space(prog), address(0xF8000A))) = 0xFFFF ;
//_FWDT(
// WDTPOST_PS32768 & // Watchdog Timer Postscaler (1:32,768)
// WDTPRE_PR128 & // WDT Prescaler (1:128)
// WINDIS_OFF & // Watchdog Timer Window (Watchdog Timer in Non-Window mode)
// FWDTEN_ON // Watchdog Timer Enable (Watchdog timer always enabled)
//);
int FPOR __attribute__((space(prog), address(0xF8000C))) = 0xFFFF ;
//_FPOR(
// FPWRT_PWR128 // POR Timer Value (128ms)
//);
int FICD __attribute__((space(prog), address(0xF8000E))) = 0xFFDF ;
//_FICD(
// ICS_PGD1 & // Comm Channel Select (Communicate on PGC1/EMUC1 and PGD1/EMUD1)
// JTAGEN_OFF // 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