PDA

View Full Version : Re-using pins while still connected to MAX7219 ?



CuriousOne
- 18th August 2018, 06:21
Hello.

I have 12F1840 which is connected to MAX7219. As amount of ports is quite low, 3 ports are wasted on driving that IC. I would like to be able to use any of these pins for reading a button or driving a buzzer. If I understand properly, if I drive MAX7219 CLK pin low, IC will be locked, no matter what happens on other pins, right?

l_gaminde
- 21st August 2018, 05:48
It has been a long time since I’ve used that chip But I’m pretty sure you only need 3 pins It is a serial chip. And you may get by with using two of those pins But there will be no updating of the display

Dave
- 21st August 2018, 12:00
It's in the data sheet.

Load-Data Input. The last 16 bits of serial data are latched on LOAD’s rising edge.

So, Just hold the LOAD pin low until you have the new data shifted into the MAX7219. You can use the clock and data pins as you wish as long as the LOAD pin is low.

CuriousOne
- 22nd August 2018, 09:15
Thanks, that's excellent idea.
I want to attach button which will pull that pin low, when pressed. Since pin is already connected to IC, do I still need pull up resistor?

Dave
- 22nd August 2018, 11:36
Why yes you do and don't forget to set the pin as an INPUT.

CuriousOne
- 24th August 2018, 08:18
Thanks, I have another idea.

What I use data pin for beeper? I think I can connect emitter follower thru capacitor to that pin, and buzzer to emitter follower? MAX7219 data speed should be high enough, so buzzer won't play anything while transferring the data? :)

pedja089
- 24th August 2018, 11:54
Probably you will get audible click on start and stop of data transition, and probably some noise during.
You may implement this
https://www.romanblack.com/shift1.htm

Also you could use SPI port expander, and and use inverted CS signal to drive it. Or some additional transistor circuit to activate buzzer only when LOAD is low.