Connecting Inputs to Outputs

Post here first, or if you can't find a relevant section!
Post Reply
rudizoon
Posts: 1
Joined: Tue Aug 16, 2022 11:34 pm

Connecting Inputs to Outputs

Post by rudizoon »

I'm trying to setup a matrix keyboard sensor, where 12 keys are setup in a 3x4 matrix. This means that when I send a HIGH to one of the rows, and a button is pressed in that row, the column of that button goes HIGH.

So I setup the rows as outputs and the columns as inputs. The inputs are PULL_DOWN, so that when a HIGH signal is detected, it will activate the routine associated with that button.

I first tested this with PB12 and PB13 - one as input and one as output, and that worked fine. I was able to turn the on-board LED on and off by shorting these two pins.

So I developed this for 7 pins: Rows PB14, PB15, PA11, PA12 and Columns PA15, PB3 and PB4.

The problem is that now both pins PA15 and PB4 are permanently HIGH! Despite being setup as PULLDOWN, and physically connecting either one to GND.

Should I instead of shorting outputs to inputs insert resistors? Since the internal PULLDOWN is 20k, perhaps, say a 1k resistor for each of the Columns?

Or do I have a dud?
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Connecting Inputs to Outputs

Post by GonzoG »

I suspect you're using blue pill and Roger's core as I had some issues with those ports with this core.
They are used by Jtag and it needed to be disabled.
Post Reply

Return to “General discussion”