readbyte xsvf
sucan said:
The source code of app058 is C. You can compile it with any C compiler. The only thing you need to do is define four functions in the source code according to the MCU you are using. You can drive the JTAG pins TDI, TDO, TCK and TMS with MCU's general I/O pins. I've accomplished it with AT91FR4081, which is ATMEL's MCU with ARM7TDMI core.
First,thanks for your reply.
I had read the all application notes, it introduce what as you said:just define the TDI/TDO/TCK/TMS for the MCU connection,but I meet some questions about it:
1)at the port.c file,some codes:
/* if in debugging mode, then just set the variables */
void setPort(short p,short val)
{
#ifdef WIN95PP
if (once == 0) {
out_word.bits.one = 1;
out_word.bits.zero = 0;
once = 1;
}
if (p==TMS)
out_word.bits.tms = (unsigned char) val;
if (p==TDI)
out_word.bits.tdi = (unsigned char) val;
if (p==TCK) {
out_word.bits.tck = (unsigned char) val;
(void) _outp( (unsigned short) (base_port + 0), out_word.value );
}
#endif
}
these code only show output data from PC printer port,no code for MCU.
2)the lenval.h define the structure lenVal:
typedef struct var_len_byte
{
short len; /* number of chars in this value */
unsigned char val[MAX_LEN+1]; /* bytes of data */
} lenVal;
I define MAX_LEN 4,so lenVal need 7 bytes,the micro.c define the structure tagSXsvfInfo:
typedef struct tagSXsvfInfo
{
/* XSVF status information */
unsigned char ucComplete; /* 0 = running; 1 = complete */
unsigned char ucCommand; /* Current XSVF command byte */
long lCommandCount; /* Number of commands processed */
int iErrorCode; /* An error code. 0 = no error. */
/* TAP state/sequencing information */
unsigned char ucTapState; /* Current TAP state */
unsigned char ucEndIR; /* ENDIR TAP state (See SVF) */
unsigned char ucEndDR; /* ENDDR TAP state (See SVF) */
/* RUNTEST information */
unsigned char ucMaxRepeat; /* Max repeat loops (for xc9500/xl) */
long lRunTestTime; /* Pre-specified RUNTEST time (usec) */
/* Shift Data Info and Buffers */
long lShiftLengthBits; /* Len. current shift data in bits */
short sShiftLengthBytes; /* Len. current shift data in bytes */
lenVal lvTdi; /* Current TDI shift data */
lenVal lvTdoExpected; /* Expected TDO shift data */
lenVal lvTdoCaptured; /* Captured TDO shift data */
lenVal lvTdoMask; /* TDO mask: 0=dontcare; 1=compare */
#ifdef XSVF_SUPPORT_COMPRESSION
/* XSDRINC Data Buffers */
lenVal lvAddressMask; /* Address mask for XSDRINC */
lenVal lvDataMask; /* Data mask for XSDRINC */
lenVal lvNextData; /* Next data for XSDRINC */
#endif /* XSVF_SUPPORT_COMPRESSION */
} SXsvfInfo;
this structure include many lenVal,
So I don't think a AT89C52 mcu have so much ram.