Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months 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:
1 Answer
9 years, 8 months 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 21 Mar 2015