Alphanumeric (Hitachi HD44780) LCD Print Declares.
Declare LCD_Type = 0 or Alpha or Alphanumeric Informs the compiler as to the type of LCD that the Print command will output to. A value of 0 or Alpha or Alphanumeric, or if the Declare is not issued, will target the standard Hitachi HD44780 alphanumeric LCD type.
Declare LCD_DTPin = Port.Pin Assigns the Port and Pins that the LCD's DT lines will attach to.
The LCD may be connected to the microcontroller using either a 4-bit bus or an 8-bit bus. If an 8-bit bus is used, all 8 bits must be on one port. If a 4-bit bus is used, it must be connected to either the bottom 4 or top 4 bits of one port. For example: -
Declare LCD_DTPin PORTB.4 ' Used for 4-line interface.
Declare LCD_DTPin PORTB.0 ' Used for 8-line interface.
In the above examples, PORTB is only a personal preference. The LCD's DT lines can be attached to any valid port on the microcontroller.
Declare LCD_DataX_Pin = Port.Pin Assigns the individual Ports and Pins that the HD4470 LCD’s DT lines will attach to.
Unlike the above LCD_DTPin declares, the LCD’s data pins can also be attached to any separate port and pin. For example:-
Declare LCD_Data0_Pin PORTA.0 ' Connect PORTA.0 to the LCD’s D0 line
Declare LCD_Data1_Pin PORTA.2 ' Connect PORTA.2 to the LCD’s D1 line
Declare LCD_Data2_Pin PORTA.4 ' Connect PORTA.4 to the LCD’s D2 line
Declare LCD_Data3_Pin PORTB.0 ' Connect PORTB.0 to the LCD’s D3 line
Declare LCD_Data4_Pin PORTB.1 ' Connect PORTB.1 to the LCD’s D4 line
Declare LCD_Data5_Pin PORTB.5 ' Connect PORTB.5 to the LCD’s D5 line
Declare LCD_Data6_Pin PORTC.0 ' Connect PORTC.0 to the LCD’s D6 line
Declare LCD_Data7_Pin PORTC.1 ' Connect PORTC.1 to the LCD’s D7 line
There are no default settings for these Declares and they must be used within the BASIC program if required.
Declare LCD_ENPin = Port.Pin Assigns the Port and Pin that the LCD's EN line will attach to. This also assigns the graphic LCD's EN pin.
Declare LCD_RSPin = Port.Pin Assigns the Port and Pins that the LCD's RS line will attach to. This also assigns the graphic LCD's RS pin.
If the Declare is not used in the program, then the default Port and Pin is PORTB.3.
Declare LCD_Interface = 4 or 8 Inform the compiler as to whether a 4-line or 8-line interface is required by the LCD.
If the Declare is not used in the program, then the default interface is a 4-line type.
Declare LCD_Lines = 1, 2, or 4 Inform the compiler as to how many lines the LCD has.
LCD's come in a range of sizes, the most popular being the 2 line by 16 character types. However, there are 4-line types as well. Simply place the number of lines that the particular LCD has into the declare.
If the Declare is not used in the program, then the default number of lines is 2.
Declare LCD_CommandUs = 1 to 65535 Time to wait (in microseconds) between commands sent to the LCD.
If the Declare is not used in the program, then the default delay is 2000us (2ms).
Declare LCD_DataUs = 1 to 255 Time to wait (in microseconds) between data sent to the LCD.
If the Declare is not used in the program, then the default delay is 50us.

