Cable for SerLCD 3V3 I2C display

Pleased to hear about your good weather. We’ve ordered another SerLCD display just in case - from a seller here in the UK… Got grandkids arriving so no R Pi work for me for 3 days. Will, hopefully, be doing some Microbit work with them though.

Still not sure why my i2c scan gets me a 32? 32 hex = 50 decimal.

So earlier this week I bought the same backpack for use with a generic LCD I picked up somewhere and just learnt a few things.

A) Are you sure you weren’t getting decimal 32? I got 0x20 (which is decimal 32), and looking in the official Adafruit library it has the address as _MCP23008_ADDRESS = const(0x20).

B) The Adafruit LCD backpack works totally differently to Sparkfun’s SerLCD. The Getting Started with MicroPython instructions won’t work with it. The SerLCD uses an ATmega328P microcontroller to convert the I2C commands to LCD commands, the Adafruit backpack uses an MCP23008, and they work totally differently. Whoops.

@Shoe This is what i ran to scan for i2c addresses.

import machine
sda=machine.Pin(0)
scl=machine.Pin(1)
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
print(i2c.scan())

It reported 32. According to the product page for my display backpack it defaults to 70. I have run the above code on my PICO Explorer Pack and it reported the matching address for my RV3028 of 52. The only edit to the code was the pin numbers for SDA ans SCL, from what was used on the PICO Explorer Pack, to 0 and 1.

According to the product page for my display backpack it defaults to 70

Did I read your earlier post wrong, didn’t you say you were using the Adafruit I2C/SPI LCD backpack which you linked? It says 0x20 at the bottom of that product page:

Technical Details
EagleCAD PCB GitHub files and Fritzing object available in the product tutorial
This board/chip uses I2C 7-bit address between 0x20-0x27, selectable with jumpers

Ok, I must have gone to the wrong page, I see 0x20 now like you do? My first attempt with my logic level shifter got me nothing. I then looked up what the address jumpers did and if one had to be done. Where ever I was then stated 0x70?
Thanks for being persistent @Shoe. I’ll be messing with this again in about an hour or so, after my morning walk with my dog Missy. I’m going to take my laptop and display and an Arduino Uno out under my Gazebo on my back deck and take my time.
Once I’m sure it works as advertised with an UNO I can decide if I want to try again on a PICO.

1 Like

Ah that’s grand, I thought I’d misread something there. The firmware for Sparkfun’s SerLCDs is available on GitHub and runs on a 328p, so I wonder if you could technicaly put an Uno between the Pico and the LCD and be able to follow the MicroPython guide book that way.

Enjoy your walk!

Does the PICO Getting Started book actually say what display they use? I’m thinking it does and I some how missed it?
I’ve heard it said that the first thing to go is your memory. I don’t remember what the second thing is? ;)

Our morning walk is a big part of her day and my day. It’s a nice hour or so walk on a trail with a stream by it, and she can go off leash. She has a ball, lots of fresh water and a couple of other dogs to play with.

1 Like

In the Book - Pico Guide, on page 41, they recommend the Sparkfun SerLCD module - 3V3. It has a red board. I thought it rather expensive as a starter display and does not allow graphics other than defining characters. How to use it starts in the I2C section on page 118.

Much cheaper, simpler to use and fully supported is the I2C SSD1306 128x64. It works with MP, CP and Arduino and you can do graphics!

Yup, it does specifically mention the Sparkfun SerLCD. I agree @Tonygo2, it’s expensive for what it is, but at a quick glance the others don’t really seem to document the I2C commands as clearly, so I don’t think they’d be as useful for learning to use I2C. I’m not sure why I expected the Adafruit I2C backpack to operate in the same way.

@alphanumeric It sounds like a lovely way to start the morning.

1 Like

If you want to try the SSD1306 here is my guide:
SSD1306 With Raspberry Pi Pico : 6 Steps (with Pictures) - Instructables

Ok, I missed the Sparkfun reference some how.

I am making progress though. I just installed the latest Arduino IDE and added the Adafruit LiquidCrystal Library. The Hello World i2c Sketch is running from my UNO so I haven’t fried anything with all my messing about. Now I’m debating if I want to bother trying to get this to work on my PICO? Time to take a break anyway.

Speaking of SparkFun, I’m using this cool USB Hub / Cable.

Works just fine with my UNO, also worked with my Pi PICO

EDIT: I bought this backpack long before the PICO was released, seemed like a good idea at the time. ;)

This IMHO, is the code to run to get the i2c device info. It gets you the decimal and hex address.

