t4z wrote on Wednesday, October 10, 2007:
Hi there,
i belong to tobias. So i would like to join the conversation.
@sotd
I dont know, if you are speaking of that what i am thinking of. On the Atmel site we found an application sheet called "Migration between ATmega 16/32 and ATmega 164P/324P/644(P)".
http://www.atmel.com/dyn/resources/prod_documents/doc8001.pdf
On site 4 we realized, that there are TIMSK0,TIMSK1 and TIMSK2 for the ATmega644 instead of TIMSK for the ATmega 16/32. Cause we are not so experienced in µc programming, we dont know what we have to implement into the "port.c". Actually the prvSetupTimerInterrupt()looks like the following.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/*
* Setup timer 1 compare match A to generate a tick interrupt.
*/
static void prvSetupTimerInterrupt( void )
{
unsigned portLONG ulCompareMatch;
unsigned portCHAR ucHighByte, ucLowByte;
/* Using 16bit timer 1 to generate the tick. Correct fuses must be
selected for the configCPU_CLOCK_HZ clock. */
ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
/* We only have 16 bits so have to scale to get our required tick rate. */
ulCompareMatch /= portCLOCK_PRESCALER;
/* Adjust for correct value. */
ulCompareMatch -= ( unsigned portLONG ) 1;
/* Setup compare match value for compare match A. Interrupts are disabled
before this is called so we need not worry here. */
ucLowByte = ( unsigned portCHAR ) ( ulCompareMatch & ( unsigned portLONG ) 0xff );
ulCompareMatch >>= 8;
ucHighByte = ( unsigned portCHAR ) ( ulCompareMatch & ( unsigned portLONG ) 0xff );
OCR1AH = ucHighByte;
OCR1AL = ucLowByte;
/* Setup clock source and compare match behaviour. */
ucLowByte = portCLEAR_COUNTER_ON_MATCH | portPRESCALE_64;
TCCR1B = ucLowByte;
/* Enable the interrupt - this is okay as interrupt are currently globally
disabled. */
ucLowByte = TIMSK;
ucLowByte |= portCOMPARE_MATCH_A_INTERRUPT_ENABLE;
TIMSK = ucLowByte;
}
/*-----------------------------------------------------------*/
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Everytime vTaskDelay() is called the os hang up, so it seems that the scheduler coudnt work right because of a wrong configuration of the timers or something else.
I think, we really need some suggestions or help at that point. :\
Thanks in advance,
Chris