Go Down

Topic: MAX7219 toasted ? how to test ? (Read 1 time) previous topic - next topic

tomswell

May 17, 2011, 06:07 pm Last Edit: May 17, 2011, 07:40 pm by tomswell Reason: 1
How to test MAX7219 ?
I'm failing to drive a dual common collector 7 segment display [ Lite-ON LTD-5623BG]  with a MAX7219 running example

LedControl.h  / LCDemo7Segment   .... example without success.

I've verified ;
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD          
9 & 4  grounded
19 + 5V
10K between 18 & 19
paralleled segments A thru G [display(verified with +5V)] and tied to 7219 SEG(A>G) pins
cathodes to DIG0 and DIG1

I mixed up connections at first try and 7219 may be toast?
How easy is it to toast  7219?

how to send hex code  OxXF for
built in display test ?
where's best resource for learning lc.set ... tutorial ... documentation ?

SERIAL DATA                       how does DATA overlay with params
D15  D14  D13  D12 -|- D11  D1  D9  D8 -|- D7  D6  D5  D4  D3  D2 D1 D0

lc.setChar (addr,digit,value,dp); // don't quite get difference between setRow & setChar ?
lc.setRow (addr,digit,value,dp); // what is meant by digit position

//   LedControl.h code follows
 /*
    * Display a hexadecimal digit on a 7-Segment Display
    * Params:
    * addr   address of the display
    * digit   the position of the digit on the display (0..7)
    * value   the value to be displayed. (0x00..0x0F)
    * dp   sets the decimal point.
    */
   void setDigit(int addr, int digit, byte value, boolean dp);

   /*
    * Display a character on a 7-Segment display.
    * There are only a few characters that make sense here :
    *   '0','1','2','3','4','5','6','7','8','9','0',
    *  'A','b','c','d','E','F','H','L','P',
    *  '.','-','_',' '
    * Params:
    * addr   address of the display
    * digit   the position of the character on the display (0..7)
    * value   the character to be displayed.
    * dp   sets the decimal point.
    */
   void setChar(int addr, int digit, char value, boolean dp);

// end  chunk of LedControl.h

Code: [Select]
//most simple test sketch
#include "LedControl.h"

directives will be most appreciated ... don't have oscilloscope


/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD            
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);
unsigned long delaytime=250;

void setup() {
 /*
  The MAX72XX is in power-saving mode on startup,
  we have to do a wakeup call
  */
 lc.shutdown(0,false);
 /* Set the brightness to a medium values */
 lc.setIntensity(0,8);
 /* and clear the display */
 lc.clearDisplay(0);
}
void loop() {
// lc.setChar(0,0,0xXF);
// delay(delaytime);
 lc.setChar(0,0,'d',false);
 delay(delaytime);
}

Grumpy_Mike

Quote
I mixed up connections at first try and 7219 may be toast?
How easy is it to toast  7219?

It depends on what you mixed up. Signals are no problem, mixing up inputs and outputs could cause things to blow and mixing up power rails are potentially the most dangerous. But it is like saying what injuries will I get in a car crash. A lot depends.

If you haven't got an oscilloscope you will struggle to do much. However an LED with a 1K resistor can be used as a simple logic probe to check logic levels and if there is a signal on a line. It looks dimmer when being turned on and off rapidly.

tomswell

#2
May 20, 2011, 06:09 am Last Edit: May 20, 2011, 06:11 am by tomswell Reason: 1
Dufus survives wiring bloopers:
After abandoning messy flexible jumpers for hard wired paralleled seg(x) pins all is well display wise.
one wire in wrong place can create odd results ... MAX7219 is not too easily "toasted"
now how to efficiently... display  value = int count(xx)
count  ?0   count ?99
two digits
    lc.setChar(0,0,'x',false);  // x=  1st digit
    lc.setChar(0,1,'x',false);  // x= 2nd digit

CrossRoads

#3
May 20, 2011, 07:02 pm Last Edit: May 20, 2011, 07:06 pm by CrossRoads Reason: 1
Too much reliance on libraries.

http://www.arduino.cc/playground/Code/Spi

Read the 7219 datasheet, write yourself a for:next loop that counts up sends the data, something like this
for (tens=0 to 9)
for (ones = 0 to 9)
digitalWrite (slave_select LOW)
Spi.transfer(one_address)
Spi.transfer(ones);  
digitalWrite (slave_select HIGH)
next ones

digitalWrite (slave_select LOW)
Spi.transfer(tens_address)
Spi.transfer(tens);  
digitalWrite (slave_select HIGH)
next tens

put some delay if you want it to go slower, or wrap a blink with out delay around it and only let it increment on 1 second intervals, etc.

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up