Hi,
Wonder if anyone has code sample or kow how to setup
for this LCD 4x20 HD44780.
Thanks
Lee
Hi,
Wonder if anyone has code sample or kow how to setup
for this LCD 4x20 HD44780.
Thanks
Lee
Hi,
You connect the LCD as any other like the 2x16. Read your PBP manual. If still unclear post specific queries. Here is a sample LCD defination :
Code:'LCD DEFINATION***************************************************************** DEFINE LCD_DREG PORTD ' Set LCD Data port DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus i.e, PortD.4-PORTD.7 DEFINE LCD_RSREG PORTB ' Set LCD Register Select port DEFINE LCD_RSBIT 0 ' Set LCD Register Select bit i.e, PORTC.5 DEFINE LCD_EREG PORTB ' Set LCD Enable port DEFINE LCD_EBIT 1 ' Set LCD Enable bit i.e, PORTE.4 DEFINE LCD_BITS 4 ' Set LCD bus size ot 4 bit Upper Nibble (4 or 8 bits) DEFINE LCD_LINES 4 ' Set number of lines on LCD to 4 Lines DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us DEFINE LCD_DATAUS 50 ' Set data delay time in us '*******************************************************************************
Regards
Sougata
Only one problem with the previous post, picbasic doesn't support LCDOut or any of the defines. You would need to upgrade to PRO to do it this way. That being said you may want do a little searching here or on the web. BasicStamp LCD routines should work fine for what you are doing.
Thanks for your reply.
I'm using PBPro version. When I watch carefully to the LCD, I got
the display output, but it is very blur and almost invisible.
Only viewable from a certain angle. I already adjusted the pot for
the contrast pin from 0-5 Vdc, 0 Vdc still the best, but still
unreadable. Wish there are more space to turn the pot beyond the
pot.
Wonder if there is any type of LCD that need negative voltage
at the contrast pin ?
In fact, I got 2 x 16 LCD, and they all work find with the code,
only the 4 x 20 LCD that has contrast problem.
Thanks
Hi,
Try using a negative supply. If you are using a Centre tapped transformer then you may derive it from there. An onboard Hardware PWM with a diode-cap charge pump can do the same. MAX232 has an onboard charge pump (-12V) available on its VEE pin. So a little experimentation would solve your problem
Regards
Sougata
Recently I bought two Hantronix HDM16216-B LCD's. I got the same results as you did. Needed a negative contrast voltage.
If your PIC has a spare unused PWM output, you can easily create a (software variable) negative voltage and drive your LCD contrast from that directly. The added bonus is that by varying the duty cycle, you have full software adjustable contrast.
Bookmarks