I have a MAX7217 7 segment 8 digit display. I have connected this to an ESP-07 with # SCK (CLK) -> GPIO4 (D2); MOSI (DIN) -> GPIO2; SS (CS) -> GPIO5. I have a 5 volt to 3.3 volt level translator between the two devices. The MAX module is working, being tested on an ATMega8 with a C program. The ESP-07 module and the level translator is also working by switching LEDs on these GPIO pins. All wiring is correct, no doubts on that. Can anyone please check the very simple code I have written to enable direct writes to the MAX 7219 over SoftSPI and offer suggestions to make this work? I am a newbie to Micropython and ESP-07, but experienced enough on AVR's and C.
#G:\Microcontrollers\ESP8266\uPython_libs\MAX7219_7segLEDdriver\pdwerryhouse_github\spi_test.py
# Connections:
# SCK (CLK) -> GPIO4 (D2)
# MOSI (DIN) -> GPIO2 (D4)
# SS (CS) -> GPIO5 (D1)
#from micropython import const
from machine import Pin, SoftSPI
#spi=SoftSPI(baudrate=100000, *, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck=None, mosi=None, miso=None)
spi=SoftSPI(baudrate=100000, polarity=0, phase=0, bits=8, firstbit=SoftSPI.MSB, sck=Pin(4), mosi=Pin(2), miso=Pin(0))
ss = Pin(5, Pin.OUT)
spi.init(baudrate=100000)
#buf = bytearray(2) #not used, since direct writes to SPI
ss.off()
spi.write(b'\x09\xFF')
spi.write(b'\x0a\x05')
spi.write(b'\x0b\x04')
spi.write(b'\x0c\x01')
spi.write(b'\x0F\x00')
spi.write(b'\x01\x04')
spi.write(b'\x02\x08')
ss.on()
I have been trying since about 2 weeks now, posted one github driver also, which I tested and not working (pdwerryhouse on github). I tried multiple drivers available on the Net. But then I scrapped all these and tried a very simplistic code that will just display the digits. But to no avail.