I am trying to learning about the Watch Dog Timer peripheral of MSP430FR6989 (link to MSP430).
It's Watch Dog Timer peripheral WDT_A have a 16 bit control register (WDTCTL), in order to perform a write operation, we need to load 0x5A in it's upper byte.
If we want to perform read operation we would read 0x69 to the upper byte.
(User Guide page 635)
write accesses must include the write password 05Ah in the upper byte. A write to WDTCTL with any value other than 05Ah in the upper byte is a password violation and causes a PUC system reset, regardless of timer mode. Any read of WDTCTL reads 069h in the upper byte.
This is my code:
#include <msp430.h>
int main(void)
{
WDTCTL = 0x5A80;
PM5CTL0 = 0xFFFE;//Line A
//rest of the code
while(1);
return 0;
}
When, I build it and debug it, and the debugger reaches line A, I expected WDTCTL = 0x5A80
, not WDTCTL = 0x6980
(image below).
I understand, if I have a statement like if(WDTCTL == number)
, we would find WDTCTL = 0x69XX
, but why do I see 0x6980
at the Register Watch Window, when I just assigned 0x5A80
to it.