View previous topic :: View next topic |
Author |
Message |
Yokablasta
Joined: 13 Dec 2017 Posts: 19
|
Posted: Mon Nov 25, 2019 6:03 pm Post subject: Issue with 2.42" SSD1306 and Glcdssd1306-i2c |
|
|
Hello,
I have a device that uses the glcdssd1306-i2c library to display text. Some people wanted a larger screen, so I started testing this WIDE.HK 2.42" 64x128 oled SSD1306 compatible OLED (http://www.wide.hk/index.php?route=product/product&path=18_46&product_id=68). I was not able to get the screen to display anything, with the exception of one time when the screen suddenly came to life and worked for an entire session when the power on the board flickered and the screen woke up. When that happened, the screen worked fine and looked great. However, once the power was cycled once, then I couldn't wake the screen up again. I think that the issue is with the reset timing between the Atmega128 and the OLED. Normally these screens have the reset signal brought out to a pin, and that can be connected to a pin on the MPU, but in this case, it's just GND, 5V, SCL and SDA. I've seen a bunch of the SPI/I2C types where people were adding i2c pullups and bridging resistors, etc. I was hoping to avoid having to do that and have a clean build. I was wondering if anybody had tried out one of these screens, and if so, what are you doing to wake the screen up? I have tried delaying the MPU i2cinit, but that doesn't seem to work. Any ideas would be appreciated!
(BASCOM-AVR version : 2.0.8.2 ) |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Mon Nov 25, 2019 6:53 pm Post subject: |
|
|
Hi,
Looks as if i2c pullups are already installed (R3/R4).
Does the display respond to a i2cbus scan? Something like:
Code: |
For Temp_byte = 0 To 254 Step 2 'Scan every even address
I2cstart 'Ping chip
I2cwbyte Temp_byte 'get result
If Err = 0 Then 'err=hw problem
Print Temp_byte ; "," ; 'no error so device
End If 'ie. no i2c device
I2cstop 'stop bus
Waitms 1
Next Temp_byte 'loop through each sensor
|
I've played with these displays in the past and the initalisation sequence it a real pain in the butt.
Maybe have a look at the arduino display libs and have a look if one of these supports exctly this display. If yes have a look at the code to see how they're initalising it.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
sielcon
Joined: 16 Mar 2006 Posts: 74 Location: Argentina
|
Posted: Mon Nov 25, 2019 7:05 pm Post subject: |
|
|
Hello, I have used that screen in 2 projects and the SPI version in another, and by the way I have not had any problems. I am using this lib [glcdSSD1306-I2C-Buf.lib] since it is very efficient with the buffer.
Regards.
Initialization Code
Code: |
'configuracion del OLED
Config Scl = Portc.5 ' used i2c pins
Config Sda = Portc.4
Config Twi = 400000 ' i2c speed
I2cinit
$lib "i2c_twi.lbx" ' we do not use software emulated I2C but the TWI
$lib "glcdSSD1306-I2C-Buf.lib" ' override the default lib with this special one
Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
Dim Lcd_auto As Byte
Const Rotate_180 = 0
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|