cancel
Showing results for 
Search instead for 
Did you mean: 

ATR upload

lseletron
Associate II
Posted on October 27, 2006 at 04:43

ATR upload

4 REPLIES 4
lseletron
Associate II
Posted on October 25, 2006 at 02:05

Hi,

The datasheet for ST7DALI states that the ATR is uploaded automatically when the counter overflows. If I have an overflow interrupt routine how far from the start (in terms of time) of the routine I can change ATR so it starts the next count with the new value:

// ATR=1000; // initialize ATR at boot

interrupt void ATR()

{

// if I change ATR to 2000 here will the counter start from 2000

...

// some useful code

// Here is too late to change ATR, the counter has already started

// counting with the old value (1000)

}

}

fggnrc
Associate II
Posted on October 26, 2006 at 04:47

zsavov,

when the auto reload counter overflows, its value is reloaded with the content of ATR register and a flag is raised. This flag, if the auto-reload conter overflow interrupt is enabled, will fire the interrupt handler when any already running interrupt handler releases the ST7 core.

Regards

EtaPhi

lseletron
Associate II
Posted on October 26, 2006 at 23:07

Hi EtaPhi,

So this means that (long) before the overflow interrupt routine is called the new ATR is uploaded and at the time the overflow interrupt routine is called the ATR counter will have counted for some time.

Is that correct?

Sorry for the repetiotion, I just want to get the ATR mechanism of work right

Thank you

fggnrc
Associate II
Posted on October 27, 2006 at 04:43

Yes, zsavov, you are right.