Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bus C and D are used as serial ports and A and B are used as gpio, Will there be any conflict when the four are used together #381

Open
zhimayun opened this issue Jun 27, 2024 · 0 comments

Comments

@zhimayun
Copy link

zhimayun commented Jun 27, 2024

chip is FT4232H,

A and B are used as gpio
C and D are used as serial ports

When calling the following code:

def power_down():
     print("power_down")
     print("self.power_gpio.is_connected {}".format(power_gpio.is_connected))
     pins = power_gpio.read()
     pins |= 1 << 6
     power_gpio.write(pins)
      print(hex(power_gpio.read()))

def power_on():
     print("power_on")
     print("self.power_gpio.is_connected {}".format(power_gpio.is_connected))
     pins = power_gpio.read()
     pins &= ~(1 << 6)
     power_gpio.write(pins)
     print(hex(power_gpio.read()))

if __name__ == "__main__":
     power_gpio = GpioAsyncController()
     pwr_url = " ftdi://ftdi:4232:0:1/1 "
     power_gpio.configure(pwr_url, direction=0xC0)
     power_on()
     time.sleep(1)
     power_down()
     print('sleep...')
     time.sleep(5)
     power_gpio.close()

Set the 6th and 7th pins as outputs, and then call

pins &= ~(1 << 6)
power_gpio.write(pins)

Changing the level of gpio will result the serial ports of C and D not being able to read data. Only when I call gpio. close() can I read data.
if the serial port and gpio cannot be used simultaneously?
thank you very much

@zhimayun zhimayun changed the title Will there be any conflict when C and D are used as serial ports and A and B are used as gpio when the four are used together Bus C and D are used as serial ports and A and B are used as gpio, Will there be any conflict when the four are used together Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant