[Icc-avr] Global Interrupts

John Baraclough j_baraclough at zetnet.co.uk
Tue Jan 8 15:42:09 PST 2008


Maybe you didn't get my previous post. Please trim all the unnecessary 
stuff from the end of your posts so we can get a clearer picture of what 
it is you are asking.

The answer is to do the maths, and work out how long 40 SPI transfers at 
2MHz will take (double it if they are 16-bit transfers). If it's less 
than 100 mSec you'll be OK. Next, read the data sheet and find out how 
to do SPI transfers under interrupt control. That way you don't need to 
turn interrupts off.

You have contradicted yourself in the last two parts of your post. 
Firstly you say the timer is used as an overflow timer and then you ask 
if you should reset the count value. Read the data sheet and decide 
which mode you are going to operate the timer in, then ask the question.

John

BTW I hope we are going to get a look at the final product, so we can 
see what it is we have designed.


Andrew wrote:
>
> Kinda basically is it safe to do it is the question. although the ADC 
> is clocked at 2MHz and i am reading only 4 channels 10 times i am 
> worried about the timer interrupt srewing the ADC reading process. So 
> i thought i would be best if i turn off all interrupts do my reads and 
> turn them back on.
>
> The timer is used as an overflow timer as in i do something each time 
> it overflows (on it's interrupt) although it is used to check the ADC 
> values every 500ms (which would be 5 interrupt counts), time out for a 
> usb buffer collect and de-bouncer.
>
> is it safer to reset the count value after the enable?
>
> Andy



More information about the Icc-avr mailing list