PDA

View Full Version : LCD_LINES Question Help ?



andybarrett1
- 23rd May 2017, 09:03
Thank you for reading

Quick Question to confirm...

"Set number of lines on LCD
DEFINE LCD_LINES 2 "

Does the above mean define 2 line display

or

DEFINE LCD_LINES 1 (2 Line Display)
DEFINE LCD_LINES 2 (4 LINE Display)

Manual is not clear.... Various info around internet ?

BR
Andy

Scampy
- 23rd May 2017, 10:18
Andy, this is the routine I use for a 4 line LCD on my EasyPIC5 board



DEFINE LCD_DREG PORTB ' LCD Data port
DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4)
DEFINE LCD_EREG PORTB ' LCD Enable port
DEFINE LCD_EBIT 5 ' Enable bit (on EasyPIC 5 LCD)
DEFINE LCD_RSREG PORTB ' LCD Register Select port
DEFINE LCD_RSBIT 4 ' Register Select bit (on EasyPIC 5 LCD)
DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 4 ' number of lines on LCD
DEFINE LCD_COMMANDUS 2000 ' Command delay time in us
DEFINE LCD_DATAUS 50 ' Data delay time in us


http://micro-heli.co.uk/lcd.jpg


If you have a 2 x 16 or 2 x 20 LCD then change the DEFINE LCD_LINES 4 to DEFINE LCD_LINES 2

andybarrett1
- 23rd May 2017, 12:45
Hi Scampy

So for 2 lines ........LCD_LINES 2

Thank you

Andy

Scampy
- 24th May 2017, 10:09
Hi Andy,

That's correct.