Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_SetBitMode Example
Return to Introduction  Previous page  Next page
1) To enable MPSSE Mode:

HANDLE ftHandle;   // valid handle returned from FT_Open or FT_W32_CreateFile
FT_STATUS ftStatus;
UCHAR Mask = 0xff;   // set all IOs to output
UCHAR Mode = 2;   // set MPSSE mode
ftStatus = FT_SetBitMode(ftHandle,Mask,Mode);
if (ftStatus == FT_OK) {
   // MPSSE Mode enabled  
}
else {
   // FT_SetBitMode FAILED!
}



2) To enable Asynchronous Bit Bang Mode (See
AN232BM-01):

HANDLE ftHandle;   // valid handle returned from FT_Open or FT_W32_CreateFile
FT_STATUS ftStatus;
UCHAR Mask = 0x07;   // set bits 0, 1 and 2 to output
UCHAR Mode = 1;   // set Asynchronous Bit Bang mode
ftStatus = FT_SetBitMode(ftHandle,Mask,Mode);
if (ftStatus == FT_OK) {
   // Asynchronous Bit bang Mode enabled  
}
else {
   // FT_SetBitMode FAILED!
}



3) To reset the IO bit mode:

ftStatus = FT_SetBitMode(ftHandle,0,0);



4) To enable Synchrounous Bit Bang mode (using D2XXUnit.pas for Delphi):

Set_USB_Device_BitMode($00,$04); to enable it
Set_USB_Device_BitMode($00,$00); to reset it



5) To enable For MCU Host Bus Emulation mode (using D2XXUnit.pas for Delphi):

Set_USB_Device_BitMode($00,$08); to enable it
Set_USB_Device_BitMode($00,$00); to reset it