Further Testing
Adding Layers
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
We're going to now add a layer on top of our somewhat verified SPI transmitter. This will control a 256 pixel Max7219 display. The chip that drives this display (there's atually four of them) has the datasheet here. This datasheet isn't too bad, but this is one of those chips that is quite flexible and as a result its datasheet can be a lot to take in.
The Max7219 is actually the driver chip behind the displays used in 6.1903/4. You may or may not have taken that class since the Departmental requirements have been changing so much in recent years, but the display is a 8x32 grid of LEDs shown below:
This display is actually not 8x32, but rather four 8x8 displays, each controlled by a MAX7219 display driver. The chips were meant to be scalable such that they could strung out in series allowing easy creation of larger displays.
For example, in browsing the datasheet (which you should do), the standard transaction for a display is a 16 bit SPI message. The chips have an interesting capability where if instead of clocking in 16 bits of SPI data and being done with it, if you keep CS low, you can send another 16 and they will forward on the SPI data to the next chip down the line. What this means is that for a 8x32 display like we had we can send the display 64 bit instruction sets farmed out to each 8x8 display appropriately...the message meant for the furthest-in will be the earliest sent 16-bit message. For some types of commands (in particular startup sequence ones), we just need to send the same 16 bit sequence to all four segments...some basic startup commands these displays need (based on our testing) would therefore be:
- Send the display test command (
16'h0F00
) to each segment:64'h0F000F000F000F00
- Send the display off command (
16'h0C00
) to each segment:64'h0C000C000C000C00
- Send the display on command (
16'h0C01
) to each segment:64'h0C010C010C010C01
- Send the decode mode 0 command (
16'h0900
) to each segment:64'h0900090009000900
- Send the scan mode command (
16'h0B07
) to each segment:64'h0B070B070B070B07
- Set screen intensity with (
16'h0A01
) to each segment:64'h0A010A010A010A01
It gets a little tricky when you want to start specifying the pixels though.