import machine
sda=machine.Pin(20)
scl=machine.Pin(21)
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
 
print('Scan i2c bus...')
devices = i2c.scan()
 
if len(devices) == 0:
  print("No i2c device !")
else:
  print('i2c devices found:',len(devices))
 
  for device in devices:  
    print("Decimal address: ",device," | Hexa address: ",hex(device))

Scan i2c bus…
i2c devices found: 2
Decimal address: 82 | Hexa address: 0x52
Decimal address: 119 | Hexa address: 0x77

The 52 is my RV3028, and the 77 is a BME280 with the alternate address jumper cut. Both are plugged into my Pico Explorer Base.

EDIT: This is what I get with my display connected.

Scan i2c bus…
i2c devices found: 1
Decimal address: 32 | Hexa address: 0x20

1 Like

Yeah that’s much more definitive, rather than making you guess between hex and dec.

I did see that Sparkfun cable and thought it was cool, but I’m trying to move everything over to USB C, so I figured the last thing I needed was a new cable to clutter the place up.

I almost didn’t buy it, glad I did though. It also comes in handy for recharging stuff. Nice long cord too. I do wish it had a USB C plug though.
I got a Tiny 2040 and then realized I didn’t have a USB C cable to connect it to my PC.
Luckily I had one of these adapters on hand.
Micro USB to USB-C Adapter – Pimoroni

I may have a go at this “on a PICO” tomorrow. It’s Circuit Python not Micro Python, I’m OK with that if it works.
Python & CircuitPython | i2c/SPI LCD Backpack | Adafruit Learning System

1 Like

Although I can’t do any work until Tuesday, I’ve been reading all your comments. I’m going to stick with the Sparkfun LCD as I’d like to write my attempts up in my “dummies’ blog” Geek Gran learns Raspberry Pi – This is a notebook of projects I attempt with a Raspberry Pi or wearable technology (wordpress.com) eventually, if I get the display doing what I want it to do. I’m an electronics beginner and I have had no problem with (although I’ve spent time rereading to complete the tasks) any of the other chapters in the Pico Book ‘Getting started with Micropython …’ so I feel I should persist. I then feel it’s my job to report my difficulties in layman’s terms in my blog. I feel that doing this is good for companies like Pimoroni because it brings electronics to a wider audience - and that audience will want to buy your products and make stuff.

The Sparkfun version mentioned in the Book is likely the one to go with. I’m struggling to get mine working with the PICO, with Adafruit’s Circuit Python. Mainly because the PICO isn’t listed or mentioned in their tutorial. That’s not a criticism, just an observation.
I got as far as running code from Mu and got errors. Likely something I have to edit to make it work with a PICO instead of a Feather. I’m taking a break from it for now, back’s getting sore. I’m going to try again, just not today. I’ll start a new thread too and just put a link to it here.

1 Like

This looks to be a very strange version of the display LCD1602/2004 display, which Sparkfun have now discontinued, and uses a cut down and very non-standard command set. I suspect it was produced for 3V3 Arduinos. You can get more information by looking at the Arduino examples here:
OpenLCD/Example5_I2C_ChangeAddress.ino at master · sparkfun/OpenLCD (github.com)

One of the few commands they have included is one to change the I2C address.

Could you have accidentally changed it?

Their code annoyingly switches between Character, Decimal and Hex with wild abandon.

I do not have one of these displays but it appears that sending 0x7c, 0x19 (25 dec) and 0x50 should set the i2c address to 50 Hex = 80 dec

They appear to have thrown away most of the useful commands from the LCD2004 or LCD1602 manual.

The parallel original version of the LCD2004/1602 is 5V. The manual for the driver chip and its command set is quite easy to understand and I managed to write my own driver for it. (The only time I’ve managed to get one to work.)

The board also supports Rx/Tx communication (UART) - you send it characters. If you get fed up with I2C you could try that. (They have added an ATmega328P to handle communication instead of the normal I2C backpack.)

Just for info: the display’s code is LCD-16397 RGB Text (Qwiic) and I’m attempting to use the Thonny editor on a Rasp Pi using Micropython to code and save programs on the Pico. I like this setup because when I succeed, I can easily make the Pico headless (ie work without keyboard & screen) so I can take it out and about to do air quality projects.
(You just rename the code Main.py to have it work headless - far better than when I’ve used a Rasp Pi Zero and had a rigmarole getting it to work headless.)

This guy got your specific board working but not via I2C.
16x2 SerLCD - RGB Text (Qwiic) — Cool Components
See the review.