FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: About "FT232H Asynchronous Bit-Bang. Read data." old topic.  (Read 3716 times)

graff58

  • Newbie
  • *
  • Posts: 3
    • View Profile

Hello  :)
I'm a newbie about FTDI and recently I have read the post of "Transformer/V" dated January 2022 regarding with FT232H async bit/bang reading problem. I would like to submit a slightly modified code of AN_373 (2.3 Async ... Sample Code) where the array data_out[7] is sent "byte by byte" to the device. By doing so the single byte can be read before it is overwritten. It seems that the device fills the 64kB buffer with that byte (I read the location 32768 but any value up to 65535 is the same). After each write/read cycle I purge both TX and RX buffers.
I think it is a very trivial way to perform the reading in asynchronous bit-bang and I would like to know if the there is a better way to do it because, as Transformer-V, I have not found any code like that.
I have tested it on UM232H, UM230XB, UM201XB, UMFT200XD.
Thank you.
Guido Raffone

The code is:

Code: [Select]
// This code is provided as an example only and is not supported or guaranteed by FTDI.
// It is the responsibility of the recipient to ensure correct operation of their
// overall system.
//
// Asynchronous bit-bang Mode Sample Code
// Write the 7 bytes 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 to the data pins
// ... and Read

#include <windows.h>
#include <ftd2xx.h>
#include <stdio.h>

FT_STATUS ftStatus;
FT_HANDLE ftHandle;
DWORD w_data_len = 7; // write 7 bytes
DWORD data_written; // number of bytes written
UCHAR Mask = 0xFF; // all output (output (1) and input (0))
UCHAR Mode = 0x01; // 0x01 = asynchronous bit-bang

DWORD RxBytes; // number of bytes to be read from the device
DWORD BytesReceived; // number of bytes read from the device
byte RxBuffer[65536]; // 64kB buffer to receive data from FT-X device

int main()
{
ftStatus = FT_Open(0, &ftHandle);
ftStatus |= FT_SetUSBParameters(ftHandle, 4096, 4096); // Set USB transfer sizes
ftStatus |= FT_SetChars(ftHandle, false, 0, false, 0); // Disable event characters
ftStatus |= FT_SetTimeouts(ftHandle, 5000, 5000); // Set read/write timeouts to 5 sec
ftStatus |= FT_SetLatencyTimer(ftHandle, 16); // Latency timer at default 16ms
ftStatus |= FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0x11, 0x13);
ftStatus |= FT_SetBaudRate(ftHandle, 62500); //bit rate is x16 this value = 1M
if (ftStatus != FT_OK)
{
printf("ftStatus not ok %d\n", ftStatus); //check for error
printf("Press Return to Exit\n");
getchar();
}
else
{
byte data_out[7]{}; // data to send 7 bytes of alternate 0x55 and 0xAA
// byte data_out[7]{ 0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF }; // data to send 7 bytes of other values to check
int x;
for (x = 0; x < 7; x = x + 2) data_out[x] = 0x55; // set even data_out values to 0x55
for (x = 1; x < 7; x = x + 2) data_out[x] = 0xAA; // set odd data_out values to 0xAA
byte data_out_single[1]{}; // data to send 1 byte only

// enter asynchronous bit-bang mode
ftStatus = FT_SetBitMode(ftHandle,Mask,Mode);

// Write 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 to the pins
// For example 0x55 = 01010101b
// Data pin:        D7    D6    D5    D4    D3    D2    D1    D0
// Value written     0     1     0     1     0     1     0     1

for (x = 0; x < 7; x++) // write data_out[7] byte by byte
{

data_out_single[0] = data_out[x];
// ftStatus = FT_Write(ftHandle, data_out, w_data_len, &data_written); // old instructions
// if ((ftStatus == FT_OK) && (7 == data_written)) printf("FT_Write successful\n"); // old instructions
ftStatus = FT_Write(ftHandle, data_out_single, 1, &data_written);
if ((ftStatus == FT_OK) && (1 == data_written))
printf("FT_Write successful;  data_written = %5i     data_out[%x] = 0x%02x (byte %i)\n", data_written, x, data_out_single[0], x);
else
printf("ftStatus FT_Write not ok %d\n", ftStatus);

while (RxBytes != 65536) // wait until the 64kB buffer is filled
{
FT_GetQueueStatus(ftHandle, &RxBytes);
Sleep(1);
}

ftStatus = FT_Read(ftHandle, RxBuffer, RxBytes, &BytesReceived); // read 64kB buffer
if (ftStatus == FT_OK && (BytesReceived == 65536)) // print any location between 0 and 65535 (here is 32768)
printf("FT_Read  successful; BytesReceived = %5i RxBuffer[32768] = 0x%02x (byte %i)\n\n", BytesReceived, RxBuffer[32768], x);
else
printf("ftStatus FT_Read not ok %d\n", ftStatus);

RxBytes = 0;
for (unsigned int j = 0; j < 65536; j++) RxBuffer[j] = 0x00;
do ftStatus = FT_StopInTask(ftHandle); while (ftStatus != FT_OK);
ftStatus = FT_Purge(ftHandle, FT_PURGE_RX | FT_PURGE_TX); // Purge both Rx and Tx buffers
do ftStatus = FT_RestartInTask(ftHandle); while (ftStatus != FT_OK);
}

printf("Press Return to reset bit mode & close device\n");
getchar();
Mode = 0x00; //reset bit mode - pins return to status pre bit-bang mode
ftStatus = FT_SetBitMode(ftHandle, Mask, Mode);
}
ftStatus = FT_Close(ftHandle); //close device
}

