SSD1306 PIC18F Assembly Initialization in SPI
Hello all forum members!
I am trying to write assembly language code for use in a project that I am working on using the SSD1306 128x32 OLED w/ SPI and PIC Microcontroller. I have searched quite a bit but find almost nothing for this topic using SPI and assembly language. I thought I would give this forum a shot to see I could solve my issues w/ this project as described below.
Please see attached a copy of my code written for a PIC18LF26K22 in assembly for SPI and OLED SSD1306.
Now for the issues that I am having. I have read the datasheet and followed the Initialization sequence listed on page 64. I have also written my code to perform the needed reset before initializing the SSD1306. I then, in my code, wrote code to turn on a column of 8 bits on a page to show that my code works. I am using SPI mode 0 but have tried all modes with no difference in the outcome of the OLED not initializing. I have my PIC18LF on a breadboard running from a 3.3v LDO reg that I have used in many projects in the past and that is feeding the OLED which I have mounted to a Crystalfontz board which is for this OLED display. I have checked all connections and have also checked the Crystalfontz board for shorts which turned up none with my multi-meter continuity check. I have used the debugger w/ MPLABX and single stepped through all the code and have placed a blinking LED at the end of my code to signal to me that the code did complete of which it did. All settings for initializing the SSD1306 are taken from the Crystalfontz SPI Code for their 128x32 OLED.
No matter what I have tried I am not able to get this display to power up.
If anyone has any suggestions please post them here.
Thank you all!