Hi,
I'm struggling with the interface to a 16x2 blue LCD display that I'd like to drive from pyboard.
This is where I got it:
http://www.taydaelectronics.com/lcd-dis ... light.html
This is the only datasheet I could find:
http://www.taydaelectronics.com/datasheets/A-1748.pdf
Here is some arduino code using the Liquid Crystal lib:
http://onyxibex.com/2013/02/lcd-1602d1/
I am really at a loss as to how to approach this problem, any ideas would be very welcome!
Cheers,
Bob
pyboard driving a HXF1602D1 LCD display
-
- Posts: 149
- Joined: Sun Mar 01, 2015 12:10 pm
Re: pyboard driving a HXF1602D1 LCD display
I put together a library in python for driving those types of LCDs. You can find it over here:
https://github.com/dhylands/python_lcd
You'll need these 2 files:
https://github.com/dhylands/python_lcd/ ... lcd/lcd.py
https://github.com/dhylands/python_lcd/ ... pio_lcd.py
and this file is a test file which explains how things are wired up. Note that the way you wire it up is rather arbitrary. You'll need 6 GPIO pins from the pyboard to use the LCD in 4-bit mode.
https://github.com/dhylands/python_lcd/ ... cd_test.py
And I was using a 4x20, so you'll want to change num_lines and num_columns to match your LCD.
https://github.com/dhylands/python_lcd
You'll need these 2 files:
https://github.com/dhylands/python_lcd/ ... lcd/lcd.py
https://github.com/dhylands/python_lcd/ ... pio_lcd.py
and this file is a test file which explains how things are wired up. Note that the way you wire it up is rather arbitrary. You'll need 6 GPIO pins from the pyboard to use the LCD in 4-bit mode.
https://github.com/dhylands/python_lcd/ ... cd_test.py
And I was using a 4x20, so you'll want to change num_lines and num_columns to match your LCD.
-
- Posts: 149
- Joined: Sun Mar 01, 2015 12:10 pm
Re: pyboard driving a HXF1602D1 LCD display
Hey thanks!
I just wrote to you via email as well since I saw your youtube!
That is just what I needed!!!
I'm guessing that I can use any pins I have available, right?
Thanks so much for your help!!!
Ciao,
Bob
I just wrote to you via email as well since I saw your youtube!
That is just what I needed!!!
I'm guessing that I can use any pins I have available, right?
Thanks so much for your help!!!
Ciao,
Bob
Re: pyboard driving a HXF1602D1 LCD display
Yeah - pretty much any spare pins will work. Just make sure that the pins you actually use match up with what you pass into the GpioLcd constructor.
-
- Posts: 149
- Joined: Sun Mar 01, 2015 12:10 pm
Re: pyboard driving a HXF1602D1 LCD display
Man, you saved my life!
Do you know if that lcd can do reverse video easily or does it have to be hand tweaked?
Do you know if that lcd can do reverse video easily or does it have to be hand tweaked?
Re: pyboard driving a HXF1602D1 LCD display
You mean inverse (change from white on black to black on white)? I don't think that those LCDs support that at all.
Some of the LCDs support custom letters which you can upload and display, but I've never tried to do that (and there is no direct support for that in my code). It looks like there are 4 or 8 programmable characters from a quick glance through the datasheet.
I see that your LCD uses the ST7066 driver chip, and sparkfun has a datasheet available here: https://www.sparkfun.com/datasheets/LCD/st7066.pdf
Some of the LCDs support custom letters which you can upload and display, but I've never tried to do that (and there is no direct support for that in my code). It looks like there are 4 or 8 programmable characters from a quick glance through the datasheet.
I see that your LCD uses the ST7066 driver chip, and sparkfun has a datasheet available here: https://www.sparkfun.com/datasheets/LCD/st7066.pdf
-
- Posts: 149
- Joined: Sun Mar 01, 2015 12:10 pm
Re: pyboard driving a HXF1602D1 LCD display
Thanks again!
That datasheet looks interesting!
At last some real info that I can use...
I hadn't seen that.
Cheers!
Bob
That datasheet looks interesting!
At last some real info that I can use...
I hadn't seen that.
Cheers!
Bob