I'm running a LabX1 with PIC 16F887. The schematic shows 8 data lines connected to port D of the MCU and the sample routines I have been using have the following defines:
DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
The PBPro3 manual has an example with an LCD using only 4 bits D4-D7 using the "default values" of DEFINE LCD_DBIT 0 with the comment 'Set starting data bit (0 or 4) if 4-bit bus.
Q.1 So I'm confused. It appears if you use 8 lines (LabX1) you DEFINE LCD_DBIT 4 but if you only have 4 lines (example in book) you DEFINE LCD_DBIT 0. Isn't this backwards?
I want to use an LCD with a 16F88 and I may not have enough ports to use 8 data lines.
Q.2 The PBPro3 manual also has a define for LCD bus size called "LCD_BITS" which should be set to 4 or 8 depending on the # of bits used and for the book example is set "correctly" to 4. This DEFINE is not in the LabX1 routines. Does it default to 8 bits?
Bookmarks