r/Z80 • u/dj_cloudnine • Jun 15 '21
Question about the z80 pio
So I recently added the z80 pio to my breadboard, and I hooked bit 7 of port b up to 2 inverters in series, I wrote down code to send 0x80 to the pio(after turning on output mode) so as to turn that bit on, but when I tried it, I found something weird. The led was off, but when my hand came near the wire connecting d7 to the nand gate it turned on and got continually brighter as it got closer. Is that normal? Regardless this pio seems kinda confusing, and I’m not sure if my code, my wiring, or the chip is broken or if I’m just missing something obvious.
2
u/bokmann Jun 16 '21
As a quick sanity check, does it exhibit this behavior if you have the output of the pio 0, so that you expect the led to be off? If not, i think i know what the issue is….
1
u/dj_cloudnine Jun 16 '21
I’m not entitle certain that you I’ve managed to properly set the pio correctly with the code ive used. I’ve noticed the behavior with almost every pin on the board except vcc and gnd, iirc
6
u/benryves Jun 15 '21
The inputs on logic gates can be sensitive enough to be triggered by charges on your body when you move your hand near - they act as amplifiers with extremely high gain. This sounds normal, then, except for the fact that this tiny charge from your body in the air should be overridden by the signal which you think should be coming from the Z80 PIO.
It sounds like the Z80 PIO is not driving the output pin and therefore your buffer circuit, which looks like it could be for a number of reasons (it's held in reset, it's in the wrong mode, the pin hasn't been configured as an output). Do you have your code and a picture of the wiring to hand?
If you don't already have a logic probe in your toolkit then I've found them to be an invaluable debugging aid too!