and the output is:

Code: [Select]
FT_Write successful;  data_written =     1     data_out[0] = 0x55 (byte 0)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 0)

FT_Write successful;  data_written =     1     data_out[1] = 0xaa (byte 1)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0xaa (byte 1)

FT_Write successful;  data_written =     1     data_out[2] = 0x55 (byte 2)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 2)

FT_Write successful;  data_written =     1     data_out[3] = 0xaa (byte 3)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0xaa (byte 3)

FT_Write successful;  data_written =     1     data_out[4] = 0x55 (byte 4)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 4)

FT_Write successful;  data_written =     1     data_out[5] = 0xaa (byte 5)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0xaa (byte 5)

FT_Write successful;  data_written =     1     data_out[6] = 0x55 (byte 6)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 6)

Press Return to reset bit mode & close device
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 906
    • View Profile
Re: About "FT232H Asynchronous Bit-Bang. Read data." old topic.
« Reply #1 on: June 03, 2024, 04:27:12 pm »

Hello,

AN_373 contains example code only.

This code sets all to output:

UCHAR Mask = 0xFF; // all output (output (1) and input (0))

There is FT_GetQueueStatus/FT_Read code in AN_373 synchronous bit-bang that you can reference.

For FT_Read there should be no need to wait until 65536 bytes have been received. 
Just call FT_GetQueueStatus to see if there is any data to be read then perform FT_Read.

Code: [Select]
do
{
FT_GetQueueStatus(ftHandle, &RxBytes);
}
while (RxBytes != (w_data_len));

if (RxBytes > 0)
{
ftStatus = FT_Read(ftHandle, RxBuffer, RxBytes, &BytesReceived);
printf("%d bytes received\n \n", BytesReceived);
for (i = 0;i < BytesReceived;i++) printf("RxBuffer %d: %x\n", i,RxBuffer[i]);
.
.
.

If you have pins defined as input, you could get their current states from FT_GetBitMode API.

Maybe some other FTDI Community users can help you further.

Best Regards,
FTDI Community
Logged

graff58

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: About "FT232H Asynchronous Bit-Bang. Read data." old topic.
« Reply #2 on: June 04, 2024, 01:34:53 pm »

Thank you for the quick reply (I put that post in a wrong topic and should be moved to the Discussion - Software topic).
OK, let's try the async bit-bang in loopback (as the sync bit-bang example of AN_373) trying to read the pin status for UM232H:

Mask = 0x0F, connect D0 to D4, D1 to D5, D2 to D6, D3 to D7 and 5V0 to USB
data_out[7] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06}

and then RxBuffer[7] should be:

RxBuffer[7] {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}

Your suggested code should be something like that:

Code: [Select]
// This code is provided as an example only and is not supported or guaranteed by FTDI.
// It is the responsibility of the recipient to ensure correct operation of their
// overall system.
//
// Asynchronous bit-bang Mode Sample Code
// Write the 7 bytes 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 to the data pins
// ... and Read in loopback mode for UM232H (Mask = 0x0F, connect D0 to D4, D1 to D5, D2 to D6, D3 to D7 and 5V0 to USB)

#include <windows.h>
#include <ftd2xx.h>
#include <stdio.h>

