-unsigned char jtagid;
-
-//! Get the JTAG ID
-unsigned char jtag430x2_jtagid(){
- jtag430_resettap();
- return jtagid=jtag_ir_shift8(IR_BYPASS);
-}
-//! Start JTAG, take pins
-unsigned char jtag430x2_start(){
- jtagsetup();
-
- //Known-good starting position.
- //Might be unnecessary.
- SETTST;
- SETRST;
-
- delay(0xFFFF);
-
- //Entry sequence from Page 67 of SLAU265A for 4-wire MSP430 JTAG
- CLRRST;
- delay(20);//10
- CLRTST;
-
- delay(10);//5
- SETTST;
- msdelay(10);//5
- SETRST;
- P5DIR&=~RST;
-
- delay(0xFFFF);
-
- //Perform a reset and disable watchdog.
- return jtag430x2_jtagid();
-}
-
-//! Grab the core ID.
-unsigned int jtag430_coreid(){
- jtag_ir_shift8(IR_COREIP_ID);
- return jtag_dr_shift16(0);
-}
-
-//! Grab the device ID.
-unsigned long jtag430_deviceid(){
- jtag_ir_shift8(IR_DEVICE_ID);
- return jtag_dr_shift20(0);
-}