0

Metro m4 AirLift Lite : LCD1602 connected with I2C
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro m4 AirLift Lite : LCD1602 connected with I2C

by PierreDeQuebec on Sat Sep 04, 2021 9:17 am

Hi,

I am trying to connect a 1602A LCD display with an I2C adapter. I reduced the sketch to its simplest form : METRO (+5V, GND, SDA, SCL) -> LCD1602A (+5V, GND, SDA, SCL).
I understood that I had to install 10 kOhm Pull-Up resistors, which I did. I coded a very simple program just to validate the operation of the display. But there you have it, only the backlight comes on. So there, I do not really know what to do. To make sure the display works correctly, I tested it on an Arduino UNO with a program written in C and it works!

Here is the program in CircuitPython.

Code: Select all | TOGGLE FULL SIZE
# coding: utf8
# LCD1602_I2C_test_base_1.py


"""Simple test for 16x2 character lcd connected to an MCP23008 I2C LCD backpack."""
import time
import board
import adafruit_character_lcd.character_lcd_i2c as character_lcd

# Modify this if you have a different sized Character LCD
lcd_columns = 16
lcd_rows = 2

# Initialise I2C bus.
i2c = board.I2C()  # uses board.SCL and board.SDA

# Initialise the lcd class
lcd = character_lcd.Character_LCD_I2C(i2c, lcd_columns, lcd_rows, address=0x27)

lcd.backlight = True

# Print a two line message
msg = f"Hello\nCircuitPython"
lcd.message = msg
print(msg)
# Wait 5s
time.sleep(5)

lcd.clear()
msg = f"Initialisation\nLine 2"
print(msg)
while True:
    lcd.message = msg


With this program, the display behaves as follows: the backlighting is on. Row 1 shows the pixels of all lit characters. The pixels in row 2 are all off.

I also did another test program to only test SDA, SCL lines by alternating backlight status with one second interval. The result: the backlight does not turn on for the time that the lcd.backlight value is True, but I can clearly see an alternation between On and Off because the backlight flickers at a very low intensity.

Do you have any suggestions to solve my problem?

PierreDeQuebec
 
Posts: 21
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro m4 AirLift Lite : LCD1602 connected with I2C

by PierreDeQuebec on Sun Sep 05, 2021 8:58 am

Another symptom. When I power on the microcontroller (Metro M4 ...), normally KDE will ask me to 'mount' the CircuitPython directory and in Pycharm, I can then start a session in RPL or start the compilation / execution of the code. But if the SDA and SCA ports are connected to the PCB for GPIO / I2C conversion on the back of the LCD screen, the microcontroller (Metro M4 ...) simply turns on the "ON" LED and after ... nothing! If then, I disconnect the SDA / SCL lines, the microcontroller initializes correctly (at least, that's what I deduce with KDE which offers me to mount the CircuitPython directory).

PierreDeQuebec
 
Posts: 21
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro m4 AirLift Lite : LCD1602 connected with I2C

by PierreDeQuebec on Sun Sep 05, 2021 10:59 am

I tested my SCL and SDA ports on the Metro card. For that, I connected my "BMP390" with its QWIIC connector. And everything works. But here I realize that my BMP390 is running at 3V and the LCD1602 requires 5V. So I couldn't chain my I2C devices. I am now considering ditching the 1602A for a 3V OLED display capable of communicating with the I2C protocol. Well, all this because by mounting all my devices (GPS, SD reader, BMP390, BNO08X), I am missing a GPIO for the display! Switching to an OLED display is a solution that gives me one of the unnecessary possibilities in my project and a complexity in my code that I would have done without.

Anyway, I remain open to finding the problem with the 1602A in I2C mode.

PierreDeQuebec
 
Posts: 21
Joined: Sun Jul 25, 2021 3:26 pm

Re: Metro m4 AirLift Lite : LCD1602 connected with I2C

by PierreDeQuebec on Wed Sep 22, 2021 9:05 pm

I come back with news about my problem starting the Metro M4 Airlift Lite with using the I2c bus. Because the 1602A with its backpack operates at a voltage of + 5Vdc, I all switch my I2C circuits to a voltage of + 5Vdc. Bad idea. Very bad idea. The Metro M4 Airlift Lite simply does not start (it does not boot!) If the I2C bus is on 5Vdc! To do it boot, I have to connect the SDA line after booting. Not very practical. In short, I returned to a voltage of + 3Vdc for my I2C bus and I kept my LCD1602 display without a backpack on a voltage of + 5Vdc. And everything works.

PierreDeQuebec
 
Posts: 21
Joined: Sun Jul 25, 2021 3:26 pm

Please be positive and constructive with your questions and comments.