FT_STATUS ftStatus;
FT_HANDLE ftHandle;
DWORD w_data_len = 7; // write 7 bytes
DWORD data_written; // number of bytes written
UCHAR Mask = 0x0F; // 0x0F mask for UM232H in loopback; D0 to D3 output and D4 to D7 input ; output (1) and input (0)
UCHAR Mode = 0x01; // 0x01 = asynchronous bit-bang

DWORD RxBytes; // number of bytes to be read from the device
DWORD BytesReceived; // number of bytes read from the device
byte RxBuffer[7]; // buffer to receive data from FT-X device

int main()
{
ftStatus = FT_Open(0, &ftHandle);
ftStatus |= FT_SetUSBParameters(ftHandle, 4096, 4096); // Set USB transfer sizes
ftStatus |= FT_SetChars(ftHandle, false, 0, false, 0); // Disable event characters
ftStatus |= FT_SetTimeouts(ftHandle, 5000, 5000); // Set read/write timeouts to 5 sec
ftStatus |= FT_SetLatencyTimer(ftHandle, 16); // Latency timer at default 16ms
ftStatus |= FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0x11, 0x13);
ftStatus |= FT_SetBaudRate(ftHandle, 62500); //bit rate is x16 this value = 1M
if (ftStatus != FT_OK)
{
printf("ftStatus not ok %d\n", ftStatus); //check for error
printf("Press Return to Exit\n");
getchar();
}
else
{
byte data_out[7]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06}; // data to send 7 bytes for UM232H in loopback;
unsigned int x;

// enter asynchronous bit-bang mode
ftStatus = FT_SetBitMode(ftHandle,Mask,Mode);

// Write 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 to the pins in loopback mode
// For example 0x05 = 01010101b (write) -> 0x55 = 01010101 (read)
// Data pin:        D7    D6    D5    D4    D3    D2    D1    D0
// write byte 0      0     0     0     0     0     0     0     0 (0x00)
// read  byte 0      0     0     0     0     0     0     0     0 (0x00)
// write byte 1      0     0     0     0     0     0     0     1    (0x01)
// read  byte 1      0     0     0     1     0     0     0     1    (0x11)
// write byte 2      0     0     0     0     0     0     1     0    (0x02)
// read  byte 2      0     0     1     0     0     0     1     0    (0x22)
// write byte 3      0     0     0     0     0     0     1     1    (0x03)
// read  byte 3      0     0     1     1     0     0     1     1    (0x33)
// write byte 4      0     0     0     0     0     1     0     0    (0x04)
// read  byte 4      0     1     0     0     0     1     0     0    (0x44)
// write byte 5      0     0     0     0     0     1     0     1    (0x05)
// read  byte 5      0     1     0     1     0     1     0     1    (0x55)
// write byte 6      0     0     0     0     0     1     1     0    (0x06)
// read  byte 6      0     1     1     0     0     1     1     0    (0x66)

ftStatus = FT_Write(ftHandle, data_out, w_data_len, &data_written); // old instructions
if ((ftStatus == FT_OK) && (7 == data_written)) printf("FT_Write successful\n"); // old instructions

do // your suggestion
{                                                                              // RxBytes never equals w_data_len (endless loop)
FT_GetQueueStatus(ftHandle, &RxBytes); // print on the same line the RxBytes returned
printf("\rRxBytes = %i ... (Godot loop)", RxBytes);
} while (RxBytes != (w_data_len)); // try first with w_data_len = 7
// } while (RxBytes != 65536); // then try with 65536

if (RxBytes > 0) // your suggestion
{
ftStatus = FT_Read(ftHandle, RxBuffer, RxBytes, &BytesReceived);
printf("\n%d bytes received\n \n", BytesReceived);
for (x = 0; x < BytesReceived; x++) printf("RxBuffer %d: %x\n", x, RxBuffer[x]);
}

printf("Press Return to reset bit mode & close device\n");
getchar();
Mode = 0x00; //reset bit mode - pins return to status pre bit-bang mode
ftStatus = FT_SetBitMode(ftHandle, Mask, Mode);
}
ftStatus = FT_Close(ftHandle); //close device
}

I place a print (on the same line) inside the waiting loop of the RxBytes returned from FT_GetQueueStatus and the output is:

Code: [Select]
FT_Write successful
RxBytes = 65536 ... (Godot loop)

i.e. the code hungs and must be aborted because RxBytes never equals w_data_len = 7 but gets the value of 65536 in steps of 4096 bytes.

At this point the line

