Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

source codes to control max7219 with pic16f877

Status
Not open for further replies.

alovew

Newbie level 3
Joined
Sep 16, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Singapore
Activity points
1,302
pic16f877a con max7219

Hi,
Im now working on a project that uses a PIC16F877 microcontroller to control a MAX7219 LED driver that can control up to 8 digits of 7-segments display. However, I dont know how to write the program to control the MAX7219. Can anybody help! Thanks.
 

It's a long time since I used a MAX7219 but I remember it being quite easy to use.

The interface is similar to SPI but it assumes the device is always selected so there is no 'chip select' pin.

What you do is put your data into a register then rotate it so the end bit is put into the 'C' flag. Then based on whether 'C' was a 1 or 0, you set your data output pin to the MAX7219. Then you put a '1' on the CLK pin followed by a '0', you repeat this 8 times. Next, you load the next 8 bits of data (it uses 16-bit wide commands so do it as two 8-bit transfers) and do the same. Finally, when all 16 bits have been clocked out, you put a '1' on the LATCH pin and then a '0' to tell the MAX to accept the data.

It can be done is very few instructions if you are careful.

Brian.
 

alovew said:
Hi,
Im now working on a project that uses a PIC16F877 microcontroller to control a MAX7219 LED driver that can control up to 8 digits of 7-segments display. However, I dont know how to write the program to control the MAX7219. Can anybody help! Thanks.


Here you have some examples (basic, c, pascal from Mikroelektronika) and the schematic:

**broken link removed**

**broken link removed**
 

Thanks for the help guys, it was very helpful. But how about if I cascade a few MAX7219 together? Does the program need to change?
 

Try this:

**broken link removed**

It is an apps note I wrote some years ago.

The AS1100 is better. the MAX7219 has some bugs in it - the SPI lines are prone to latching up on startup (they float and hence read erroneous data into the chip). The AS1100 overcomes this, but is an idential chip in all other ways

Hope this helps

Simon
 

hey guys i wanted to noe any software where i can try out my circuits before doing it on board. which involves pic-16f877a MuC.
 

Hi,
i would like some help on getting some sample C codes that can let the user select the required LED segments to light up using the MAX7219 that is controlled by a PIC16F877. Some coding on how to cascade the MAX7219 LED drivers would be very helpful also as I will be dealing with a lot of 7-segment displays. Thanks in advance guys.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top