Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

FT232H with Circuit Python does not work nicely
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

FT232H with Circuit Python does not work nicely

by kotai2003 on Mon Jul 20, 2020 12:03 am

Hello.

I am using Adafruit FT232H breakout board as a GPIO Board.
That will be connected with my PLC and controlled with Python 3.7 code.
I have a serious problems with GPIO pins functions.

There are several pins for GPIO and Here is my assignment of the IO pin.
First, output pins works fine. They have no problem.

1. Output pin (7 pins)
pin_D4, pin_D5, pin_D6,pin_D7,
pin_C0, pin_C1, pin_C2

2. Input pin (5 pins)
pin_C3, pin_C4,pin_C5, pin_C6, pin_C7

The real problem occurs at Input pins.

When power is supplied to the FT232H board via usb connector, The Input pin values from C3 to C7 is not stable.
I expected that the input pin values should be LOW (Hign/Low Logic) without any input signals.
However, All Input pins shows shows 40 mV ~ 0.8 V without any wiring. and the value changes with time.
Somepins shows HIGH logic value without any wiring.
I Checked with different three FT232H Breakout boards, but they all showed the same problem.


What I want to know is,

1. How to make the input pins value stable.

2. Do I need to put the pull down resistance on input pins?

3. Is there any mistake when I assign the GPIO port with my FT232H board?

Code: Select all | TOGGLE FULL SIZE

import os
os.environ['BLINKA_FT232H'] = '1' #Setting Environmental Variable
import board
import digitalio

# ---------------------------------------
# Pin Setup I/O
# ---------------------------------------
#setup

#D4~D7
pin_D4 = digitalio.DigitalInOut(board.D4)
pin_D5 = digitalio.DigitalInOut(board.D5)
pin_D6 = digitalio.DigitalInOut(board.D6)
pin_D7 = digitalio.DigitalInOut(board.D7)
#C0~C3
pin_C0 = digitalio.DigitalInOut(board.C0)
pin_C1 = digitalio.DigitalInOut(board.C1)
pin_C2 = digitalio.DigitalInOut(board.C2)
pin_C3 = digitalio.DigitalInOut(board.C3)
#C4~C7
pin_C4 = digitalio.DigitalInOut(board.C4)
pin_C5 = digitalio.DigitalInOut(board.C5)
pin_C6 = digitalio.DigitalInOut(board.C6)
pin_C7 = digitalio.DigitalInOut(board.C7)

#Direction all output


pin_D4.direction = digitalio.Direction.OUTPUT
pin_D5.direction = digitalio.Direction.OUTPUT
pin_D6.direction = digitalio.Direction.OUTPUT
pin_D7.direction = digitalio.Direction.OUTPUT

pin_C0.direction = digitalio.Direction.OUTPUT
pin_C1.direction = digitalio.Direction.OUTPUT
pin_C2.direction = digitalio.Direction.OUTPUT


#Output -> Input

pin_C3.direction = digitalio.Direction.INPUT

pin_C4.direction = digitalio.Direction.INPUT
pin_C5.direction = digitalio.Direction.INPUT
pin_C6.direction = digitalio.Direction.INPUT
pin_C7.direction = digitalio.Direction.INPUT



kotai2003
 
Posts: 16
Joined: Thu Sep 17, 2015 11:21 pm

Re: FT232H with Circuit Python does not work nicely

by adafruit_support_carter on Mon Jul 20, 2020 2:11 pm

1. How to make the input pins value stable.

see 2.
2. Do I need to put the pull down resistance on input pins?

Yes. It's not clear if the FT232H has these internally, so it is not currently supported. You will need to add external pull up/down resistors.
https://learn.adafruit.com/circuitpytho ... 3041149-18

adafruit_support_carter
 
Posts: 16268
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.