Wixel open collector question


I looked through the topics, and didn’t see anything like this, but I’m somewhat new to this, and may not know exactly how to ask this question.

Basically I’m trying to wire a switch matrix. I have a working solution, but it utilizes two diodes per switch, and I’d like to reduce that to one if it is possible.

For instance, I have two pins connected to the anode of two diodes. The cathodes connect to a switch which is then grounded. When I AND the isPinHigh output for those two pins I get the signal to send a specific key command to the receiver (a second Wixel). This is repeated for several pins, switches, and diodes.

The desired schematics I’ve looked at always seem to have a row and column of pins, but a single diode, and if I’m understanding correctly, the column pin is being routed to the row pin (or vice-versa) instead of to ground. Here’s one example I’ve been looking at: blog.komar.be/how-to-make-a-keyboard-the-matrix/

I’m not quite sure how to approach this, if it is possible, and if it can be done safely (without frying the Wixel), so I thought I’d ask here.

I’ve looked at the documentation, and was thinking the setDigitalInput/setDigitalOutput may be the right direction, but again, my concern is that I’ll send P0_0 to P1_2, and damage the Wixel internally.

If there are any example programs or general info that might help I’d greatly appreciate it. Sorry if this is an obvious or stupid question, it’s had me scratching my head for a while…



This seems like an interesting project. You should be able to configure one of the pins as an input and the other as an output on the Wixel without damaging the pins; however, as the guide mentions, the input must have a pull-up resistor. Each port on the Wixel can be configured to have either internal pull-up or pull-down resistors. You can set the internal pull-up resistor on the input by using the setPortxPullType() command. You can read more about this command in the gpio.h file reference in the Wixel SDK.

If you post a schematic of your proposed setup, I would be happy to take a look at it.

- Jeremy

Thank you! I think this is exactly what I needed to know. Not sure how I missed the port type function :confused: