cancel
Showing results for 
Search instead for 
Did you mean: 

Generating 100us timer base & cnt (STM32F205)

vindhyachal
Associate II
Posted on November 04, 2014 at 13:46

1. I have STM32F205 running at 120Mhz with external 16Mhz crystal.

Prefetch , Data & Instruction buffer on. timer is clocked by 60Mhz

2. task is to toggle 10 pins with a base count of 100us.

i.e User will enter number in multiple of 100us & I have to toggle the pins.

3. I have timer base of 100us &  accordingly I am toggled the pins. In interrupt only 10 variables are incremented. So ISR is very small.

4. System works fine initially but on long run (1 hour or so), I saw some latency keep on adding. 

5. This probably due to small time base i.e 100us. It adds jitter & theoretically Cortex-M3 core should always be able to service an interrupt request within 15 cycles 

. Is it due to these cycles which accumulate over period of time & generate error.

6. Any possible solution/advise/technical point
1 REPLY 1
Posted on November 04, 2014 at 14:51

Well it's certainly possible to set a timer with a continuous timebase that remains synchronous regardless of what the interrupt is doing.

It's not clear what you're measuring, and the timer is capable of toggling pins directly, and you could measure latency with respect to that.

If you compare two independent clock sources, you're always going to observe an accumulating bias, as each drift with respect to each other.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..