5 ms·
Raspberry Pi Pico Hack Unlocks Two Extra “Hidden” GPIO Pins
- skybrian 4y agoI guess if you only need two more pins this would be okay, but in general, this sounds like a job for an I/O expander chip?
- kumarvvr 4y agoYup. IO expander chips are the real deal. Having good knowledge on them would enable you to extract a lot of value from even the tiniest of micro controllers. Especially ones tht have an SPI or an I2C interface.
- sebcat 4y agoFrom the Reddit thread the article is based on, OP says: > I want to run an unmodified QMK firmware so I can keep up with updates without having to continually merge my changes into HEAD, and in my research with IO expanders I would have to rewrite the matrix scanning code.
- jaygreco 4y agoQMK supports a “custom matrix” option which makes using an IO expander or demux extremely easy. We use them for the NIBBLE keyboard. The API is stable and keeping changes in the working tree would be fine. It’s more likely the keymap would break at some point for some reason other than the matrix driver.
- jandeboevrie 4y agoBetter go to the source : https://www.reddit.com/r/raspberry_pi/comments/w37gx2/i_freed_up_two_gpios_on_the_raspberry_pi_pico/ https://www.reddit.com/r/raspberry_pi/comments/w37gx2/i_free... instead of this add-filled page. Scrolled a millimetre down and the "subscribe to our newsletter" popup came. That page adds nothing.
- ThePowerOfFuet 4y agoAn even better link: https://old.reddit.com/r/raspberry_pi/comments/w37gx2/i_freed_up_two_gpios_on_the_raspberry_pi_pico/ https://old.reddit.com/r/raspberry_pi/comments/w37gx2/i_free...
- lapser 4y agoYou can disable the new layout in your user preferences[0]. If you scroll down to "Beta options", you can untick "Use new Reddit as my default experience". [0] https://www.reddit.com/prefs/ https://www.reddit.com/prefs/
- npongratz 4y agoold.reddit.com links help immensely for anyone who isn't logged in, and/or doesn't have an account.
- reaperducer 4y agoAn even better better link: gopher://forthworks.com:7004/0/%7eraspberry_pi/%3aw37gx2 It's pretty much the only way I can tolerate Reddit.
- ThePowerOfFuet 4y agoIt's not my cup of tea, but I don't kinkshame.
- benj111 4y agoWouldn't 'the source' be the rp2040 documentation that says that there are 30gpio pins and the pi pico docs that say what they're hooked up to?
- HeyLaughingBoy 4y agoThis reminds me of the comment I made yesterday that people will pay money to not have to read documentation :-)
- anthropodie 4y agoI recently found out that there exist a Pico W although it is always out of stock at all vendors in my country. This could give some serious competition to ESP. Any idea when these supply chain issues will get resolved?
- regularfry 4y agoIt's only just been released. Pico's generally have pretty good stock levels so I suspect what you're seeing is just launch demand.
- GravitasFailure 4y agoThe Pico W may not have been in stock for you yet. I believe the earliest it shipped from vendors was July 5th, so it's probably worth your while to keep checking back.
- IshKebab 4y agoA significant flaw of the Pico W is that its idle power draw is too high for battery operation. Rules out a ton of applications that you typically would use a wireless microcontroller like the ESP32 or nRF5x for.
- kkielhofner 4y agoThe Pico W is quite a bit behind the ESP32 family (for example): https://www.espressif.com/en/news/ESP32-C5 https://www.espressif.com/en/news/ESP32-C5 As far as I can tell the Pico W is worse than the ESP32 in most ways. The ESP32 was released in 2016! The Pico and Pico W are strange… I suspect the audience (much like the Raspberry Pi) is a “my first microcontroller” crowd. Just like the Raspberry Pi was “my first Linux embedded anything” crowd. These are both great and I fully support it! However, Raspberry Pi remains the champion even when faced with vastly superior hardware because of the documentation, community, ecosystem, and first mover advantage. Here not only is Espressif offering superior hardware they’re doing so with an ecosystem that’s been in the making for almost a decade going back to the ESP8266. It runs MicroPython, anything in the Arduino ecosystem, Platform IO support, the Espressif low level IDF, AND you can Google just about “esp32 + anything” and find almost endless libraries, examples, etc. This SDK doesn’t have Bluetooth working while the ESP32 ecosystem is in such a mature state there are projects dedicated to cameras, audio projects, a million other peripherals, and even on board inference with TensorFlow Lite (which has been around for two years). The Pico and Pico W will be very successful because they have the Raspberry Pi name but it’s strange to me they’re introducing a solution that gets pretty handily beat in all aspects by hardware that’s been readily available for half a decade. I’m sure users and customers have been asking for it and there are other factors at play (contracting, supply chain, who knows) but I don’t quite understand (especially for the tinkerer) what advantage(s) this really provides over the ESP32 (as one example). Oh, and it’s cheaper and VERY readily available.
- AeiumNE 4y ago20 wires for 112 options seems like a lot. Shouldn't there be some way to just logic it down to something like 7? Need to break out the karnaugh map.
- linkdink 4y agoThere is a way, but it requires 7+16=23 sense wires on the input side. The MCU is acting as the multiplexer. Representing the information about the pressed key is more compact than physically sensing and discriminating which key was pressed.
- explodingwaffle 4y agoThe standard way to do it is just a square matrix, so yeah a lot of pins are required. There are cleverer ways though- I like this writeup https://kbd.news/Improved-square-matrix-1415.html https://kbd.news/Improved-square-matrix-1415.html
- ralferoo 4y agoThe obvious way to use fewer pins is to have a decode IC, e.g. 74238 which would take 3-bit input and pull one of 8 outputs high or 74138 which does the same with active low. With your 112 key matrix, you can then use 14 input lines to make an 8x14 matrix, so you'd need a total of 17 GPIO pins.
- ralferoo 4y agoForgot to note, if you're really short of GPIO, you could also use two 8-line to 1-line data selector chip, e.g. 74151, so you'd have a 74138 to select one of 8 rows, and two 74138 which select a column each, and two further input pins to read from the result. That would reduce GPIO down to 8 (6 out, 2 in).
- ralferoo 4y agoAnd just in case you're really really short of GPIO, you can use a 74595 shift register to feed the column and row selection, so you'd just need clock and data outputs. You could also use 74251 8-to-1 multiplexer as that has an output enable, so you could use your remaining 2 outputs from the shift register to enable one of the two multiplexer chips. If you're not latching the outputs on the shift register, then you'd want a resistor between the two outputs so they don't fight. So then, the ultimate reduction in GPIO would be to 3 lines - clock, data, in. Obviously, for each of these, as you reduce the number of IO pins, you increase the time required to scan the matrix.
- djmips 4y agoThis is very standard thing with any pre-made embedded microcontroller to hijack pins where you can. Sometimes it comes at the expense of being able to program the board in a standard way. :)