-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SSD1327 Waveshare 128x128 OLED and nRF52 DK interfaced via SPI #1381
Comments
BTW: It seems U8X8_MSG_GPIO_RESET is never actually called? Don't I need that line? |
This is a screenshot from the signals when the Arduino Weather sample is run: or - more zoomed out: So something seems to be particularly off in my screenshot further above, where the D/C high/low seems to be in the CS=1 (no activity) phases... I wonder... Could it be a timing related issue because of the manual controlled D/C GPIO? I wonder if I need that "while (!m_xfer_done);" in the U8X8_MSG_BYTE_SET_DC event as well, because it might happen otherwise, that the D/C/ is flipped before the actual SPI data has finished sending? |
I think I found the reason why the D/C looks totally different... I adapted the code from the TWI example where it was OK to just send everything out in one big send(). For SPI the data should probably be send byte per byte as for the D/C to be able to toggle. So I rewrote it now as:
And the sequence looks much better now But still the screen looks totally garbled... Though its now only a movement of the top pixels... |
If you could have a look... I exported the sequence of commands from the analyzer as CSV.... u8g2_Setup_ssd1327_ws_128x128_f(...) From what I understand the u8g2_InitDisplay(&u8g2) is lines 1-35, the SetPowerSave is line 36, and then the rest after that is the sent buffer... Does this match what you would expect from the code? Please ignore the column MISO. I've set MISO to the DC channel, but apparently the decoder does not make sense of it and prints it as 0xff for every row, but from the screenshot one can see the value is cleary alternating between 0x00 and 0xff depending on whether it's data or command. |
I know made another change to the SPI CB... This now works properly... I will clean it up more and create a non-blocking version again for further inclusion in the reference implementations if you want.
|
This is the final code in non-blocking mode. https://github.com/OevreFlataeker/u8g2_nrf52
|
Created a link from https://github.com/olikraus/u8g2/wiki/Porting-to-new-MCU-platform to this issue, closing... |
Today I am trying to interface the SSD1327 with my nRF52 DK via SPI. Based on the experience from interfacing the SH1106 via TWI on the same board I adapted the relevant functions again. I can enable the display but my loop printing "Hello world" just shows an distorted bunch of lines wandering over the screen.
The code I used:
This is the initialization of the display
Calling print_hello() in the loop delivers such a picture on the display. The lines are wandering from right to left over the display
Any idea what might be the cause of those distorted lines? When I just do a single DrawStr() I of course also only see a static (distorted) image.
When I sniff the print_hello() loop it looks like this... which looks somewhat weird to me? (DC is alternating all the time between high and low without any signal on the other lines?), the CLK is longer than the MOSI signal, and MOSI seems to be just 0x00?
The text was updated successfully, but these errors were encountered: