This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I have some questions regarding the MSP430F21x2 Device Erratasheet, SLAZ041C–March 2008–Revised January 2010
and the bug CPU19 CPU Module: CPUOFF can change register values.
The errata says:
If a CPUOFF command is followed by an instruction with an indirect addressed operand
(for example, mov @R8, R9, and RET), an unintentional register-read operation can
occur during the wakeup of the CPU. If the unintentional read occurs to a read-sensitive
register (for example, UCB0RXBUF or TAIV), which changes its value or the value of
other registers (IFGs), the bug leads to lost interrupts or wrong register read values.
First: what exactly is an CPUOFF command? Is it any instruction setting or clearing the CPUOFF bit in the status register?
Second: if I enter LPM3 in the main loop, and then wakes up by an interrupt. Which instruction is defined to follow the CPUOFF command? Is it the first instruction after the LPM3 command in the main loop or is it the first instruction in the ISR?
/Peter
Yes. Any command that sets the CPUOFF bit (or rather the fact that the CPUOFF bit is set) triggers this erratum.PeterETT said:what exactly is an CPUOFF command? Is it any instruction setting or clearing the CPUOFF bit in the status register?
That's the reason of this problem: when the CPUOFF bit is set (so the target of the operation is the status register and no memory address), the next instruction is fetched from flash simultaneously (pipelining). Then MCLK stops, while the next isntruction has been already fetched.PeterETT said:if I enter LPM3 in the main loop, and then wakes up by an interrupt. Which instruction is defined to follow the CPUOFF command? Is it the first instruction after the LPM3 command in the main loop or is it the first instruction in the ISR?
Easiest workaround is to place a NOP right behind any instruction that sets the CPUOFF bit.
BTW: for the same reason you shouldn't set abreakpoint on the command immediately following a CPUOFF. The breakpoint is triggered when teh instruciton is fetched, and this happens immediately, before the low power mode is entered, even if the instruction would be executed after LPM has been ended.
**Attention** This is a public forum