9 years, 1 month ago.

Problem with SPI on RedBear Nano using OLED display

I've published my attempt at merging the OLED driver (which I'm using successfully on a KL25Z board) and the example RedBearLab SPI driver. As checked in, it doesn't work (LED doesn't flash). I split the begin function in the constructor to avoid any SPI transfers - the transfer seems to cause a problem.

If I replace the two lines referring to gOled1 with the commented out SPI lines, the code appears to run correctly (but not in a form that allows me to use the display driver)

Question relating to:

Demo of Adafruit_SSD1306 graphics library and SPI interface on RedBear NANO nRF51822 board

1 Answer

9 years, 1 month ago.

I can report the same problem with the RedBearLab BLE Nano and the Adafruit 1.3'' OLED (using the SSD1351 Driver-Chip), do you can report any progress?

Very small amount of progress to report - I started from nothing and built up the driver function bit by bit all inline, enough to confirm that the port assignment and SPI peripheral can function. I wrote the code in a non-object orientated style, keeping all the variables as global, anything else failed. As I have it now, when I do 'spi.transmit(i)' rather than 'spi.transmit(buffer[i])', I get a nice pattern on the display. Using a buffer for storage isn't working (as in my array of byte isn't memory like).

Next step is to revert back to something simpler (pc-serial rather than SPI) and see if I can get sensible buffer behaviour, then connect up a debugger and see where that leads me. One problem is not having access to any of the debug info from an online build, but I think I have enough to make progress with now - assumption is that somehow the stack is getting corrupted.

posted by Sean Houlihane 21 Mar 2015

So you rewrote the mbed SPI Library? Is it possible to share the code with me?

posted by Paul Nykiel 21 Mar 2015