SSD1306 INFO SENT JUST APPEARS FOR A SEC

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Trönfstar
Posts: 16
Joined: Fri Jun 09, 2017 5:16 am

SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by Trönfstar » Mon Jul 16, 2018 9:32 am

Hey everyone!

I set up an ssd1306 on my pyboard and everything (initializing, commands) works fine, except one thing:
if I send data into the GDDRAM, it just appers for a moment and than disappears. So I can see the text for example, but if
I want it to stay there, I have to refresh my function fastly. The strangest thing is that sometimes it works well. it is total random.

I use the builtin FRAMEBUF module, and I2C module from the MACHINE libary.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by pythoncoder » Mon Jul 16, 2018 9:59 am

Are you using the official driver?
Peter Hinch
Index to my micropython libraries.

Trönfstar
Posts: 16
Joined: Fri Jun 09, 2017 5:16 am

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by Trönfstar » Mon Jul 16, 2018 10:33 am

No, It is my own, but mainly the same. Anyway the i2c.write() and i2c.stop() method doesnt work with the pyboard.
I'm using i2c.writeto(). What I realized as a real difference: 'addr << 1'.
I'm going to try it and feedback!

Trönfstar
Posts: 16
Joined: Fri Jun 09, 2017 5:16 am

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by Trönfstar » Mon Jul 16, 2018 10:36 am

ENODEV error by the modified address.. It is fixed mechanically on the PCB by the producer company! :o
Just so tiny - hard to realize. :D So if I remove the solder it must work well, doesn't it? Actually the display is not mine but my friend asks me to solve his trouble. I use a ssd1327 with SPI and it works so as it is writtened.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by mcauser » Tue Jul 17, 2018 9:22 pm

Unrelated but worth mentioning. Some SSD1306 modules are sold as SPI interface but are actually I2C and vice versa. Look for a CS pin to be sure it’s SPI. Four pin modules are almost certainly I2C.

Trönfstar
Posts: 16
Joined: Fri Jun 09, 2017 5:16 am

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by Trönfstar » Wed Jul 18, 2018 9:59 am

It is solved.

First: using 0x3D as address is not necessary.

Second: I had put the D/C bitpattern into the buffer, when write data, and increased the bytearray size.
It was look like: bytearray(1 + (width * height)) >>or pages instead of height<<
buffer[0] = 0x40 (reserved)
Now it has just the right size, but the first element is the same D/C selector yet.
Last edited by Trönfstar on Wed Jul 18, 2018 1:36 pm, edited 1 time in total.

Trönfstar
Posts: 16
Joined: Fri Jun 09, 2017 5:16 am

Re: SSD1306 INFO SENT JUST APPEARS FOR A SEC

Post by Trönfstar » Wed Jul 18, 2018 10:08 am

Actually it is a really cheap copy: there is no brand name, false serial addresses writtened on PCB, but at least it has only four pins. :D

Post Reply