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

Broadcom port on Zero W: unable to Pull.UP inputs #6009

Open
wmlele opened this issue Feb 10, 2022 · 3 comments
Open

Broadcom port on Zero W: unable to Pull.UP inputs #6009

wmlele opened this issue Feb 10, 2022 · 3 comments
Labels
broadcom Raspberry Pis with Broadcom chips bug
Milestone

Comments

@wmlele
Copy link

wmlele commented Feb 10, 2022

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-364-g2bf5a1ee4 on 2022-02-09; Raspberry Pi Zero W with bcm2835

Code/REPL

import board
from digitalio import DigitalInOut, Direction, Pull
import time

# switch
switch = DigitalInOut(board.D19)

# if I don't do this, it won't pull the input up 
#switch.direction = Direction.OUTPUT
#switch.value = True

switch.direction = Direction.INPUT
switch.pull = Pull.UP

while True:
    print(switch.value)
    time.sleep(0.5)

Behavior

Level on D19 stays at 0V when open regardless of Pull.UP. switch.value stays False regardless of the state of the input.

If the level is first set as output, and manually set to a true value, then it stays up after reverting to input, and I can read the state.

Description

No response

Additional information

No response

@wmlele wmlele added the bug label Feb 10, 2022
@tannewt tannewt added the broadcom Raspberry Pis with Broadcom chips label Feb 10, 2022
@tannewt tannewt added this to the Long term milestone Feb 10, 2022
@tannewt
Copy link
Member

tannewt commented Feb 10, 2022

Do you have any experience with C on the Pi? The code for setting pulls is here: https://github.com/adafruit/broadcom-peripherals/blob/08370086080759ed54ac1136d62d2ad24c6fa267/broadcom/gpio.c#L24

Called from https://github.com/adafruit/circuitpython/blob/main/ports/broadcom/common-hal/digitalio/DigitalInOut.c#L137

I'd love help polishing up this port.

@Florin9doi
Copy link

Possible fix: Florin9doi/broadcom-peripherals@44f5392

@cleverca22
Copy link

i think that commit is about bcm2711 pulls, which differ
but the zero-w, is using the vc4 pull style, which is write-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broadcom Raspberry Pis with Broadcom chips bug
Projects
None yet
Development

No branches or pull requests

4 participants