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] Microchip PortPosted by Ron Seese on March 27, 2010 My first attempt at using FreeRTOS went smoothly with an 18F8723. My second attempt is a little bumpy. I am attempting to port a 18F2620. In this design I use all of the CCP modules, so I am attempting to use timer 0 for the timer tick resource. After having the initial problems, I went back to the 8723 and changed the existing method of using a compare module and timer for the timer tick to only using timer 0, and successfully.
What seems to be happening is that any of the task delays seem to return immediately. Time slicing with 2 tasks seem to be working. I have a test point toggling on in the timer tick routine as well as both of the test tasks. I thought that there is a problem updating the timer tick counter, but I wrote a small routine that fetches the variable, and it is counting.
What would be some of the next steps in debugging this issue?
RE: Microchip PortPosted by Richard on March 28, 2010 Are you using calls to vTaskDelayUntil()? If so, are you initialising the first parameter before using it for the first time? It should be initialised to the current time before it gets used, but once its initialised you should not (normally) write to it directly again.
Regards.
RE: Microchip PortPosted by Ron Seese on March 29, 2010 Hi Richard, I believe so: static void vHeartBeat( void *pvParameters ) { portTickType xDelayTime;
xDelayTime = xTaskGetTickCount(); for( ;; ) { vTaskDelayUntil (&xDelayTime, DELAY_SEC); LED1 = !LED1; } }
And I toggle another testpoint in the timer tick routine: #pragma code static void prvTickISR( void ) { /* Interrupts must have been enabled for the ISR to fire, so we have to save the context with interrupts enabled. */
INTCONbits.TMR0IF = 0; TP3=!TP3;
TMR0H = ( unsigned char ) 0x82; TMR0L = ( unsigned char ) 0xff;
portSAVE_CONTEXT( portGLOBAL_INTERRUPT_FLAG );
/* Maintain the tick count. */ vTaskIncrementTick();
#if configUSE_PREEMPTION == 1 { /* Switch to the highest priority task that is ready to run. */ vTaskSwitchContext(); } #endif
portRESTORE_CONTEXT(); }
I am expecting LED1 to toggle at a 1 second rate, but it toggles faster than TP3.
Thanks, Ron
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|