Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 05:05am 26 Jun 2016
Copy link to clipboard
Print this post
Hello all.
I've been trying for a few days now to get the MAX7219 chip to work with 4 7seg led's. I've tried the code on this forum and looked at the DATA sheet, also looked at youtube videos and Arduino examples but all I'm left with is no led's lit.
My test code looks like this -
Pin(15)=1 : SetPin 15,dout
SPI open 5000000,3,16
Pin(15)=0
aa=SPI(&h0f00) 'test mode off
aa=SPI(&h0c01) 'shutdown reg normal
aa=SPI(&h0b07) ' no. of digits to scan 0-7
aa=SPI(&h0a0d) 'intensity
aa=SPI(&h09ff) 'decode no. of digits
aa=SPI(&h0105) 'no to display
aa=SPI(&h0205)
aa=SPI(&h0305)
aa=SPI(&h0405)
aa=SPI(&h0805)
Pause 10
Pin(15)=1
Pause 10
Pin(15)=0
As you can see from the code I'm trying to display lots of "5"
I want this code as simple as possible so I can see what's going on.
Thanks for any help. Dave.
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 07:23am 26 Jun 2016
Copy link to clipboard
Print this post
Ok. I've just tried the max7219 on my Arduino and it's still not working, I'm starting to think I've got 2 fake chips.
DaveC166 Regular Member Joined: 13/09/2012 Location: New ZealandPosts: 44
Posted: 10:51am 27 Jun 2016
Copy link to clipboard
Print this post
Dave, about 14 months ago ,i got 10 max7219 chips for NZ$12:00 ,these turned out to be fakes. I couldnt get a MM MK2 to write to a 4dig 7seg display. 8 of the max7219's worked if i inserted an IN4001 diode in series with the max7219 +5V supply. The fake chips didnt like more than 4.6 volts supply. Could you try this as well
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 11:18am 27 Jun 2016
Copy link to clipboard
Print this post
Thanks for the info. I will give this a go.
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 11:40pm 04 Jul 2016
Copy link to clipboard
Print this post
Ok, so I got it to work erratically using the diode that DaveC166 suggested (thanks Dave) but the display would light up briefly and go off, sometime would stay on but go off if I touched or went near a wire. I did some more research into these chips and found that by keeping wires short and more importantly putting a 10k resistor fron pin 1(DATA IN) to GROUND/0v made it a lot more stable.
Not sure if these chips are more trouble than they're worth, but I've got a project in mind and like the look of the 7 segment display.
Thanks again for your help DaveC166, lets hope this may be of help to others using these fake chips.
Thanks. Dave.
skylight Newbie Joined: 10/01/2016 Location: United KingdomPosts: 23
Posted: 09:16am 07 Jul 2016
Copy link to clipboard
Print this post
The data sheet mentions that it goes into shutdown mode on power up blanking the display,could this be the case? you can override shutdown mode using display test by putting a high on D8 through D11.
Are unused inputs at cmos low?Edited by skylight 2016-07-08
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 11:31am 07 Jul 2016
Copy link to clipboard
Print this post
Hi,Skylight. I finished up using some simple code for the Arduino which gave the same results as the 28pin Micromite, flashing the number briefly to the display and then going off.
Putting a 10k resistor from ground to the Data pin AND lowering the voltage using a Diode fixed the problem.
I don't think I'll be using these chips again as they seem 'fussy' and wouldn't want to pay full price (around £10) for a genuine one.
All in all it was a learning experience.
Dave.
skylight Newbie Joined: 10/01/2016 Location: United KingdomPosts: 23
Posted: 11:44am 07 Jul 2016
Copy link to clipboard
Print this post
Fair enough, I was just wondering if you had tested the chip by hardwiring as it would eliminate any software errors? Especially as you had tested with different processors-software already.
Justplayin Guru Joined: 31/01/2014 Location: United StatesPosts: 327
Posted: 01:54pm 07 Jul 2016
Copy link to clipboard
Print this post
Hi Dave,
I have had great luck with the 7219 chips ordered from China. Since I only paid 40 cents each for them, I have serious doubts about their pedigree. But, they work. I have operated them from 3.3 to 5 volts with the only problem occurring when using 3.3v and having 24 7219s strung together (12 Mik-Matrix modules). Switching the supply to 5v fixed the issue.
After doing a little research and playing around a bit, I did find using a 10K resister to ground on the LOAD line is all that is needed to stabilize to 7219. With LOAD held low random data can not be transferred into the 7219 during power up which can cause the 7219 to completely lockup.
--Curtis I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!!
cosmic frog Guru Joined: 09/02/2012 Location: United KingdomPosts: 302
Posted: 09:03am 08 Jul 2016
Copy link to clipboard
Print this post
Hi Justplayin, I've just tried your suggestion of connecting the 10k resistor to ground and the LOAD pin and it seems to work very well, in fact it still works when I remove the voltage dropper diode so I think this may be the way forward for these chips.
Thanks for everyone's help with this.