void jtagsetup(){
P5DIR|=MOSI+SCK+TMS;
P5DIR&=~MISO;
+ /*
P5OUT|=0xFFFF;
P5OUT=0;
+ */
P4DIR|=TST;
P2DIR|=RST;
msdelay(100);
P4OUT=0;
}
-unsigned int drwidth=20;
+unsigned int drwidth=16;
//! Shift all bits of the DR.
unsigned long jtag_dr_shift20(unsigned long in){
// idle
return(jtagtransn(in,16));
}
+//! Shift native width of the DR
+unsigned long jtag_dr_shiftadr(unsigned long in){
+ unsigned long out=0;
+
+ // idle
+ SETTMS;
+ TCKTOCK;
+ // select DR
+ CLRTMS;
+ TCKTOCK;
+ // capture IR
+ TCKTOCK;
+
+
+ out=jtagtransn(in,drwidth);
+
+ // shift DR, then idle
+ return(out);
+}
+
//! Shift 8 bits of the IR.
unsigned char jtag_ir_shift8(unsigned char in){