MSP430 MAX7221 Library Test

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
583 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Sep 24, 2010

An MSP430 running a display that uses three cascaded MAX7221s. This is an initial test for a library that I'm writing for MAX7221/7219 devices. The prototype currently uses a bit-bang SPI interface because it's a lesson for a microcontroller class (i.e. we'll teach SPI using bit-banging and then show how to program the USI).

The code is actually an adaptation of the Arduino Matrix.cpp - Max7219 LED Matrix library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.

Here's a demo project for the LanuchPad: http://bigvulcandeal.com/msp430/sample_code/MSP430_MAX7221.zip

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • @BigVulcanDeal I copied your code and all I get is 1 row of LEDs are on for about 3 seconds then go off. That is all. I don't get any cycling.

  • @MrPillygIt It works more or less like the Arduino Matrix library, iirc. If you copied my sample code exactly, then it will probably cycle the LEDs. You should be able to port Arduino Matrix library samples to this w/o too much problem. I'll try to look at the code and see if I can come up with a nice example.

    Also, I needed a buffer chip between my MSP430 and the MAX7221's in my sample board (there were 3 MAXs).

    To be honest, I sort of prefer Charlie-plexing LEDs -- much simpler

  • @BigVulcanDeal Alright it works now, but what is it supposed to do? All it does is make a single line that lasts for about 3 seconds then goes out no matter what I put in the code. How can I program what it will display? Is there some way like arduino where you type the 8 bit # for example 10000001. The first and last LED in that line would light up.

  • @MrPillyg Ok

    * SPI_CS goes to MAX7221 Load (pin 12)

    * SPI_CLK goes to MAX7221 Clk (pin 13)

    * SPI_MOSI goes to MAX7221 Din (pin 1)

    The MAX7221 DOut (pin 24) is used to cascade to other MAX chips (i.e. the can be daisy chained together to form a long shift-register). When you strobe CS, it latches the data into each chip. The board that I used for the sample code has three MAX chips cascaded, so I presume it sends 3 * 64 = 192 bits per update (I would need to check to be sure).

  • @MrPillyg Ahh -- just read the MAX7221 literature -- I see the issue.  Give me a minute ...

  • @MrPillyg MOSI is "Master Out, Slave In" -- The MSP430 is acting as SPI master, so SPI_MOSI sends data on rising edge of SPI_CLK (and could potentially receive data from the slave on falling edge of SPI_CLK). The SPI_CS is used to select the SPI device (I think that the first slave bit may arrive when SPI_CS is high and SPI_CLK is still low).

    There is a lot of literature available on SPI. Googling "Arduino playground - LEDMatrix" may help with SPI in the context of MAX7221s

  • @BigVulcanDeal What 3 pins? I see

    #define SPI_CS BIT4

    #define SPI_MOSI BIT6 (what pin on 7219?)

    #define SPI_CLK BIT5

    But what about DIN and DOUT?

  • The description has a link to the source code. No schemati -- it's SPI, so there are only three wires needed.

  • schematic?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more