1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | main () { WriteDataBuffer_t WriteDataBuffer; Convert_Module_Init (); // 初始化USB-JTAG 接口转换模块 JTAG_ Reset (); // 使JTAG 回到TEST - LOGIC - RESET 状态 // 使JTAG 进入SHIFT - IR 状态 JTAG_State_Shift (TEST_LOGIC_RESET, SHIFT_IR); WriteDataBuffer = 0x00; JTAG_Write(WriteDataBuffer, 7); // 移入EXTEST 指令,即0000000B JTAG_ State_Shift (SHIFT_IR, TEST_LOGIC_RESET); // 使JTAG 进入SHIFT - DR 状态 JTAG_ State_Shift (TEST_LOGIC_RESET, SHIFT_DR); // 将0xFF 写入地址0x00, W_OPER 表示inout 双向管脚处于写模式(out) CPU_Set_BSR (0xFF, 0x00, W_OPER, & WriteDataBuffer); JTAG_Write(WriteDataBuffer, 357); // 串行移入扫描链单元 JTAG_ State_Shift (SHIFT_DR, TEST_LOGIC_RESET); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | void JTAG_Reset (void) // 使JTAG 回到TEST - LOGIC - RESET 状态 { int i; WriteDataBuffer_t WriteDataBuffer = 0x01; for (i = 0; i <5 ; i ++) { JTAG_Write (WriteDataBuffer, 1) ; } } void JTAG_ State_Shift (J_State_t From_S, J_State_t To_S) { // 根据状态机和参数输入,从From_S 状态转移到To_S 状态 } void JTAG_Write (WriteDataBuffer_t WriteDataBuffer, int Len) { // 根据Len 指定的长度,把WriteDataBuffer 中的数据通过TDI 串行移出 } void CPU_Set_BSR (U32 Data, U32 Addr, Oper_t Oper, WriteDataBuffer_t * WriteDataBuffer) { // 根据输入参数,对CPU 扫描链单元赋值 } |
wenzi4402996 发表于 2014-9-27 20:58
大侠们 怎么转积分啊
wenzi4402996 发表于 2014-9-27 20:58
大侠们 怎么转积分啊
欢迎光临 DIY编程器网 (http://diybcq.com/) | Powered by Discuz! X3.2 |