Max7219 with Picaxe20X2 driving 4 digits seven seg. display

Hardware and software work as expected for about 10 to 30 minutes then the segments start turning on and off in a random fashion and eventually they turn off. Removing the power and reconnecting immediately does not work. But after waiting for about 30 minutes, if I reconnect, it works again. I cannot detect overheating (touching the ICs).
Code:
  ' DIRECTIVES

#picaxe 20X2 ' specify the PICAXE processor
#no_data ' speed up the download
#no_table ' speed up the download
#terminal off ' disable terminal window

'   PIN ASSIGNEMENTS

Symbol load = C.2 ' briefly pulse C.2 to transfer data to LEDs
Symbol But = B.0
Symbol SW = B.2
Symbol LED = B.6
Symbol Counter = W0
Symbol Valones = b2
Symbol Valtens = b3
Symbol Valhund = b4
b5=0
Counter=1

' Register addresses for the MAX7219
symbol decode = 9 ' decode register; specify digits to decode
symbol brite = 10 ' intensity (brightness) register; 15 = 100%
symbol scan = 11 ' scan-limit register; specify how many digits
symbol on_off = 12 ' 1 = display on; 0 = display off

' ============================= Begin Main Program =============================
setfreq m64
dirsb = %11111010 ' set portB as all outputs (except B.0 and B.2)
dirsc = %10111111 ' set portC as outputs (except C.6)
hspisetup spimode00,spifast ' set up hspi
' Initialize MAX7219
hspiout (scan,3) ' set scan limit for digits 0-3
pulsout load,1
hspiout (brite,5) ' set brightness to 5 (15 = 100%)
pulsout load,1
hspiout (decode,15) ' set BCD decoding for digits 0-3
pulsout load,1
hspiout (on_off,1) ' turn display on
pulsout load,1
		Calc:
Valhund=counter/100
If Valhund=0 then Let Valhund=15
endif
Valtens=counter//100
Valtens=Valtens/10
If Valtens=0 then let Valtens=15
endif
Valones=Counter//100
Valones=Valones//10

' Send data to the four digits
		Display:
hspiout (1,15)	  ' 1st LED from left 
pulsout load,1
hspiout (2,Valhund) ' 2nd LED from left 
pulsout load,1
hspiout (3,Valtens) ' 3rd LED from left 
pulsout load,1
hspiout (4,Valones) ' 4th LED from left 
pulsout load,1
Pause 500

		Sig:
		
button B.0,1,254,254,b5,1,pushed
If PinB.2=0 then High B.6 else Low B.6
endif
Pause 5000
Goto Sig
		Pushed:
If PinB.2=0 then Decr
Counter=Counter+1
Goto Calc
		Decr:
Counter=Counter-1
Goto Calc
 

Attachments

PaulRB

Senior Member
Marmitas, what is the power supply? Have you tried replacing any components, eg. Caps?

Have you tried using sertxd to see the value of counter and other variables? I'm not sure what would happen if you sent a value other than 0 to 9 to a register of the 7219 in bcd decode mode. Maybe random segments!

Paul
 
Paul, Thank you for helping.
I will try using SERTXD to be sure.
Marmitas, what is the power supply? Have you tried replacing any components, eg. Caps?

Have you tried using sertxd to see the value of counter and other variables? I'm not sure what would happen if you sent a value other than 0 to 9 to a register of the 7219 in bcd decode mode. Maybe random segments!

Paul
The power supply is a 3Cell LiPo fully charged.
I did not try to replace any component so far. I would not know what to replace.
There is no problem with the decoding. I have been able to display 3 digits correctly by setting the initial value of counter to 100 and advancing the value using the button command (see code)
 

nick12ab

Senior Member
Have you checked to see if the linear regulator is getting too hot and limiting the output current due to its heat? A heat issue sounds likely based on the description of your symptoms.
 

inglewoodpete

Senior Member
Check the battery voltage and the 5v rail after 20 minutes to see what is happening. Try using a low-dropout regulator like the LM2940-5.
 

PaulRB

Senior Member
Replace every component you have a spare for, but one at a time, so if there's an improvement, you immediately know what was at fault. Elecrolytic caps can show faults when they warm up a little, I've heard. Power supply does seem most likely source of your troubles.
 
I found the problem.
Resistor R3 is a 1206 Surface mounted unit and has the numbers 123 which indicates 12K Ohms. However, when I measured it, it was only 5.2K. I replaced it with a new 12K resistor and the problem went away.
Thank you every one
 
Proper reputable MAX7219, or cheap chinese fakes (they exist, I have some, they don't work very well)?
I bought it in Ebay, I don't know if it is a fake. It has the Maxim logo on the chip but beyond that I don't know.
Is there a way to determine visually if they are fakes?
 

MartinM57

Moderator
Mine have the Maxim logo as well.

The biggest giveaway (apart from them not working properly) is the DIP package itself - on the Maxim data sheet the end pins are wholly inboard of the package, on the fakes, the end pins (maybe just one end, can't remember) are right on the end of the package and in fact are only "half-pins" - they are vertically cut through
 

RexLan

Senior Member
I'm sure I am missing something but I have always driven the seven segment displays directly from the MAX7219 and have never had an issue. One I have running 8 digits and the decimal using a Picaxe 28x

For R3 I use a 10K and for C5 I use a 33uF

Maxim is real good about free samples on that part as well.
 

MartinM57

Moderator
RexLan said:
I'm sure I am missing something but I have always driven the seven segment displays directly from the MAX7219
I think that's what we're all doing..

Marmitas said:
Resistor R3 is a 1206 Surface mounted unit and has the numbers 123 which indicates 12K Ohms. However, when I measured it, it was only 5.2K.
Don't tell me - eBay resistors as well :D
 
I think that's what we're all doing..

Don't tell me - eBay resistors as well :D
No, the resistor was not from Ebay, I purchased from DigiKey
I also used the MAX7219 in previous projects and had no problems. This time I made the mistake of buying in Ebay and got a fake chip.
By the way Maxim gives samples to corporations and students. I am retired, no samples for old men.
 
Top