It appears you're trying to fire an interrupt at your target output clock rate (3.57 MHz). I'm sorry to say that I don't think the STM32 can handle interrupts that fast. In fact, I think you maxed out your ISR rate at 666 KHz.
It's a programmer exercise. Take a look at any PWM example on a timer output pin. You'll never achive the rate you're looking for with an interrupt handler. You'll need the help of the timer peripheral. The PWM example will hsow you how. You'll need to experiment. You might not be able to achieve the exact frequency you want because the clock divisors will be small.
On 23-02-2009 at 20:34, Anonymous wrote: It appears you're trying to fire an interrupt at your target output clock rate (3.57 MHz). I'm sorry to say that I don't think the STM32 can handle interrupts that fast. In fact, I think you maxed out your ISR rate at 666 KHz. Maybe you are right, but how can i generate CLK = 3.57(3.6)MHz for my SAM module, in another way? P.S. My oscilloscope shows that this is possible :) [ This message was edited by: dimasusl on 23-02-2009 21:52 ]
On 24-02-2009 at 00:58, Anonymous wrote: It's a programmer exercise. Take a look at any PWM example on a timer output pin. You'll never achive the rate you're looking for with an interrupt handler. You'll need the help of the timer peripheral. The PWM example will hsow you how. You'll need to experiment. You might not be able to achieve the exact frequency you want because the clock divisors will be small. Thank you very much. Indeed, using the example of PWM, I have achieved the desired result without interruption. This is very good, since it works the rest of the hardware (eg, USB). P.S. But now I am well-mastered timers:)