FTDI USB BitBang example code for Visual Basic

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,
Does anyone have or know where to find FTDI USB BitBang example code for
Visual Basic?
I am using the direct drivers, but am having difficulty with a few of the
calls.
Thanks,
Steve



Re: FTDI USB BitBang example code for Visual Basic
Steve,

I presume that you really me "byte-banging"?
I have some VB "byte-banging" code for the
FTDI USB direct drivers, but not bitBanging.



Option Explicit

Public Declare Function FT_ListDevices Lib "FTD2XX.DLL" (ByRef
lngIndex As Long, ByRef strBuffer As Variant, ByVal lngFlags As Long)
As Long
Public Declare Function FT_OpenEx Lib "FTD2XX.DLL" (ByVal lpszBuffer
As String, ByVal lngFlags As Long, ByRef lngHandle) As Long
Public Declare Function FT_Open Lib "FTD2XX.DLL" (ByVal
lngDeviceNumber As Long, ByRef lngHandle As Long) As Long
Public Declare Function FT_Close Lib "FTD2XX.DLL" (ByVal lngHandle As
Long) As Long
Public Declare Function FT_Read Lib "FTD2XX.DLL" (ByVal lngHandle As
Long, ByVal lpszBuffer As String, ByVal lngBufferSize As Long, ByRef
lngBytesReturned As Long) As Long
Public Declare Function FT_Write Lib "FTD2XX.DLL" (ByVal lngHandle As
Long, ByVal lpszBuffer As String, ByVal lngBufferSize As Long, ByRef
lngBytesWritten As Long) As Long
Public Declare Function FT_ResetDevice Lib "FTD2XX.DLL" (ByVal
lngHandle As Long) As Long
Public Declare Function FT_GetModemStatus Lib "FTD2XX.DLL" (ByVal
lngHandle As Long, ByRef lngModemStatus As Long) As Long
Public Declare Function FT_Purge Lib "FTD2XX.DLL" (ByVal lngHandle As
Long, ByVal lngMask As Long) As Long
Public Declare Function FT_GetStatus Lib "FTD2XX.DLL" (ByVal lngHandle
As Long, ByRef lngRxBytes As Long, ByRef lngTxBytes As Long, ByRef
lngEventsDWord As Long) As Long
Public Declare Function FT_GetQueueStatus Lib "FTD2XX.DLL" (ByVal
lngHandle As Long, ByRef lngRxBytes As Long) As Long
Public Declare Function FT_GetEventStatus Lib "FTD2XX.DLL" (ByVal
lngHandle As Long, ByRef lngEventsDWord As Long) As Long
Public Declare Function FT_SetTimeouts Lib "FTD2XX.DLL" (ByVal
lngHandle As Long, ByVal lngReadTimeout As Long, ByVal lngWriteTimeout
As Long) As Long
Public Declare Function FT_SetEventNotification Lib "FTD2XX.DLL"
(ByVal lngHandle As Long, ByVal lngEventMask As Long, ByVal
lngFunctionPointer As Long) As Long



wrote:
Quoted text here. Click to load it


Re: FTDI USB BitBang example code for Visual Basic
Quoted text here. Click to load it

Thanks,
The RevB FTDI chips have a new mode called BitBang mode.  This basically
latches data to the data lines until another write is performed.
Reading also possible.  Individual bits can be I or O.  I was able to
get some examples from dlpdesign to work with.
Steve

Site Timeline