Hello,
What is the code to setup a PIC to drive an LCD in 8-bit mode. In the PicBasic manual it only shows how to change the port the 4 bit mode is on.
Thanks
-Albert
THE BOOK of DT's INTERRUPTS is an
organization of interrupt service
routines and other works written by Darrel Taylor, RIP. Interrupt routines are arranged per Darrel's original list. Darrel Taylor's Instant Interrupts are an extension of the work of Tim Box whom in October of 2002 wrote INT_CTRL.pbp Many of the forum members felt this is a long overdue project. THE BOOK of DT's INTERRUPTS will be a valuable resource and a tribute to Darrel Taylor the "Fanatical Contributor". THE BOOK of DT's INTERRUPTS is located at http://dt.picbasic.co.uk/ |
Hello,
What is the code to setup a PIC to drive an LCD in 8-bit mode. In the PicBasic manual it only shows how to change the port the 4 bit mode is on.
Thanks
-Albert
See manual again (it's all there) and try this:
'Below defines make:
'PortA.0 = enable
'PortA.1 = select
'PortB = the 8 bit bus
'Adjust to meet your needs ...
DEFINE LCD_DREG PORTB ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTA ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 8 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
DEFINE LCD_DATAUS 50 ' Set data delay time in us
Good Luck,
Paul Borgmeier
Salt Lake City, Utah
USA
Bookmarks