Going to use gpio for the first time

Apr 21, 2026 Last reply: 2 months ago 12 Replies

I've been working on a project designing my very first keyboard matrix. It's not a normal setup, it'll serve as external input for my tandy pocket computer. Well, V1 will be at least.



I chose an atmega MCU as suggested by an online buddy and was delighted to learn that I can program it with my rpi's gpio.



So I ordered a header adapter/expander from pishop. This gave me a chance to order a few other things I've been putting off, like getting an inexpensive case for my workhorse 3b+. Also got the inexpensive (almost cute) gpio reference board for the hell of it.



Are there any newbie things I should look out for while I dive in? I'll be doing all the work on my trusty stock pi500.


Which approach are you using, libgpiod, Wiring, or Python?

I don't know yet, this is all new to me. Until recently I figured I would be doing eeprom work with a rom chip but things took a different turn and, also, my brother has my eeprom writer.

Only now have I cracked open the rpi pdf guide. I'm hoping this grows into something much more.

Be careful about different voltage levels. The atmega *can* run on 5V, while the raspberry's GPIO pins only tolerate 3.3V.

If you run the atmega from 3.3V too (ideally sourced from the pi, so they come up at the same time), you have fewer problems.

cu Michael

In theory., In practice they can tolerate 5V if not from an uber low impedance source

To avoid tears before bedtime, it is best to disregarded that.

---druck

*shrug.* been running that way for some time

Be aware that different Pi SoCs are built on different process nodes, which may have different high voltage tolerance. A Pi 4 may be more sensitive than a Pi 1, and on the Pi 5/500 the GPIO is on a separate I/O chip which may be different again.

The Pi 500 is now $180 - I wouldn't risk it.

Theo

Still haven't initiated planning or coding yet. It's a crazy sports time for me with basketball playoffs and regular season baseball in full swing.

Off the top of my head I don't intend on using gpio power. I figure the atmega could be powered by the bench power supply. The data line could get a diode, now that you mention the risk of voltage backfeed to gpio. That, or disconnect the wire between programming steps. And connect atmega and breadboard ground to gpio ground.

Lacking an EE degree, learning all this magic has been a blast.

Of course, that's just off the top of my head. The pi500 has a different pinout from other rpi models based on the few bits I've seen in the pdf guide. I have the gpio extender being shipped and the pinout guide thingamabob for reference.

I simply wouldn't buy it at all.

I've been there and done that in the dim and distant past. (Getboard, Gertduino, Other *duino boards, my own systems, etc.)

Based on that; I'd strongly suggest you make life easy for yourself:

Get an Arduino UNO and plug it into one of the the Pi's USB ports. Use that as your ptototyping/development platform.

Forget using the GPIO for SPI/parallel programming - it's just too much hassle. Too much to go wrong, too many wires. One USB cable and the job's done and you have an immediate serial console to the AVR too.

Then, once you build your own PCB, if that's the aim, you can put the AVR into the Arduino board to program it, then move it to your own board. You can get some nice 28-pin ZIF sockets too.

Alternatively, get a USB ICSP programmer and put an 8-pin header on your own board and program it that way.

There are many AVR Adruino boards - don't get one with a USB AVR (e.g. 32u4) and make sure it's a 28-pin DIL version for easy swapping into your production board. (For rev 1, at least)

This the PC1211/PC1212? (TRS80 Pocket computer?) I have a few - never thought to hook up an external keyboard though...

Gordon

formatting link
I have the breakout board for the Pi 5 and the only difference I see is the specialized pins are labeled like SDA1, SCL1 rather than 2 and 3.

https://pinout.xyz/pinout/pin29_gpio5/

It'll have protection diodes that limit the voltage at the inputs to less than the 3.3V supply. However they're not designed to be used in normal operation so the extra current carried from them on the power connections inside the chip might upset the voltage to other parts and cause weird problems, eg. when lots of inputs go to 5v. So it could be a source of very confusing behaviour and possible damage, though it's probably a small risk if there are just a few high-impedance 5V signals connected.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required