From: Martin N. <amf...@mg...> - 2018-10-17 09:26:07
|
Hi, I think that @ ! +! 2@ 2! d+! should disable interrupts on the AVR. Although it's possible to code around a variable being changed by an interrupt (using C@ C! for example), the 16-bit counter registers can't be dealt with in a similar way. Section 17.3 of the datasheet "Accessing 16-bit Registers" deals with all this. @ and ! do do the byte accesses in the right order, but an interrupt using the 16-bit registers associated with a particular counter will overwrite the "TEMP (8-bit)" register (see Figure 17-4). Cheers! -- Regards, Martin Nicholas. E-mail: rep...@mg... |