2013-11-07

Cascading 4 MAX7219s tested OK
































Now I have cascaded yet one more MAX7219 LED, so SPI1 drives 4 MAX7219s in cascade, 2 for matrix LED, and 2 for 8 digit 7 segment LED.


It is is easy to changed the test program to test one more MAX7219, by just changing the device number and repeat the display segment statements, as shown below.


        deviceNumber = 4;

        // *** Setup MAX7219 for digit decode and scan limit ***
        setUpMax7219BcdCodeB03(deviceNumber, spiChannelNumber);

        // *** Display 8 digits ***

        writeLedCommand02(deviceNumber, spiChannelNumber, OPERATION_ADDR, SHUT_DOWN);

        // *** Display 8 digits ***

        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_7, DIGIT_1);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_6, DIGIT_2);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_5, DIGIT_3);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_4, DIGIT_4);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_3, DIGIT_5);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_2, DIGIT_6);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_1, DIGIT_7);
        displayOneDigit02(deviceNumber, spiChannelNumber, DIGIT_ADDR_0, DIGIT_8);

        writeLedCommand02(deviceNumber, spiChannelNumber, OPERATION_ADDR, NORMAL);

.END

No comments:

Post a Comment