freertos for pic30f6014A

savastakan wrote on Friday, November 21, 2008:

I am updating source code for freertos but I have some error,I don’t understand why I got these error,please help me ( freerots wrote for p33FJ256GP710,I want to modify for p30f6014A )
problem is :

port.c: In function ‘prvSetupTimerInterrupt’:
port.c:277: error: ‘TCON_16BIT’ has no member named ‘TCKPS0’
port.c:278: error: ‘TCON_16BIT’ has no member named ‘TCKPS1’

funciton is :

/*
* Setup a timer for a regular tick.
*/

static void prvSetupTimerInterrupt( void )
{
const unsigned portLONG ulCompareMatch = ( configCPU_CLOCK_HZ / portTIMER_PRESCALE ) / configTICK_RATE_HZ;

   /* Prescale of 8. */
   T1CON = 0;
   TMR1 = 0;

   PR1 = ( unsigned portSHORT ) ulCompareMatch;

   /* Setup timer 1 interrupt priority. */
   IPC0bits.T1IP = configKERNEL_INTERRUPT_PRIORITY;

   /* Clear the interrupt as a starting condition. */
   IFS0bits.T1IF = 0;

   /* Enable the interrupt. */
   IEC0bits.T1IE = 1;

   /* Setup the prescale value. */
   T1CONbits.TCKPS0 = 1;
   T1CONbits.TCKPS1 = 0;

   /* Start the timer. */
   T1CONbits.TON = 1;
}

edwards3 wrote on Friday, November 21, 2008:

You will have to look into the header files and data sheet for the p30f6014A to see what the differences are in the timer peripheral. You just need to set up the timer to generate the tick.