General Category > Discussion - Software

initial value is wrong by using Read GPIO within LibMPSSE

(1/1)

TonySH:
Hi,
  I got the issue that the FT_ReadGPIO read all bit values as high(255) after setting up the initial value as low(0) for all bits.
 
  first, I set up the GPIO initial value as low and direction as input by FT_WriteGPIO(handle, 0, 0);
  then, I use the FT_ReadGPIO(&read_value), I always get 255 when the GPIOH has no connection.
  If I connect one of the GPIOH to the GND pin, the reading will change to low, it comes back high when removing the connection.

  Is it the expected behavior of the GPIO within LibMPSSE?

  My environment:
  LibMPSSE version: 1.0.5
  Device:232H
  OS: Windows
  Pin usage: SPI for GPIOL[0:3], GPIO for GPIOH[4]

Best Regards,
Tony

FTDI Community:
Hi Tony,

The default for these GPIO pins is TriSt-PU. See table 5.1 in FTDI Device Input Output pin States.

what are you planning on connecting the GPIOH pins to? have you tried connecting the pins to a slave device and performing a GPIO read?

Best Regards
FTDI Community

TonySH:
Hi,
  I do connect the GPIOH with the slave device, I use GPIO to listen pull-high signal from the slave when the slave have data to send to the master via SPI.
 
  It works on our windows application used 232H and slave device when they are both power on. but it is a little bit bothered that I need to add time stamp in the test log and find out the first successful transfered message.
 
  I expect that I run my windows application first, and power on the slave device in second action, then the first log message on the application is what I need. so far, I will get the redundant message because of the default state "TriSt-PU" when starting to run the application. On my current test SOP, the default state is the fake signal for my application. How do I bypass this default state?


--- Quote ---8. TriSt-PU – Input pulled up, not used
--- End quote ---
  Is the definition of TriSt-PU as defined above? What is the definition of "used"? I use FT_writeGPIO() to initialize to zero, is it not defined as "used"?

Best Regards
Tony

FTDI Community:
Hi Tony,

Your only option would be to add some external pulldown on the GPIOH pins. Even if they have been set as low and input, if there is no connection they will be pulled high by the internal pullups.

Best Regards
FTDI Community

TonySH:
Hi,
  I got it, thank you.

Best Regards
Tony

Navigation

[0] Message Index

Go to full version