Timer Prescaler Value?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2006-10-13 3:30 AM
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2006-10-12 12:40 PM
Posted on October 12, 2006 at 21:40
On the STR711FR2, how do I determine a timer prescaler value? I would like
The Reference manual shows a function of delta_OCiR = (delta_t * f_PCLK2) / (CC7 / CC0 + 1) Since CC7 and CC0 are bits, do I use the entire CC register as the prescale value? I currently have the timer running and the interrupts working, but the period of the timer is not what I expect. Thanks. // // Configure the EIC channel interrupt // EIC_IRQChannelPriorityConfig( T0TIMI_IRQChannel, 1 ); EIC_IRQChannelConfig( T0TIMI_IRQChannel, ENABLE ); EIC_IRQConfig( ENABLE ); // // Initialize the Timer // TIM_Init ( TIM0 ); // // Configure the TIM Prescaler - Div by 2 // TIM_PrescalerConfig ( TIM0, 0x02 ); // ??? // // Enable the Output Compare for the TIM0 peripheral // TIM_ITConfig ( TIM0, TIM_OCA_IT, ENABLE ); // // Output compare mode peripheral Mode Config // (TIMx, TIM_CHANNEL_x, Output Compare Value, Output Compare Mode, Level after Match) // TIM_OCMPModeConfig ( TIM0, TIM_CHANNEL_A, 0x8000, TIM_TIMING, TIM_HIGH ); [ This message was edited by: justinm on 13-10-2006 01:14 ]Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2006-10-13 3:30 AM
Posted on October 13, 2006 at 12:30
You took the wrong forum. You should post your question in the STR7 forum, here it is the ST7 (8 bit) forum.
