2005-02-09 09:56 PM
2005-02-08 10:22 PM
How can i make a 50us timer using ST7LITE0? I'm using Indart-stx and the emulation is weird!!! Please help me!!!!!!!!!
2005-02-09 12:01 AM
What do you want to do with the '50µs timer'?
Do you need one shot or periodical events? What are you doing now and what is the result from the emulation in your application? Please give more information! WoRo2005-02-09 12:30 AM
I want to make a periodical sample. The microcontroller must generate an interrupt each 50us. In the emulation, the counters (CNTRH and CNTRL) don't count in a logical order and don't generate overflow. Therefore, the interrupt doesn't occur. I know that my doubt is basic but I'm new in ST Micro. :-] . Thank's for your help!!
2005-02-09 08:04 PM
First an idea:
If you are using HiWare Compiler or assembler you have to take care to write first the MSByte (DCR0H) and then the LSByte (DCR0L) of the timer. Because writing to the DCR0H will disable the compare interrupt. Please see the notes on page 53 of the manual, even for further information. Note: .... At reset, the counter starts counting from 0.
Caution: As soon as the DCR0H is written, the
compare function is disabled and will start only
when the DCR0L value is written.
If the DCR0H write occurs just before the compare event,
the signal on the PWM output may not be set to a low
level. In this case, the DCRx register should be updated
just after an OVF event. If the DCR and ATR
values are close, then the DCRx register shouldbe
updated just before an OVF event, in order not to
miss a compare event and to have the right signal
applied on the PWM output.As 50µs is quite a short time, please have a look at the running-time of your interrupt routine. Regards WoRo
2005-02-09 09:56 PM
I've worked more in my program, and tried follow your idea and it works. Many thank's!! :D