SLAU320AJ July 2010 – May 2021
To write to a memory location in peripherals or to RAM (but not to flash or FRAM), the R/W signal must be set to WRITE using the JTAG control signal register (bit 0 set to 0). The MAB must be set to the specific address using the IR_ADDR_16BIT instruction while TCLK is low. The MDB must be set to the data value to be written using the IR_DATA_TO_ADDR instruction and a 16-bit JTAG data input shift. On the next rising edge of TCLK, this data is written to the selected address set by the value on the MAB. When TCLK is asserted low, the next address and data to be written can be applied to the MAB and MDB. After completion of the write operation, it is recommended to set the R/W signal back to READ. Following is the flow for a peripheral or RAM memory address write. Implementations for both the MSP430 and MSP430X architectures are shown.
Set CPU to stopped state (HaltCPU) | |||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x2408) | : To write a word in memory. For a byte, the value to shift is 0x2418. | ||
IR_SHIFT("IR_ADDR_16BIT") | Yes | ||
DR_SHIFT16("Address") | : Set desired address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16("Data") | : Send 16-bit Data | ||
SetTCLK | |||
Write again? | |||
No | |||
ReleaseCPU should now be executed, returning the CPU to normal operation. |
Set CPU to stopped state (HaltCPU) | |||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x2408) | : To write a word in memory. For a byte, the value to shift is 0x2418. | ||
IR_SHIFT("IR_ADDR_16BIT") | Yes | ||
DR_SHIFT20("Address") | : Set desired address | ||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16("Data") | : Send 16-bit Data | ||
SetTCLK | |||
Write again? | |||
No | |||
ReleaseCPU should now be executed, returning the CPU to normal operation. |
CPU must be in the Full-Emulation-State before the following sequence. | |||
ClrTCLK | Yes | ||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x0500) | : To write a word in memory. For a byte, the value to shift is 0x0510. | ||
IR_SHIFT("IR_ADDR_16BIT") | |||
DR_SHIFT20("Address") | : Set desired address | ||
SetTCLK | |||
IR_SHIFT("IR_DATA_TO_ADDR") | |||
DR_SHIFT16("Data") | : Send 16-bit Data | ||
ClrTCLK | |||
IR_SHIFT("IR_CNTRL_SIG_16BIT") | |||
DR_SHIFT16(0x0501) | |||
SetTCLK | |||
ClrTCLK | |||
SetTCLK | |||
Write again? | |||
No | |||
CPU is now again in Full-Emulation-State. |