Other Parts Discussed in Thread: MSP430F5529
I am learning msp430f5529 using CCS V6, in the example codes,
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
And the WDTCTL is defined as:
SFR_16BIT(WDTCTL);
#define SFR_16BIT(address) extern volatile unsigned int address
I know the sentence means writing the value of WDTPW | WDTHOLD to the address 0000015C, but
Q1: What is the data type of WDTCTL? Is it extern volatile unsigned int or *(&(extern volatile unsigned int))? Which exact sentence defines the data type of WDTCTL?
Q2: How is 0000015C assigned to WDTCTL? I have searched several previous posts and still don't quite understand.
I am using MSPWare Version 2.21.00.39 which is different from this post
because I cannot find
WDTCTL = 0x015C;
in lnk_msp430f5529.cmd. Instead, in the generated .map file, I can find
address name
------- ----
0000015c WDTCTL
Since .map is generated, How does the compiler assign the exact address to the WDTCTL and all the other registers?
Thanks
Eric