0

I am experimenting with creating a replacement for the 8048-based keyboard for an old 8-bit Z80 computer over a parallel port, where the value is read when a strobe pin goes from high to low.

I have connected the appropriate pins to the GPIO ports on a Raspberry Pico and written a small MicroPython program that sets the 8 bit value pins and double-toggles the strobe to go high->low->high. This works very well.

My problem now, is that the raspberry powers up with the GPIO ports low, so the strobe is immediately considered to be fired and the computer is sent an ASCII zero character before my MicroPython code have a chance to initialize the pin to high.

I would like to change the powerup configuration of at least one GPIO port to be output and high so I can avoid this extra character. My initial investigations indicate this should go in the firmware as the Pico itself appears to have a fixed behavior, but I am unsure if I know the right search terms to use. I am experienced with software but inexperienced with electronics (but learning). It will just be me using this for now.

How should I approach this?

6
  • 1
    Wouldn't it be easier to fix the Pico's power-on behavior with hardware rather than re-program the firmware?
    – Seamus
    Commented Apr 1 at 8:39
  • @Seamus probably. Being a novice I do not know how. Commented Apr 1 at 9:33
  • Note to self: According to 5.5.2.2 of datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf none of the GPIO pins are Pull-High Commented Apr 1 at 10:55
  • It's rather difficult knowing how to help when all you have to say is, "I do not know how." Do you want help with this?
    – Seamus
    Commented Apr 1 at 19:34
  • @Seamus Yes, and you have. I have now understod that a normal Raspberry Pi has some pins that are high by default when reset, but not the Pico so an external resistor must be used. A good friend has explained why. I will continue to experiment in the weekend. Commented Apr 3 at 11:15

1 Answer 1

1

All pins on Pico (and practically everything) are initially configured as INPUTS.

Pins generally have default pull to ensure stability but this varies on pin.

If you want them to have a defined value use a resistor to set value.


If you want the pin to be high connect a resistor to 3.3V. It will still be an INPUT. I suggest 4.7k but this depends on what is connected.

2
  • Thank you. I am a novice at this. Can you point me to a beginners resource demonstrating how to do what you suggest using a resistor ? Commented Apr 1 at 9:35
  • @ThorbjørnRavnAndersen, look up the term "pull-up resistor". It's as simple as a resistor (with a value of generally from 4.7K to 20K, depending on the situation) going from the GPIO pin to 3.3 V to give it a defined (high) value on startup when it's still configured as an input. The pull-up will not prevent the GPIO going low during operation.
    – StarCat
    Commented Apr 1 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.