FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2010 Threads] vTaskDelay and vTaskDelayUntil on pic18f452Posted by GMcapivara Chess on March 7, 2010 Hi. First I apologise for my poor english. Now I'm having a feel problems with the functions vTaskDelay and vTaskDelayUntil on pic18f452. They simply doesn't work. I set #define INCLUDE_vTaskDelayUntil1 #define INCLUDE_vTaskDelay1 and when I use the functions on the example on website:
void vTaskFunction( void * pvParameters ) { portTickType xLastWakeTime; const portTickType xFrequency = 10;
// Initialise the xLastWakeTime variable with the current time. xLastWakeTime = xTaskGetTickCount();
for( ;; ) { // Wait for the next cycle. vTaskDelayUntil( &xLastWakeTime, xFrequency );
// Perform action here. } } the process block indefinitely. When I comment the function delay and put a for to make a delay and toggle a led the function work's fine. It's analogue when I use the example with vTaskDelay.
suggestions?
RE: vTaskDelay and vTaskDelayUntil on pic18f452Posted by MEdwards on March 7, 2010 Sounds like the tick interrupt is not executing as expected. Put a break point in the tick interrupt handler and see if it ever gets hit. Alternatively remove the call to vTaskDelay() and instead just loop round calling xTaskGetTickCount() to see if the value returned ever increases.
RE: vTaskDelay and vTaskDelayUntil on pic18f452Posted by GMcapivara Chess on March 18, 2010 well...more news.... putting some break points I found this......the ticks are ok....but I think there is a problem with the memory allocation for the process....for example:
void toggleLed(int i) { int j; TRISD = 0x00; PORTD = 0x10; for( j=0; jPORTD = 0x00; for( j=0; j}
void vTaskCode( void * pvParameters ) { int i; for( ;; ) { i = 10000; toggleLed(i); } }
void main(void) { vPortInitialiseBlocks(); for(;;) { toggleLed(10000); } //xTaskCreate( vTaskCode, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); vTaskStartScheduler(); }
the code works fine....but when I comment the for in main and uncomment the xTaskCreate, putting a break point on the toggleLed(i) on the process, when I step into toggleLed the value of parameter "i" becomes 0.....
this is problem with memory allocation right?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|