Go to the source code of this file.
Defines | |
| #define | dJTAG_REGISTER_ADDRESS 0x08 |
| #define | dJTAG_REGISTER_ALL 0x0B |
| #define | dJTAG_REGISTER_BYPASS 0x1F |
| #define | dJTAG_REGISTER_CONTROL 0x0A |
| #define | dJTAG_REGISTER_DATA 0x09 |
| #define | dJTAG_REGISTER_DBDX 0x1D |
| #define | dJTAG_REGISTER_DBTX 0x1C |
| #define | dJTAG_REGISTER_EJTAG_BOOT 0x0C |
| #define | dJTAG_REGISTER_EJWATCH 0x1C |
| #define | dJTAG_REGISTER_EXTEST 0x00 |
| #define | dJTAG_REGISTER_IDCODE 0x01 |
| #define | dJTAG_REGISTER_IMPCODE 0x03 |
| #define | dJTAG_REGISTER_NORMAL_BOOT 0x0D |
| #define | dJTAG_REGISTER_SAMPLE 0x02 |
| #define | USB_CAN_BULK_WR_FLAG 1 |
| #define | USB_FOUND 1 |
| #define | USB_NO_FOUND 0 |
| #define | USB_NOT_BULK_WR_FLAG 0 |
Functions | |
| unsigned int | fJTAG_Data (unsigned int ui_data_out) |
| void | fJTAG_Init (void) |
| unsigned char | fJTAG_Instruction (unsigned char uc_data_out) |
| void | fJTAG_unInit (void) |
| #define dJTAG_REGISTER_ADDRESS 0x08 |
Definition at line 74 of file usb_jtag.h.
| #define dJTAG_REGISTER_ALL 0x0B |
Definition at line 77 of file usb_jtag.h.
| #define dJTAG_REGISTER_BYPASS 0x1F |
Definition at line 83 of file usb_jtag.h.
| #define dJTAG_REGISTER_CONTROL 0x0A |
Definition at line 76 of file usb_jtag.h.
| #define dJTAG_REGISTER_DATA 0x09 |
Definition at line 75 of file usb_jtag.h.
| #define dJTAG_REGISTER_DBDX 0x1D |
Definition at line 82 of file usb_jtag.h.
| #define dJTAG_REGISTER_DBTX 0x1C |
Definition at line 80 of file usb_jtag.h.
| #define dJTAG_REGISTER_EJTAG_BOOT 0x0C |
Definition at line 78 of file usb_jtag.h.
| #define dJTAG_REGISTER_EJWATCH 0x1C |
Definition at line 81 of file usb_jtag.h.
| #define dJTAG_REGISTER_EXTEST 0x00 |
Definition at line 70 of file usb_jtag.h.
| #define dJTAG_REGISTER_IDCODE 0x01 |
Definition at line 71 of file usb_jtag.h.
| #define dJTAG_REGISTER_IMPCODE 0x03 |
Definition at line 73 of file usb_jtag.h.
| #define dJTAG_REGISTER_NORMAL_BOOT 0x0D |
Definition at line 79 of file usb_jtag.h.
| #define dJTAG_REGISTER_SAMPLE 0x02 |
Definition at line 72 of file usb_jtag.h.
| #define USB_CAN_BULK_WR_FLAG 1 |
Definition at line 60 of file usb_jtag.h.
| #define USB_FOUND 1 |
Definition at line 56 of file usb_jtag.h.
| #define USB_NO_FOUND 0 |
Definition at line 53 of file usb_jtag.h.
| #define USB_NOT_BULK_WR_FLAG 0 |
Definition at line 63 of file usb_jtag.h.
| unsigned int fJTAG_Data | ( | unsigned int | ui_data_out | ) |
Definition at line 148 of file jtag.c.
References fJTAG_Wiggle(), and usb_wr_dr().
00149 { 00150 unsigned int ui_data_in; 00151 unsigned char uc_index; 00152 unsigned char uc_result; 00153 00154 fJTAG_Wiggle(1, 0); // enter select-dr-scan 00155 fJTAG_Wiggle(0, 0); // enter capture-dr 00156 fJTAG_Wiggle(0, 0); // enter shift-dr 00157 00158 ui_data_in = 0x00; 00159 00160 // Clock all but last bit out 00161 for (uc_index=0; uc_index<31; uc_index++) 00162 { 00163 uc_result = fJTAG_Wiggle(0, (ui_data_out & 0x01)); 00164 ui_data_out = ui_data_out >> 1; 00165 ui_data_in = ui_data_in | (uc_result << uc_index); 00166 } 00167 // On last bit set the TAP_MS 00168 uc_result = fJTAG_Wiggle(1, (ui_data_out & 0x01)); 00169 ui_data_in = ui_data_in | (uc_result << uc_index); 00170 00171 fJTAG_Wiggle(1, 0); // enter update-dr 00172 fJTAG_Wiggle(0, 0); // enter runtest-idle 00173 00174 return(ui_data_in); 00175 }
| void fJTAG_Init | ( | void | ) |
Definition at line 86 of file jtag.c.
References fJTAG_Data(), fJTAG_Instruction(), fJTAG_Wiggle(), fPARPORT_Init(), tap_reset(), USB_CAN_BULK_WR_FLAG, usb_can_bulk_wr_flag, USB_FOUND, usb_fx2_reset(), USB_NO_FOUND, and usb_tap_init().
00087 { 00088 // First we need to init the parallel port 00089 fPARPORT_Init(); 00090 00091 // Wiggle the TAP_RESET bit - Be mindful of the target reset bit 00092 // fPARPORT_Write((unsigned char)mPARPORT_RST_BIT(1)|mPARPORT_TRS_BIT(0)); 00093 // fPARPORT_Write((unsigned char)mPARPORT_RST_BIT(1)|mPARPORT_TRS_BIT(1)); 00094 00095 // Run through a handful of clock cycles with TMS high to make sure 00096 // we are in the TEST-LOGIC-RESET state. 00097 fJTAG_Wiggle(1,0); 00098 fJTAG_Wiggle(1,0); 00099 fJTAG_Wiggle(1,0); 00100 fJTAG_Wiggle(1,0); 00101 fJTAG_Wiggle(1,0); 00102 fJTAG_Wiggle(1,0); 00103 00104 // Enter the RUN-TEST-IDLE state 00105 fJTAG_Wiggle(0,0); 00106 00107 00108 fJTAG_Instruction(1); 00109 printf("IDCODE=0x%08x\n",fJTAG_Data(1)); 00110 fJTAG_Instruction(3); 00111 printf("IMPCODE=0x%08x\n",fJTAG_Data(3)); 00112 00113 return; 00114 }
| unsigned char fJTAG_Instruction | ( | unsigned char | uc_data_out | ) |
Definition at line 354 of file jtag.c.
References fJTAG_Wiggle(), and usb_wr_ir().
00355 { 00356 unsigned char uc_data_in; 00357 unsigned char uc_result; 00358 unsigned char uc_index; 00359 00360 fJTAG_Wiggle(1, 0); // enter select-dr-scan 00361 fJTAG_Wiggle(1, 0); // enter select-ir-scan 00362 fJTAG_Wiggle(0, 0); // enter capture-ir 00363 fJTAG_Wiggle(0, 0); // enter shift-ir (dummy) 00364 00365 uc_data_in=0; 00366 00367 // Clock all but last bit out 00368 for (uc_index=0; uc_index<4; uc_index++) 00369 { 00370 uc_result = fJTAG_Wiggle(0, (uc_data_out & 0x01)); 00371 uc_data_out = uc_data_out >> 1; 00372 uc_data_in = uc_data_in | (uc_result << uc_index); 00373 } 00374 // On last bit set the TAP_MS 00375 uc_result = fJTAG_Wiggle(1, (uc_data_out & 0x01)); 00376 uc_data_in = uc_data_in | (uc_result << uc_index); 00377 00378 fJTAG_Wiggle(1, 0); // enter update-ir 00379 fJTAG_Wiggle(0, 0); // enter runtest-idle 00380 00381 return(uc_data_in); 00382 }
| void fJTAG_unInit | ( | void | ) |
Definition at line 391 of file jtag.c.
References usb_stop().
1.5.6