Generating 1Mhz CLK signal using TIMER
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-03-14 5:30 AM
Posted on March 14, 2012 at 13:30The original post was too long to process during our migration. Please click on the attachment to read the original post.
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-03-14 6:47 AM
Posted on March 14, 2012 at 14:47
You have ridiculous values for period and prescale, and set CCR values exceeding 16-bit, ie >65535.
From 36 MHz, You get 1 MHz by dividing 36 by 6 twice : TIM_TimeBaseStructure.TIM_Period = 6-1; TIM_TimeBaseStructure.TIM_Prescaler = 6-1; Other values will work, just do the math. Personally, I'd use PWM mode, and set the width to 3 (ie 50/50), no interrupts required. Toggle mode might work too. Also, you can't possibly interrupt at a 1 MHz rate, the part will simply saturate. The CCR advance trick only works well for a 65535 period value, as the CC interrupts also get triggered by the update, as I recall.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