Code: [Select]
while (RxBytes != (w_data_len)); // try first with w_data_len = 7

could be replace with the line

Code: [Select]
while (RxBytes != 65536); // then try with 65536

and the output is:

Code: [Select]
FT_Write successful
RxBytes = 65536 ... (Godot loop)
0 bytes received
 
Press Return to reset bit mode & close device

that is the loop end for RxBytes = 65536 but the RxBuffer[7] is empty; at this point I propose again my code as follows:

Code: [Select]
// This code is provided as an example only and is not supported or guaranteed by FTDI.
// It is the responsibility of the recipient to ensure correct operation of their
// overall system.
//
// Asynchronous bit-bang Mode Sample Code
// Write the 7 bytes 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 to the data pins
// ... and Read in loopback mode for UM232H (Mask = 0x0F, connect D0 to D4, D1 to D5, D2 to D6, D3 to D7 and 5V0 to USB)

#include <windows.h>
#include <ftd2xx.h>
#include <stdio.h>

FT_STATUS ftStatus;
FT_HANDLE ftHandle;
DWORD data_written; // number of bytes written
UCHAR Mask = 0x0F; // 0x0F mask for UM232H in loopback; D0 to D3 output and D4 to D7 input ; output (1) and input (0);
UCHAR Mode = 0x01; // 0x01 = asynchronous bit-bang

DWORD RxBytes; // number of bytes to be read from the device
DWORD BytesReceived; // number of bytes read from the device
byte RxBuffer[65536]; // 64kB buffer to receive data from FT-X device

int main()
{
ftStatus = FT_Open(0, &ftHandle);
ftStatus |= FT_SetUSBParameters(ftHandle, 4096, 4096); // Set USB transfer sizes
ftStatus |= FT_SetChars(ftHandle, false, 0, false, 0); // Disable event characters
ftStatus |= FT_SetTimeouts(ftHandle, 5000, 5000); // Set read/write timeouts to 5 sec
ftStatus |= FT_SetLatencyTimer(ftHandle, 16); // Latency timer at default 16ms
ftStatus |= FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0x11, 0x13);
ftStatus |= FT_SetBaudRate(ftHandle, 62500); //bit rate is x16 this value = 1M
if (ftStatus != FT_OK)
{
printf("ftStatus not ok %d\n", ftStatus); //check for error
printf("Press Return to Exit\n");
getchar();
}
else
{
byte data_out[7]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06}; // data to send 7 bytes for UM232H in loopback;
unsigned int x;
byte data_out_single[1]{}; // data to send 1 byte only

// enter asynchronous bit-bang mode
ftStatus = FT_SetBitMode(ftHandle, Mask, Mode);

// Write 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 to the pins in loopback mode
// For example 0x05 = 01010101b (write) -> 0x55 = 01010101 (read)
// Data pin:        D7    D6    D5    D4    D3    D2    D1    D0
// write byte 0      0     0     0     0     0     0     0     0 (0x00)
// read  byte 0      0     0     0     0     0     0     0     0 (0x00)
// write byte 1      0     0     0     0     0     0     0     1    (0x01)
// read  byte 1      0     0     0     1     0     0     0     1    (0x11)
// write byte 2      0     0     0     0     0     0     1     0    (0x02)
// read  byte 2      0     0     1     0     0     0     1     0    (0x22)
// write byte 3      0     0     0     0     0     0     1     1    (0x03)
// read  byte 3      0     0     1     1     0     0     1     1    (0x33)
// write byte 4      0     0     0     0     0     1     0     0    (0x04)
// read  byte 4      0     1     0     0     0     1     0     0    (0x44)
// write byte 5      0     0     0     0     0     1     0     1    (0x05)
// read  byte 5      0     1     0     1     0     1     0     1    (0x55)
// write byte 6      0     0     0     0     0     1     1     0    (0x06)
// read  byte 6      0     1     1     0     0     1     1     0    (0x66)

