Streaming Radio Player: OLED Garble

Even in the dim light of dawn, it’s obvious¬†slowing the SPI clock to 1 MHz didn’t quite solve the problem:

RPi OLED display - garbled

RPi OLED display – garbled

The display started up fine, became encrypted during the next few hours, and remained garbled as the track information changed. This is almost certainly a bad SPI transfer trashing the OLED module’s control registers.

Dropping the clock to the absolute minimum of 0.5 MHz didn’t help, either:

serial = spi(device=0,port=0,bus_speed_hz=500000)
device = sh1106(serial)

This particular display woke up blank after loading the new code, then worked OK after another reset. The other streamers lit up as expected on the first try, so the slower SPI isn’t making the situation instantly worse.

Running the clock at 1 MHz definitely reduced the failure rate, which suggests it’s a glitchy thing.

Good embedded systems practice suggests resetting the entire display from scratch every now and again, but my streamer code has no concept of elapsed time. Opening that particular can o’ worms would almost certainly result in an on-screen clock and I do¬†not want to go there.

I suppose I must get a new oscilloscope with SPI bus decoding to verify all the SPI setup and hold times …


  1. #1 by RCPete on 2018-02-19 - 11:05

    Any project that involves getting new toys tools can’t be all bad. [grin]

    • #2 by Ed on 2018-02-20 - 08:07

      Let’s say the subject has come up; the CRT won’t last forever.

      • #3 by RCPete on 2018-02-20 - 11:34

        (Remembers Tek terminal with a circuit layout burned in the storage phosphor. Some last shorter than others…)

        • #4 by Ed on 2018-02-20 - 15:45

          Aye! Tek 4015 Graphic Terminals: vector graphics through 9600 baud RS-232!

  2. #5 by Jacob on 2018-02-19 - 17:38

    Looks like the Standard Galactic Alphabet from Commander Keen (1991).

    • #6 by Ed on 2018-02-19 - 18:50

      Well played, sir!

  1. Streaming Radio Player: Standard Galactic Alphabet | The Smell of Molten Projects in the Morning
  2. Streaming Radio Player: RPi and OLED Updates | The Smell of Molten Projects in the Morning
  3. Streaming Radio Player: CE Timing Tweak | The Smell of Molten Projects in the Morning