dhylands / python_lcd

Python based library for talking to character based LCDs.
MIT License
298 stars 116 forks source link

add seeed studio Grove - 16x2 LCD support - any chance? #32

Open dsssssssss9 opened 3 years ago

dsssssssss9 commented 3 years ago

Hi

I currently have a few of these ....

https://wiki.seeedstudio.com/Grove-16x2_LCD_Series/

This seems to be based on a JDH1804 controller....

https://github.com/SeeedDocument/Grove-16x2_LCD_Series/raw/master/res/JDH_1804_Datasheet.pdf

i am guessing that this is why i cannot seem to make it work under circuit python with your wonderful library?

Is there any way you could add support for this controller please?

I hope you don't mind me asking?

Regards

Jason

davehylands commented 3 years ago

The LCD instruction set looks very similar (if not identical). It looks like it basically has a built-in I2C/parallel conversion.

Whereas the existing drivers are all assuming an external i2c-gpio expander chip. This LCD will need a different HAL layer.

The datasheet doesn't give any examples of sending i2c commands to the device, so you'd probably have to figure out what's happening by looking at their arduino code.

davehylands commented 3 years ago

I noticed that there is a pyb_i2c_grove_rgb_lcd.py (the HAL layer) and pyb_i2c_grove_rgb_lcd_test.py (a test program), and I found a Grove-LCD RGB backlight in my grove parts. I was able to hook it up to my pyboard and get it to work. I had to power the Grove board using 5V (the backlight worked with 3.3v but not the LCD itself).

I noticed that the contrast was little poor powering the LCD using V+ on the pyboard. Apparently the LCD really wants 5v and V+ is only 4.3v. When I powered it using VBUS (which I measured at 5.1v) then the contrast was much better.

davehylands commented 3 years ago

Note that if you're not using an STM based product then you may need to use level converters. The STM devices have 5v tolerant inputs. The RPi Pico and ESP products do NOT have 5v tolerant inputs and would require the use of level converters.

dsssssssss9 commented 3 years ago

sorry for the delay in replying!

I will give this a go next few days

appreciate the help!