Page 1 of 1

I2C GLCD start problem

Posted: Sat Oct 19, 2019 3:39 pm
by Jan Lichtenbelt
Hi,

I'm new in the field of I2C GLCD with SSD1306 driver. I start with showing one number, but I get the error
Test_I2C_LCD_V1.c: 209: (1250) could not find space (128 bytes) for variable _FCV_0cc51_gLCD_SSD1306_i2c1__DRAM0
What to do?

Kind regards

Jan
Test_I2C_LCD_V1.fcfx
(7.98 KiB) Downloaded 329 times

Re: I2C GLCD start problem

Posted: Sat Oct 19, 2019 4:55 pm
by mnf
Hi Jan,

Looks like the MCU you are using doesn't have sufficient RAM (1024 bytes on the PIC 16LF1847) for the display buffer.

FC is trying to allocate a buffer of 8 x 128 bytes for the display memory (1k) and there are several other variables (currentX etc) - you could use one of the 32x128 displays instead of the 64 x 128 oLEDs..

Martin

Re: I2C GLCD start problem

Posted: Sat Oct 19, 2019 6:28 pm
by Jan Lichtenbelt
Hi Martin,

Thanks a lot. I will try a microchip with more RAM

Kind regards

Jan

Re: I2C GLCD start problem

Posted: Sun Oct 20, 2019 11:55 am
by Jan Lichtenbelt
The RAM error has been disappeared using the 16LF18857 microchip.

But now I met an other problem. The address is 0x3C (https://www.okaphone.com/artikel.asp?id=484012) while the flowcode has only the choices between 0x78 and 0x7A. Does someone has a solution for this problem?

Kind regards

Jan
Test_I2C_LCD_V18857.fcfx
(7.92 KiB) Downloaded 184 times

Re: I2C GLCD start problem

Posted: Sun Oct 20, 2019 12:00 pm
by mnf
Flow code uses th address shifted left one bit (x2) with bit 0 as r/w

Both systems seem to be in widespread use - but it is a bit confusing - though I think the unshifted form seems more common.

Martin

Re: I2C GLCD start problem

Posted: Sun Oct 20, 2019 12:07 pm
by medelec35
Hi Jan,
Since 0x3C * 2 = 0x78
Then you will will use 0x78 for write and 0x79 to read

Re: I2C GLCD start problem

Posted: Sun Oct 20, 2019 12:13 pm
by viktor_au
Hello Jan

ssd1306 default address

The default 7-bit I2C address is = 0x3C or 0b00111100
Which makes the 7-bit address + Write bit = 8bit address or = 0x78 or 0b01111000 (120)
And hence the 7-bit address + Read bit = 8bit address or = 0x79 or 0b01111001
-----------
The 8-bit address has one bit to change the mode from the write mode to the read mode.

That is why:
- 0x3C =7bit address
- 0x78 = 8bit address with write mode
-0x79= 8bit address with read mode.
---
As Ssd1306 allow user to choose the two addresses (you will see the pads on the back of the board), one 8-bit write address would be 0x78 and the other 8-bit read address would be 0x7A.
---
Normally the program will write to OLED. The 0x78 address is the default one.

Re: I2C GLCD start problem

Posted: Mon Oct 21, 2019 9:38 am
by Jan Lichtenbelt
Hello Martin(s) and Victor

Thanks a lot for all explanations. Now I have to find out why the display does not work. More research.

Kind regards

Jan

Re: I2C GLCD start problem

Posted: Mon Oct 21, 2019 11:37 am
by Jan Lichtenbelt
After adding 2 pull-up resistor of 1k8 (with 3V3 power supply), it works!

That made a happy for me.

Kind regards

Jan

Re: I2C GLCD start problem

Posted: Mon Oct 21, 2019 12:49 pm
by Jan Lichtenbelt
I tried to get understanding the results shown on the gLCD:
Reality.jpg
Reality.jpg (54.64 KiB) Viewed 5337 times
It seems like the gLCD is not 64x128, but 32x128

I did also a simulation in Flowcode which resulted in:
Simulation.jpg
Simulation.jpg (11.09 KiB) Viewed 5337 times
This looks more as expected for a 64x128 gLCD. Or is there something else what can explain the first picture?

Kind regards

Jan

Re: I2C GLCD start problem

Posted: Mon Oct 21, 2019 3:45 pm
by Benj
Hi Jan,

Yes it looks like the resolution of the display is only 32 pixels high assuming you are using font size 0.

Looks like it might be only 32 x 64.