SINGLE 3 DIGIT 7 SEGMENT LED

I just want to point out, before you get too bogged down, you can buy these things from eBay for $10.

You get 8 digits, the MAX7219 chip, the board, two capacitors and a resistor. Just solder it all together and you can display 8 digits, driven by four wires (Power, Ground, Data in, Clock).

You can even chain those boards together to get 16 digits:

that's pretty neat, but this project just involves only a 3 digit display.. nothing more fancy than that

all i know is i got this mess and don't know what to do with it :frowning:
http://cdn.img42.com/183cf65cd9739615c8fc41f75e7eaf22.jpeg

thank you

MAX7219 expects to source current into 8 anodes and and sink current from 1 digit.
You have to add extra hardware to use common anode, see this application note:

what kind of extra hardware?

thank you

Read the datasheet - shows which type of transistors and how to connect them.

CrossRoads:
MAX7219 expects to source current into 8 anodes and and sink current from 1 digit.
You have to add extra hardware to use common anode, see this application note:
Using the MAX7219/7221 to Drive Higher Voltage or Current | Analog Devices

The display he has is a common cathode. It only matters anyway if you wish to use the character generator which is limited to digits 1 to 9 and the characters "-EHLP" - if you wish to define other characters, you cannot use the internal character generator anyway.

I have previously cited the MAX7219 data sheet which has the connection diagram on the first page, and the pin diagram for the display he has. It is only a matter of connecting the corresponding pins from one to the other, adding a 33k resistor as per the datasheet (and some bypass capacitors), and using the code Nick provided.

Paul__B:
It only matters anyway if you wish to use the character generator which is limited to digits 1 to 9 and the characters "-EHLP" - if you wish to define other characters, you cannot use the internal character generator anyway.

Whether or not you use the internal character generator does not affect the electrical characteristics of the chip. That internal generator just saves you having to code bit patterns into your code if you happen to only want digits and/or the other characters you mentioned.

Here's a MAX7219 with 3-digit common cathode display.
Change the display to match your pinouts.

giving up for now.. i said i was new to all this and right now it's just upsetting me and just making me want to stop for now. i don't know as much as any of you.

didn't know a 3 digit display and a chip would be so complicated to wire up and nobody can tell me where these wires go on the chip.. and i didn't even want the dots.. was even trying to make it easier, but guess not :disappointed_relieved:

thank you everyone for trying to help though

Overcoming the latest hurdle, understanding the package. Not all pins may exist (i.e. pin 6) - count the gap as pin if it is not there.

nobody can tell me where these wires go on the chip

What's wrong with Crossroad's schematic, all you have to do is identify the segment pins and the cathode pins on your display and modify the schematic accordingly.

So for example CR's drawing shows seg A on pin 1, you find where seg A is on your display and put the wire to that instead. etc etc.


Rob

i think i got it.. took me some time..

if that's right, now i need to know how to connect the chip to arduino and find some temp code just to see it working.. i didn't connect DP (3) because i will not be using it.

max7219 pins 4 & 9 are ground and 19 is power

arduino pin 12 is connected to the MAX7219 pin 1
arduino pin 11 is connected to the CLK pin 13
arduino pin 10 is connected to LOAD pin 12

thank you

I saw you are using Arduino Mega which have a different pins for SPI
please check here SPI - Arduino Reference

Here are the code to test the MAX7219

#include <SPI.h>

const byte MAX7219_REG_NOOP        = 0x0;
// codes 1 to 8 are digit positions 1 to 8
const byte MAX7219_REG_DECODEMODE  = 0x9;
const byte MAX7219_REG_INTENSITY   = 0xA;
const byte MAX7219_REG_SCANLIMIT   = 0xB;
const byte MAX7219_REG_SHUTDOWN    = 0xC;
const byte MAX7219_REG_DISPLAYTEST = 0xF;

void sendByte (const byte reg, const byte data)
  {    
  digitalWrite (SS, LOW);
  SPI.transfer (reg);
  SPI.transfer (data);
  digitalWrite (SS, HIGH); 
  }  // end of sendByte
 
void setup () 
  {
  SPI.begin ();
  sendByte (MAX7219_REG_SCANLIMIT, 2);      // show 3 digits
  sendByte (MAX7219_REG_DECODEMODE, 0xFF);  // use digits (not bit patterns)
  sendByte (MAX7219_REG_DISPLAYTEST, 0);    // no display test
  sendByte (MAX7219_REG_INTENSITY, 7);      // character intensity: range: 0 to 15
  sendByte (MAX7219_REG_SHUTDOWN, 1);       // not in shutdown mode (ie. start it up)
}   // end of setup
 
void number (const int num)
  {
 
 char buf [4];
 sprintf (buf, "%3i", min (max (num, 0), 999));
 
 // send all 3 digits
 for (byte digit = 0; digit < 3; digit++)
   {
   byte c = buf [digit];
   if (c == ' ' )
     c = 0xF;  // code for a blank
   else
     c -= '0';
   sendByte (digit + 1, c);  
   }   
  }  // end of number
  
unsigned int i;

void loop () 
 {
 number (i++);
 delay (100);
 }  // end of loop

i'm new and have not used SPI yet, probably don't plan to.. if you the exact pins to use please let me know.. otherwise i'll just wait for some normal code

thank you

cupstacker:
i think i got it.. took me some time..

if that's right, now i need to know how to connect the chip to arduino and find some temp code just to see it working.. i didn't connect DP (3) because i will not be using it.

max7219 pins 4 & 9 are ground and 19 is power

arduino pin 12 is connected to the MAX7219 pin 1
arduino pin 11 is connected to the CLK pin 13
arduino pin 10 is connected to LOAD pin 12

i have my 3 buttons in place, just gotta connect them.. just need demo code to see it count or something so would someone would be so kind so i get to test this thing out please

The connection to MAX7219 is SPI, if you used Mega board then the connection will be
arduino pin 50 is connected to the MAX7219 pin 1
arduino pin 51 is connected to the CLK pin 13
arduino pin 53 is connected to LOAD pin 12

cupstacker:
i'm new and have not used SPI yet, probably don't plan to.. if you the exact pins to use please let me know.. otherwise i'll just wait for some normal code

To talk to MAX7219 you have used SPI, this was the code used to control the MAX7219, what "normal code" you talking?

all i see is 3 8's.. hmm, i could swear i wired it right. i'll look when i wake up again.. it's 3:30am going back to bed

thank you

BillHo:
To talk to MAX7219 you have used SPI, this was the code used to control the MAX7219, what "normal code" you talking?

I rather think he means code that does not use the SPI.

It is not necessary; perfectly easy to write the code to "bit bang" it.

I rather think he means code that does not use the SPI.

yep

read up on shiftOut(), that's a bit-banged version of SPI that can use any pins.


Rob

doesn't really help, first off it's using 74HC595's..

all i need is some simple code to see the 3 digits actually working.. can we stay away from SPI, i'm already confused with all this, i have wiring back to 10,11, 12 (max 12,13, 1)

ok, nevermind a sample code.. i have 11 buttons i would like to connect to it

SEQUENCE
button 11 will "set/initiate" the display to - - - .. all other buttons are useless until this happens
buttons 1 through 10 will set the display to show in the display.. each button will have 2 values per say.. example:

button 1 is to be considered A & 1
button 10 is to be considered J & 10

you can see the rest in between.. so say i wanted the display to show b06, i would press button 2 and then press button 6 and then press button 1 - (a certain set of leds will be lit, but we are not at this step yet) and then blanks out the display - i would like to store a value that this button has been pressed at this point

END OF SEQUENCE

thank you