Control I/O pin definitions
RW_PIN PORTxbits.Rx?
TRIS_RW TRISxbits.Rx?
RS_PIN PORTxbits.Rx?
TRIS_RS TRISxbits.Rx?
E_PIN PORTxbits.Rx?
TRIS_E TRISxbits.Rx?
where x is the PORT, and ? is the pin number.
Data pin definitions
DATA_PIN_? PORTxbits.RD?
TRIS_DATA_PIN_? TRISxbits.TRISD?
where x is the PORT, ? is the pin number
The Data pins can be from either one port or from multiple ports. The control pins can be on any port and are not required to be on the same port. The data interface must be defined as either 4-bit or 8-bit.
The 8-bit interface is defined when a
#define EIGHT_BIT_INTERFACE is included in the header file xlcd.h. If no define is included, then the 4-bit interface is included. After these definitions have been made, the user must compile the application code into an object to be linked.
This function also requires three external routines for specific delays:
DelayFor18TCY() 18 Tcy delay
DelayPORXLCD() 15ms delay
DelayXLCD() 5ms delay
Delay100XLCD() 100Tcy delay