Your browser does not allow scripts
Please click here to view a static table of contents without scripts
JTAG_Write
Return to Introduction  Previous page  Next page
Write data from the FT2232C to an external device using the JTAG protocol.

FTC_STATUS
JTAG_Write
(FTC_HANDLE ftHandle, BOOL bInstructionTestData, DWORD dwNumBitsToWrite, PWriteDataByteBuffer pWriteDataBuffer, DWORD dwNumBytesToWrite, DWORD dwTapControllerState)




Parameters
ftHandle
Handle of the device.
bInstructionTestData
Selects the instruction register (TRUE) or the test register (FALSE) to write data to.
dwNumBitsToWrite
Number of bits to write to the external device. Valid range is 2 to 524280.
pWriteDataBuffer
Pointer to buffer that contains the data to be written to an external device.
dwNumBytesToWrite
Number of bytes in the write data buffer which contain all the specified bits to be written to the external device. Valid range is 1 to 65535 bytes.
dwTapControllerState
State that the Test Access Port (TAP) controller will be left in.




Return Value
FTC_SUCCESS if successful, otherwise the return value is one of the following FTC error codes:

   FTC_INVALID_HANDLE
   FTC_INVALID_NUMBER_BITS
   FTC_NULL_WRITE_DATA_BUFFER_POINTER
   FTC_INVALID_NUMBER_BYTES
   FTC_NUMBER_BYTES_TOO_SMALL
   FTC_INVALID_TAP_CONTROLLER_STATE
   FTC_
FAILED_TO_COMPLETE_COMMAND
   FTC_IO_ERROR



Remarks
This function will write data from the FT2232C to an external device using the JTAG protocol. The data will be clocked at a rate specified by the clock divisor set by calling either the JTAG_InitDevice or JTAG_SetClock functions.

The write data byte buffer definition and valid TAP controller states are given in the
Appendix.



Example

FTC_STATUS Status = FTC_SUCCESS;
FTC_HANDLE ftHandle;
WriteDataByteBuffer WriteDataBuffer;

// Add values to write buffer
WriteDataBuffer[0] = '\x00';
WriteDataBuffer[1] = '\x00';
WriteDataBuffer[2] = '\x00';
WriteDataBuffer[3] = '\x00';

// Write buffer to device
Status = JTAG_Write(ftHandle, true, 32, &WriteDataBuffer, 65535, RUN_TEST_IDLE_STATE);