rust-embedded-community / ssd1331

SSD1331 colour OLED display driver for embedded Rust applications using embedded-hal
Apache License 2.0
17 stars 8 forks source link

Chip select line? #7

Closed pepijndevos closed 4 years ago

pepijndevos commented 4 years ago

Hey, I'm trying to use your library on my ULX3S board with a LiteX RISC-V SoC, but getting no output on the display at all. This board has a dedicated header for the SDD1331 display, which includes the chip select. However, your code does not use it, and it seems from the picture it is completely disconnected.

What is the correct behaviour for the chip select line? I'm currently just setting it low before initialisation. Is this correct? The Arduino library seems to set chip select low every command.

RigolDS10

FWIW, my logic analyser decodes the following command bytes

AE B3 F0 A8 3F A1 00 A2 00 A0 60 81 91 82 50 83 7D 3E F1 BE 30 A6 A4 AF 15 00 5F 75 00 3F
pepijndevos commented 4 years ago

Solved, never mind me.

jamwaffles commented 4 years ago

Glad you fixed it :)

FWIW, I don't recall the correct behaviour right now, but this driver deliberately doesn't take a CS line and leaves that up to the user to control.

pepijndevos commented 4 years ago

If anyone else ever stumbles across this, CS can just be tied low, leaving the chip selected.

My problem was that this random unidentified display that I got from a friend turns out to be actually a 1306 haha oops I've used your other library now, to do this: http://pepijndevos.nl/2020/08/04/a-rust-hal-for-your-litex-fpga-soc.html

jamwaffles commented 4 years ago

That's really cool! Thanks for sharing. I've often wondered what the missing steps are between a RISCV core and talking to peripherals in Rust on FPGA. Now I know :)