LCD 1602 - Library
Re: LCD 1602 - Library
Most PCF backpacks have a potentiometer for adjusting the display contrast. It may appear the display isn't working when the contrast is extreme.
Re: LCD 1602 - Library
Found it - but after adjusting the potentiometer the problem was not solved :/
After turning the potentiometer high, the display shows me just a single row on the lcd:
After turning the potentiometer high, the display shows me just a single row on the lcd:
Re: LCD 1602 - Library
i2c.scan() delivers me a list of the values 8 to 119...
>>>i2c.scan()
[8,9,10,11,12,13,14,15,16 - and so on - 117,118,119]
>>>i2c.scan()
[8,9,10,11,12,13,14,15,16 - and so on - 117,118,119]
Re: LCD 1602 - Library
That's the typical power-on & not-cleared-yet state.me just a single row on the lcd
Re: LCD 1602 - Library
But I just need to power on the LCD - there is no connection to REPL necessary, the row appears every time the LCD get some power.Roberthh wrote:That's the typical power-on & not-cleared-yet state.me just a single row on the lcd
How can I solve this problem and clear the display?
I have tried the code from mcausers post:
Code: Select all
from time import sleep_ms, ticks_ms
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000)
lcd = I2cLcd(i2c, 0x27, 2, 16)
lcd.clear()
Re: LCD 1602 - Library
Seeing this suggests that the pullup resistors aren't wired in properly.ZKDMun wrote:i2c.scan() delivers me a list of the values 8 to 119...
>>>i2c.scan()
[8,9,10,11,12,13,14,15,16 - and so on - 117,118,119]
Re: LCD 1602 - Library
Found the problem:
The wiring with the 4.7k ohm resistors like the wiring on my sketch I posted before was ok...
but I am using a long breadboard and I am a newbie - my lesson of the day was that the Vcc- and die GND-Line of these long breadboards are interrupted at the middle of the boards - that was my mistake, without any voltage the pullup-resistor can not work.
Many apologies for this mistake - I am ashamed of myself. :/
Now it works perfectly - thank you guys
The wiring with the 4.7k ohm resistors like the wiring on my sketch I posted before was ok...
but I am using a long breadboard and I am a newbie - my lesson of the day was that the Vcc- and die GND-Line of these long breadboards are interrupted at the middle of the boards - that was my mistake, without any voltage the pullup-resistor can not work.
Many apologies for this mistake - I am ashamed of myself. :/
Now it works perfectly - thank you guys
Re: LCD 1602 - Library
Best part about making mistakes is that you learn from them
Re: LCD 1602 - Library
Another question:dhylands wrote: Did you add pullups on the SDA and SCL lines? I2C requires them.
Is it necessary to use Pin.PULL_UP?
Can I replace the resistors with Pin.PULL_UP, or is this no replacement for the resistors?
Noob question :/, but I can not understand the meaning behind the Pin.PULL_UP-method...
Re: LCD 1602 - Library
When you use Pin.PULL_UP this enables the internal weak pullups which are on the order of 30-50K ohms (40K typical).
I2C prefers to have strong pullups (I normally pick 4.7K ohms or lower).
You can use weak pulllups if you have a small number of devices on the bus and the wires aren't long, and you can live with lower bus frequencies.
It basically boils down to the larger the value of the pullup, the slower the rising edge to create a 1 bit. The speed of this edge is affected by bus capacitance (which increases each time you add a device) and ultimately determines the max speed you can run the bus at.
There are so many factors that can affect this that the only way to know if it will work for you, is for you to experiment and see it it works reliably enough for you with your particular setup.
I2C prefers to have strong pullups (I normally pick 4.7K ohms or lower).
You can use weak pulllups if you have a small number of devices on the bus and the wires aren't long, and you can live with lower bus frequencies.
It basically boils down to the larger the value of the pullup, the slower the rising edge to create a 1 bit. The speed of this edge is affected by bus capacitance (which increases each time you add a device) and ultimately determines the max speed you can run the bus at.
There are so many factors that can affect this that the only way to know if it will work for you, is for you to experiment and see it it works reliably enough for you with your particular setup.