Added: 1 year ago
From: BigVulcanDeal
Views: 580
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (9)

Sign In or Sign Up now to post a comment!
  • schematic?

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

  • @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?

    

  • @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

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

  • @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).

  • @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.

  • @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 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.

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