Your browser does not allow scripts
Please click here to view a static table of contents without scripts
JTAG_InitDevice
Return to Introduction  Previous page  Next page
Initialise the device.

FTC_STATUS
JTAG_InitDevice
(FTC_HANDLE ftHandle, DWORD dwClockDivisor)




Parameters
ftHandle
Handle of the device.
dwClockDivisor
Specifies a clock divisor which will be used to set the frequency for clocking data in and out of the FT2232C device.




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

   FTC_INVALID_HANDLE
   FTC_INVALID_CLOCK_DIVISOR
   FTC_
FAILED_TO_SYNCHRONIZE_DEVICE_MPSSE
   
FTC_FAILED_TO_COMPLETE_COMMAND
   FTC_IO_ERROR
   
FTC_INSUFFICIENT_RESOURCES



Remarks
This function initializes the FT2232C device, by carrying out the following:

·   resets the device and purge device USB input buffer  
·   sets the device USB input and output buffers to 64K bytes  
·   sets the special characters for the device, disable event and error characters  
·   sets the device read timeout to infinite  
·   sets the device write timeout to 5 seconds  
·   sets the device latency timer to 16 milliseconds  
·   reset MPSSE controller  
·   enable MPSSE controller  
·   synchronize to the MPSSE controller  
·   resets the device and purge device USB input buffer  
·   set data in and data out clock frequency  
·   set MPSSE loopback state to off (default)  
·   resets the device and purge device USB input buffer  
·   reset Test Access Port (TAP) controller of an external device  
·   set the Test Access Port (TAP) controller of an external device to test idle mode  

The valid range for
dwClockDivisor
is 0 to 65535. The highest clock frequency is represented by 0, which is equivalent to 6MHz and the lowest clock frequency is represented by 65535, which is equivalent to 91Hz. This can be calculated using the following formula:

   
Clock Frequency = 12MHz / ((1 + dwClockDivisor) * 2)



Example

FTC_STATUS Status = FTC_SUCCESS;
FTC_HANDLE ftHandle;
DWORD dwClockDivisor = 0;

Status = JTAG_InitDevice(ftHandle, dwClockDivisor);