Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
How generate a 1M Hz clock with interrupt ?
I want to create a square signal at 1M Hz. I try with timer and it's not possible to generate not more than 30k Hz.
Help me please !!!!
1 Answer
9 years, 8 months ago.
Just use PWM to create it, much more efficient than using timer interrupts.
The default mbed PWM code won't be able to do that for the KL25z, however if you use this library: http://developer.mbed.org/users/Sissors/code/FastPWM/, you can simply create output with 1us period and 50% duty cycle.