« Return to Thread: RE: Problem initialise timer for 1µs cycle

RE: Problem initialise timer for 1µs cycle

by folgli :: Rate this Message:

Reply to Author | View in Thread

Hello,

>Because of character problems on the mail I received, I can't see if you
>want
interrupt each micro-second.
>If so, it seems very very fast for that
processor.
I need to increment a variable every micro-sencond. I am implementing an CANopen stack at the controller. For this I need to increment a variable every micro-second.
I have written a test programm to test the timer. The timer basically works.. The interrupt works etc. but I do not know how to configure the timer registers so that I get an interrupt every micro-second.
You can  find attached the programm files. Perhaps someone can tell me how to configure the timer to get an interrupt every micro-second.
Perhaps an additional question. How can I test the Interrupt? I toggle some LED's every interrupt but I think when using a one micro-second interrupt you can not see toggling the LED's any more ;).
It is all written in C.
Thank you very much!Best regards


--- folgli@... <folgli@...> schrieb am Fr, 1.5.2009:
I find just this morning your problem about Timer.
Because of character
problems on the mail I received, I can't see if you
want interrupt each
micro-second...
If so, it seems very very fast for that
processor.

With 12 Mhz quartz, no PLL, I use an empty function (in C) to
delay 2.5
micro-seconds :

void Delay_2_5_micro (void)
{ //
nothing to do
}

That means just call and return from this empty
function take 2.5
micro-seconds, measured with oscilloscope.

Hope this
helps.

Joel


Von: folgli@... <folgli@...>
Betreff: [68HC12] Problem initialise timer for 1µs cycle
An: 68hc12@...
Datum: Freitag, 1. Mai 2009, 13:56

Hello,

I have a problem with using the Timer on a MC9S12DP512. I want to create 1µ second cycles. Every µs I want to increment a variable, but I do not know how to initialise the timer, so that I get a timer interrupt every µs.
I hope that someone can help me.
Best regards




     

[Non-text portions of this message have been removed]

 « Return to Thread: RE: Problem initialise timer for 1µs cycle