for (x = 0; x < 7; x++) // write data_out[7] byte by byte
{
data_out_single[0] = data_out[x];
ftStatus = FT_Write(ftHandle, data_out_single, 1, &data_written);
if ((ftStatus == FT_OK) && (1 == data_written))
printf("FT_Write successful;  data_written = %5i     data_out[%x] = 0x%02x (byte %i)\n", data_written, x, data_out_single[0], x);
else
printf("ftStatus FT_Write not ok %d\n", ftStatus);

while (RxBytes != 65536) // wait until the 64kB buffer is filled
{
FT_GetQueueStatus(ftHandle, &RxBytes);
Sleep(1);
}

ftStatus = FT_Read(ftHandle, RxBuffer, RxBytes, &BytesReceived); // read 64kB buffer
if (ftStatus == FT_OK && (BytesReceived == 65536)) // print any location between 0 and 65535 (here is 32768)
printf("FT_Read  successful; BytesReceived = %5i RxBuffer[32768] = 0x%02x (byte %i) UM232H in loopback\n\n", BytesReceived, RxBuffer[32768], x);
else
printf("ftStatus FT_Read not ok %d\n", ftStatus);

RxBytes = 0;
for (unsigned int j = 0; j < 65536; j++) RxBuffer[j] = 0x00;
do ftStatus = FT_StopInTask(ftHandle); while (ftStatus != FT_OK);
ftStatus = FT_Purge(ftHandle, FT_PURGE_RX | FT_PURGE_TX); // Purge both Rx and Tx buffers
do ftStatus = FT_RestartInTask(ftHandle); while (ftStatus != FT_OK);
}
printf("Press Return to reset bit mode & close device\n");
getchar();
Mode = 0x00; //reset bit mode - pins return to status pre bit-bang mode
ftStatus = FT_SetBitMode(ftHandle, Mask, Mode);
}
ftStatus = FT_Close(ftHandle); //close device
}

whose output is:

Code: [Select]
FT_Write successful;  data_written =     1     data_out[0] = 0x00 (byte 0)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x00 (byte 0) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[1] = 0x01 (byte 1)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x11 (byte 1) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[2] = 0x02 (byte 2)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x22 (byte 2) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[3] = 0x03 (byte 3)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x33 (byte 3) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[4] = 0x04 (byte 4)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x44 (byte 4) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[5] = 0x05 (byte 5)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 5) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[6] = 0x06 (byte 6)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x66 (byte 6) UM232H in loopback

Press Return to reset bit mode & close device


showing the correct (but very trivial) reading on the pin status (byte bt byte) in async bit-bang in loopback mode for um232H.

Thank you again

Guido Raffone
Logged

graff58

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: About "FT232H Asynchronous Bit-Bang. Read data." old topic.
« Reply #3 on: June 04, 2024, 03:59:22 pm »

Just for sake of completeness the use of the FT_GetBitMode is fundamental to avoid the reading of the full 64kB buffer as
the following further few lines added to the previous code show:

Code: [Select]
UCHAR data_current = 0x00;

for (x = 0; x < 7; x++) // write data_out[7] byte by byte
{
...

do ftStatus = FT_GetBitMode(ftHandle, &data_current); while (ftStatus != FT_OK);
if ((ftStatus == FT_OK))
printf("FT_GetBitMode successful;                     data_current = 0x%02x (byte %i)\n", data_current, x);
else
printf("ftStatus FT_GetBitMode not ok %d\n", ftStatus);
                        ...

        }

giving the following output:

Code: [Select]
FT_Write successful;  data_written =     1     data_out[0] = 0x00 (byte 0)
FT_GetBitMode successful;                          data_current = 0x00 (byte 0)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x00 (byte 0) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[1] = 0x01 (byte 1)
FT_GetBitMode successful;                          data_current = 0x11 (byte 1)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x11 (byte 1) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[2] = 0x02 (byte 2)
FT_GetBitMode successful;                          data_current = 0x22 (byte 2)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x22 (byte 2) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[3] = 0x03 (byte 3)
FT_GetBitMode successful;                          data_current = 0x33 (byte 3)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x33 (byte 3) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[4] = 0x04 (byte 4)
FT_GetBitMode successful;                          data_current = 0x44 (byte 4)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x44 (byte 4) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[5] = 0x05 (byte 5)
FT_GetBitMode successful;                          data_current = 0x55 (byte 5)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x55 (byte 5) UM232H in loopback

FT_Write successful;  data_written =     1     data_out[6] = 0x06 (byte 6)
FT_GetBitMode successful;                          data_current = 0x66 (byte 6)
FT_Read  successful; BytesReceived = 65536 RxBuffer[32768] = 0x66 (byte 6) UM232H in loopback

Press Return to reset bit mode & close device


Then my conclusion is that in async bit-bang (whatever i/o pin config) the write must be performed always byte by byte if the status of the pin has be read successively (for instance to check it only) because the full array is lost anyway.

Thank you

Guido Raffone
Logged