-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSD 1306 Oled not working properly with HW SPI and Teensy 4.0 #56
Comments
Duplicates this forum thread: |
I solved the problem with help from the PJRC forums. Thank you very much. |
I personally think that modes 0 and 3 are swapped. There was a similar issue with the ESP8266 boards (esp8266/Arduino#2416). The SPI modes had been defined long back for the Arduino AVR boards and all other boards should behave in the same way. The byte 0x053 is written in all four SPI modes: From left to right mode 0, 1, 2 and 3 on an Arduino Uno: It would probably simple to crosscheck this with Teensy 4.0. I personally would keep this open until it is verified, that the SPI modes behave in the same way. |
I ran a quick test with this code:
The waveforms are correct. I'm considering this issue closed & fully resolved. |
@PaulStoffregen thanks for the quick response. Mode 3 indeed looks correct. However it actually is Mode 0 which had caused the problem. I wonder how the Teensy 4.0 picture would look like for mode 0. BTW: Amazing little board. Good Work. |
Please run the test program and capture the waveforms. If there is a problem with the waveforms, show me that you have done the test. I have many other projects needing my time, and many other people to help on the forum, so I'm considering this matter resolved. I'm not going to put any more dev time into it, unless you can show waveforms which demonstrate a problem. |
Understand, same time problem here. |
I am sorry but I don't have an oscilloscope. I only have one of these: |
Nice device, but we need to check clk vs data, so two channels are required. Ok, let's consider this as solved... |
I have an 2.42 inch Oled display wired to the Hardware SPI port of the Teensy 4.0.
SCK 13
MOSI 11
CS 10
DC 8
RST 9
When I use the Adafruit SSD1306 only the top 8 pixels of the oled work. The rest is noise.
With the u8g2 library horizontal lines appear on the oled no matter what I do.
The lines are every 8th pixel (7 pixels between the lines).
The oled works fine with an Arduino Nano with both libraries.
The only library which seems to work fine with the Teensy 4.0 is the Sparkfun HyperDisplay library. But this one is VERY slow.
After much trial and error (which can be followed here) I think this is a hardware SPI Issue with the Teensy code. (If I use the Software SPI functions with the same or different pins in the u8g2 library everything works fine, just slower.)
I tired to upload the code with lower Teensy microprocessor speed (down to 24MHz chosen from the Arduino IDE) but this had no effect on the horizontal lines.
This and this is the oled I use and this is some documentation regarding the driver.
Could there be an issue with the SPI software written for the Teensy 4.0?
I would really appreciate any help in solving this issue. Thank you very much.
The text was updated successfully, but these errors were encountered: