This is going to be very long, so I apologize in advance!!
I've been attempting this for a couple days now and I'm at the point where I'm just trying random things since I seem to have hit a wall. I.e. not being very productive.
What I am trying to do is take a 1-bit BMP, convert it into a hex array, load it onto the Arduino (Pro Mini 3.3V), and output it to a Newhaven 3.12 OLED display. I've finally gotten the display initialized but when I try to load images I just get junk, and I feel out of options on what to do next. SPI communication with the display is working and has been verified with a logic analyzer, though I will be happy to do so again if that may be a culprit.
First things first, here is the datasheet for the display controller: http://www.newhavendisplay.com/app_notes/SSD1322.pdf
The relevant parts are:
Page 32-36 - Command Table Page 37-47 - Description of Commands
Of particular interest are pages 37-41, these seem to show how the display RAM is addressed, written to, and incremented.
Here is the display datasheet, no important info except for the initialization routine (Page 12): http://www.newhavendisplay.com/specs/NHD-3.12-25664UCB2.pdf
My main code includes a test array that should display: - Futurama joke - when it is working. The array was created in photoshop as a 1-bit BMP and converted using LCD Assistant. Here are the settings that I think are correct, based on the settings given in the initialization procedure and from examining the display controller datasheet:
My reasoning for this:
- From the datasheet, it appears that each byte contains 2 pixels, a 4 bit grayscale value for each one. Shown on page 40
- From my understanding of endianness, these bytes are all little endian (lowest address is least significant bit).
- Byte orientation is horizontal as the display was initialized in horizontal increment mode - shown on page 39 of controller datasheet.
I have tried 4 pixels per byte, 8, along with both little and big endianness and vertical and horizontal byte order, still see gibberish the whole time. I also can't exactly make sense of the table shown on page 40 of the data sheet. So each byte is 2 pixels but each column address has 2 bytes (4 pixels), but I can only pass one byte at a time (hex value) into the display RAM. Does it wait for the second before incrementing the column address?
Here is a picture of my display loaded with the code and settings shown: