MAX7219 Issues

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
mc2software
Posts: 5
Joined: Wed Jan 13, 2021 6:08 pm
Location: Northern Florida

MAX7219 Issues

Post by mc2software » Fri Jan 22, 2021 10:30 pm

Sorry, I decided to look at the Adruino library to look for corrolations. So hold off on replies.

I have a project that I originally created with Arduino and now want to move it to MicroPython on an ESP32 board. I've looked through a few of the MAX7219 when using the chip for 7-segment LEDs. I'm finding an inconsistency in how these various libraries are implementing the SPI call in the constructor, where each use different arguements to SPI(). I'm just not sure how to specify the DIN, CLK and LOAD pins, and am getting inconsistent (or non-existent) results on the LEDs. I may not be able to rely on the default SPI, CLK and LOAD pins on the ESP32 because I will eventually have more than one SPI device (e.g. and SD card) on this board. For those who have not worked with the MAX7219, there are three pins connected to the board: DIN, CLK and LOAD. If you're cascading multiple chips, there's a data out that connects to the next DIN. The CLK and LOAD are shared connections.

For example, one has this:

Code: Select all

        
        self._spi = SPI(SPI_BUS, baudrate=baudrate, polarity=0, phase=0)
another has:

Code: Select all

        
        self.spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=clk, mosi=din)
MicroPython documentation has these examples:

Code: Select all

        
	hspi = SPI(1, 10000000, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
	vspi = SPI(2, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
From this I can figure out how to assign the CLK (sck) and DIN (mosi) pin, but is the LOAD pin miso?

Post Reply