2007-05-29 07:58 AM
2007-05-22 08:19 AM
Hello,
I am struggling to get a timebase timer to work on an STR735. The processor is running (verified through flashing LED's). I need a timer on a 500 millisecond timebase to schedule activities. The following steps have been done with no success: In Main initialisation: Use Timer Base with End Of Count Interrupt ------------------------------------------------------------------------------*/ /* TB2 Clock Enable */ CFG_PeripheralClockConfig(CFG_CLK_TB2 , ENABLE); /* EIC Clock Enable */ CFG_PeripheralClockConfig(CFG_CLK_EIC , ENABLE); /* EIC Configuration */ EIC_IRQChannelConfig(TB2_IRQChannel, ENABLE ); EIC_IRQChannelPriorityConfig(TB2_IRQChannel,1); /*TB2 Configuration to toggle Leds each 500ms */ TB_InitStructure.TB_CLK_Source = TB_CLK_INTERNAL; TB_InitStructure.TB_Prescaler = 0xEF; /* The internal TB Frequency = 100KHz */ TB_InitStructure.TB_Preload = 0xC350 ; /* 100000Hz * 0.5 s = 0xC350 */ TB_Init (TB2, &TB_InitStructure); EIC_IRQCmd(ENABLE); TB_ITConfig (TB2,ENABLE); TB_Cmd(TB2, ENABLE); In the interupt vectors I have: void TB2_IRQHandler (void) { GPIO_BitWrite(GPIO1,GPIO_PIN_14 ,~GPIO_BitRead(GPIO1,GPIO_PIN_14)); TB_FlagClear(TB2); } (Please note the pin read/write and hardware was tested using the main loop previously). Many thanks2007-05-22 08:08 PM
Well, i'm currently working on the timebase timer (see my topic above...).
I can create an update every 10us (I could have a 500ms), but I can't use this timer in other functions... To me, what you've done seems good, but are you sure of the Prescaler and Preload values ? What is your problem ? Is the timebase too fast or too quick ? If you have something new, you can contact me atmailto:xaviooo@gmail.com
or look at my topic :).2007-05-23 07:16 AM
I have resolved the issue, the PLL is not setup correctly and therefore the device speed was completely different to that expected.
Working well now thanks2007-05-29 07:58 AM
Good!
The STR73x firmware library provides a helpfull example for TB as well as for all peripherals. ;)