Hi Grant, I know it is stupid, but I could not find any settings for WDT in your code. Is that possible that there is a watchdog timer or any other reset that cause problems in your application? Tamas On Mon, Oct 20, 2008 at 5:56 AM, Grant Brown wrote: > Hi Iasaac, > > I played around with the number of ticks but still can not get it working. > > I have copied the main function and task blow for reference. > > The task is not being run and I can confirm this because Bit_0 never > gets turned on as it should with > > PORTWrite(IOPORT_D, 0x05); // 0000 0000 0000 0101 > > Could someone please explain how I can get this going. > > Kind Regards > Grant Brown > > int main( void ) > { > // configure the wait states and peripheral bus clock > SYSTEMConfigPerformance(80000000); > PORTSetPinsDigitalOut(IOPORT_D, BIT_0|BIT_1|BIT_2); > mPORTDClearBits(BIT_0|BIT_1|BIT_2); > //GrantsTask(); > xTaskCreate( &GrantsTask, "GKB_Tsk", configMINIMAL_STACK_SIZE, > NULL, tskIDLE_PRIORITY, NULL ); > vTaskStartScheduler(); > return 0; > } > > static void GrantsTask(void) > { > portTickType xLastExecutionTime; > const portTickType xFrequency =3D 10000; > PORTWrite(IOPORT_D, 0x05); // 0000 0000 0000 0101 > xLastExecutionTime =3D xTaskGetTickCount(); > while(1) > { > vTaskDelay(xFrequency); > mPORTDToggleBits(BIT_2); > } > } > > > > > > Isaac Marino Bavaresco wrote: > > I use FreeRTOS with dsPIC and PIC18 only, but it appears that you made > > an obvious mistake. > > > > Your pin is OFF for 200000000 ticks and then for ON for 100 ticks. > > If you use a tick rate of 1000 ticks per second, this gives an OFF time > > of 55,55 hours and an ON time of 0,1 second. > > > > Even if your tick rate is 1,000,000 ticks per second (I doubt it), you > > would need to wait more than 3 minutes to see the LED on for 0,1 ms. > > > > Perhaps you didn't waited enough to see the LED flash ;) > > > > > > Grant Brown escreveu: > > > >> Hi List, > >> > >> Trying to get the FreeRTOS up and running and having a view problems, > >> > >> If I run my task as a normal function without using TaskCreate or > >> running the scheduler it runs fine and without any problems. > >> > >> ie the led flashes. > >> > >> If I try to run it by creating the task and then running the scheduler > >> the led never flashes. > >> > >> I am running this on the PIC32 starter kit. > >> > >> My main function and my task are listed below for reference > >> > >> Can any one see what I'm doing wrong and give me some guidance. > >> > >> Kind Regards > >> Grant Brown > >> > >> #pragma config FPLLMUL =3D MUL_20, FPLLIDIV =3D DIV_2, FPLLODIV =3D DI= V_1, > >> FWDTEN =3D OFF > >> #pragma config POSCMOD =3D HS, FNOSC =3D PRIPLL, FPBDIV =3D DIV_2 > >> > >> static void GrantsTask(void); > >> int Cnt =3D 0; > >> > >> int main( void ) > >> { > >> SYSTEMConfigPerformance(80000000); > >> PORTSetPinsDigitalOut(IOPORT_D, BIT_0|BIT_1); > >> mPORTDClearBits(BIT_0|BIT_1); > >> // GrantsTask(); > >> xTaskCreate( GrantsTask, "GKB_Tsk", configMINIMAL_STACK_SIZE, NULL, > >> tskIDLE_PRIORITY, NULL ); > >> vTaskStartScheduler(); > >> return 0; > >> } > >> > >> static void GrantsTask(void) > >> { > >> portTickType xLastExecutionTime; > >> const portTickType xFrequency =3D 100; > >> xLastExecutionTime =3D xTaskGetTickCount(); > >> while(1) > >> { > >> vTaskDelayUntil(&xLastExecutionTime,xFrequency); > >> mPORTDToggleBits(BIT_0); > >> Cnt++; > >> if (Cnt > 2000000) > >> { > >> Cnt =3D 0; > >> mPORTDToggleBits(BIT_1); > >> }; > >> }; > >> } > >> > >> > >> ----------------------------------------------------------------------= -- > >> > >> > >> No virus found in this incoming message. > >> Checked by AVG - http://www.avg.com > >> Version: 8.0.173 / Virus Database: 270.8.1/1730 - Release Date: > 10/17/2008 8:07 AM > >> > >> > >> > > > > __________________________________________________ > > Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger > > http://br.beta.messenger.yahoo.com/ > > > > > > -- > Kind Regards > Grant Brown > > SiteDoc Pty Ltd > mob: 0412 926 995 > www.sitedoc.com.au > > _________________________________________________________________________= _________________________________ > This email message together with any attachments is intended only for the > addressee(s) and contains information that may be confidential and/or > copyright. If you are not the intended recipient, please notify the send= er > by reply email (or telephone SiteDoc Pty Ltd on +61 2 42291185) and > immediately delete this email together with any attachments from your > computer. If you are the intended recipient, you must not copy, disclose, > reproduce or distribute this communication together with any attachments > without the authority of SiteDoc Proprietary Limited. No representation is > made that this email or any attachments are free of viruses. Virus scanni= ng > is recommended and is the responsibility of the recipient. Unless > specifically stated by the sender as the views of SiteDoc Proprietary > Limited, any views expressed in this message are those of the individual > sender, and no responsibility will be borne by SiteDoc Proprietary Limited > for its content or outcomes. > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = Rudonix DoubleSaver http://www.rudonix.com -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist