Mini OLED breakout board scan direction (0xDA) command not working properly

When i send 0xC8 and 0xDA02 commands the scan direction according to the data sheet is supposed to be "Sequential COM pin configuration (DAh A[4] =0), COM output Scan direction: from COM63 to COM0 (C8h), Disable COM Left/Right remap (DAh A[5] =0).

But what I seem to be getting on the screen looks like its for 0xC8 and 0xDA32 " Alternative COM pin, configuration (DAh A[4] =1), COM output Scan direction: from COM63 to COM0(C8h), Enable COM Left/Right remap (DAh A[5] =1).

So i tried sending 0xC8 and 0xDA32 and it looks closer to what 0xC8 and 0xDA02 is supposed to look like … go figure?

Hi @RLuc ,

May I ask: what are you trying to do? Flip the display?

In our Qwiic OLED Library, we default to 0xC8 and 0xDA 0x12.

Don’t forget to set the PreCharge and VcomDeselect too.

Best wishes,
Paul

Just trying to learn its capabilities and RUST. I can supply my initialization cmd sequence later if you want. But I assure you I have enabled pre-charge and Vcomh deselect.

I tried DA00 and sent data 0102040820304080 repeating and it showed intermingled scan lines. And the I tried DA32 with the same data pattern and it showed separated lines.

Exactly opposite what I expected according to the data sheet.

Ray

Painting one line at a time and waiting two seconds. Then painting the next line…

Ray

Each byte of data replicated 8 times so I could see the line being displayed

Ray

Init sequence.

// init sequence :
// cmd AE sets display to sleep mode
// CMD A8 3F sets multiplex ratio number to 3f 63 (actually 64) this should be a const parameter for 32 or 64 line displays
// CMD D3 00 sets display offset to no offset
// CMD 40 sets set RAM display start line register to line 0
// CMD A1 sets seg map remapped (col addr 127 as SEG0)
// CMD C8 sets eg COM output scan direction remaapped COM[N-1] = COM0 where N is mux ratio
// limiting buffer to 8 words no reason but I2C limits to 8 as well.

write_cmd(&mut valok, &mut valerr, &[0xae,0xa8, 0x3f, 0xd3, 0x00, 0x40, 0xa1, 0xc8 ], &mut d_c_pin, &mut delay, &mut spi);

// CMD DA 02 set com scan normal direction but 0x02 is getting interleaved screen like 0x32, so will try 0x32 to see if that looks like 0x02
// CMD 81 7F set contrast to middle of range
// CMD A4 sets entire normal mode (not inverse mode)
// CMD A6 sets display to normal mode RAM bit =1, Display pixel = ON
// CMD D5 80 set clock divide = 0 (really 1) & OSC freq = 8 middle of range

write_cmd(&mut valok, &mut valerr, &[0xda,0x32, 0x81, 0x7f, 0xa4, 0xa6, 0xd5, 0x80 ], &mut d_c_pin, &mut delay, &mut spi);

// CMD 8D 14 sets enable charge pump
// CMD D9 22 set precharge period phase 1 = 2 clks, phase 2 = 2 clks
// CMD DB 30 set Vcomh deselect voltage = -0.83 x Vcc
// CMD 20 00 set addressing mode to horizontal wrap

write_cmd(&mut valok, &mut valerr, &[0x8d,0x14, 0xd9, 0x22, 0xdb, 0x40, 0x20, 0x00 ], &mut d_c_pin, &mut delay, &mut spi);

// CMD AF sets display to wake up

write_cmd(&mut valok, &mut valerr, &[0xaf ], &mut d_c_pin, &mut delay, &mut spi);

Ray

Thanks Ray,

Which exact display do you have? Please post a link if possible.

Best,
Paul

[

SparkFun Micro OLED Breakout
sparkfun.com

](https://www.sparkfun.com/sparkfun-micro-oled-breakout.html?gad_source=1&gad_campaignid=17479024039&gbraid=0AAAAADsj4ERvJECcjQMG7A5XN6V1j-VSw)

Ray

Thanks Ray,

Here is how our Arduino Library initializes that display:

AE Display Off
D5 80 Clock Divide
A8 2F Multiplex Ratio
D3 00 Display Offset
40 Display Start Line
8D 14 Charge Pump Setting
20 02 Page Addressing Mode
A6 Normal Display
A4 Resume Display
A1 Remap : Column 127 to SEG0
C8 Remapped Mode : COMN to COM0
DA 12 COM Hardware Config : RESET RESET
81 8F Contrast BANK0
D9 F1 Precharge Period
DB 40 Deselect Level
2E Deactivate Scroll
AF Display On
B0 Page Start Address
12 Higher Column Start Address
00 Lower Column Start Address

I hope this helps,
Paul

Paul,

I’m using horizontal addressing mode. setting it to start at col/page 0. and I was using default screen mapping DA 02 which interleaved when it was NOT supposed to and then trie DA 32 which didn’t interleave when it was supposed to. Not sue what DA 12 would do but my guess is interleave as well.

I’m also seeing problems in horizontal addressing mode not taking Page and Column limits. But that would be a new ticket..

I have a movie of what I was seeing with DA 02 if you want to see it.

Ray