cancel
Showing results for 
Search instead for 
Did you mean: 

timer for 1ms

csameling
Associate II
Posted on April 08, 2003 at 05:29

timer for 1ms

16 REPLIES 16
florent2399
Associate II
Posted on April 04, 2003 at 09:03

To generate output compare interrupts, you just need to configure the TimerB registers and reset the interrupt mask: your init code seems OK. The problem is somewhere else...a wrong placement of the hardware registers, and nothing can work! So please check once again your batch file/hardware registers declaration/.... -> you can check as well the .map file generated by the compiler to see if all the hardware registers/IT vectors are well placed.

Rgds

Florent
csameling
Associate II
Posted on April 04, 2003 at 09:37

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6X7&d=%2Fa%2F0X0000000bq6%2FmX5IIdj5gvqdqUJ1xzEgmrcwz0T6Pa4V9BYmgxeh.4w&asPdf=false
florent2399
Associate II
Posted on April 04, 2003 at 10:06

Allo Ampel...

Send me by EMail your complete workspace (zip file!) and I'll return you the corrected version.

Rgds

Florent
shreya
Associate II
Posted on April 07, 2003 at 12:08

Hello Ampel,

There is no single bit which will enable all the interrupts. So, if you have a main() with only a ''rim'' instruction, no interrupt will be enabled. The interrupt correspoding to each peripheral is enabled by a bit in one of the control registers of the peripheral(like OCIE bit in case of timer output compare).

In case you were checking for the timer interrupt on the output compare pin, you need to enable the pin output function by setting the OC1E/OC2E bit in CR2.

Hope this helps!

[ This message was edited by: dasg on 07-04-2003 15:39 ]
shreya
Associate II
Posted on April 08, 2003 at 03:35

Hello Ampel,

There is no single bit which will enable all the interrupts. So, if you have a main() with only a ''rim'' instruction, no interrupt will be enabled. The interrupt correspoding to each peripheral is enabled by a bit in one of the control registers of the peripheral(like OCIE bit in case of timer output compare).

In case you were checking for the timer interrupt on the output compare pin, you need to enable the pin output function by setting the OC1E/OC2E bit in CR2.

Hope this helps!

csameling
Associate II
Posted on April 08, 2003 at 05:20

Hello dasg.

Thanks.

The TimerB is responsible for the timing of the OS. So I do not need an output pin for timerB (timerA, too).

regards,

Ampel

PS: Hello Florent.

I tried to send an email to you, but without success.
florent2399
Associate II
Posted on April 08, 2003 at 05:29

Hi Ampel,

To contact me, click on my name in the members section, and then click on 'sent a private message'....That should work; if not, and if needed, I'll give you my EMAil adress...

Cheers!

Florent