| Online Development Notebook > Index > ODN > USBm DLL Programming > Device Commands > InitLCD |
InitLCD
Description:
This is a USBm.dll function that initializes LCD variables. This includes the selection of the lines used for RW, RS, E and the port used for data. RW, RS, and E are reset. These commands are appropriate for HD44780 devices and devices that are compatible.
Command Syntax: (USBm.dll)
USBm_InitLCD(device, sel, port)
The USBm_InitLCD function syntax has these parts:
| Part | Description |
| device | A zero-based index to address the appropriate USB device. |
| sel | Selection of the RW line in the higher nibble, and the RS line in the lower nibble. |
| port | Selection of the LCD data port in the higher nibble, and the E line in the lower nibble. A value of 0-h is port A, a value of 1-h is port B. |
Remarks:
Bit⁄Line Selection
| Byte Value | Result | Byte Value | Result | |
| 00h | Affect A.0 | 08h | Affect B.0 | |
| 01h | Affect A.1 | 09h | Affect B.1 | |
| 02h | Affect A.2 | 0Ah | Affect B.2 | |
| 03h | Affect A.3 | 0Bh | Affect B.3 | |
| 04h | Affect A.4 | 0Ch | Affect B.4 | |
| 05h | Affect A.5 | 0Dh | Affect B.5 | |
| 06h | Affect A.6 | 0Eh | Affect B.6 | |
| 07h | Affect A.7 | 0Fh | Affect B.7 |
VB Declaration
| Public Declare Function USBm_InitLCD _ Lib "USBm.dll" _ (ByVal device As Byte, _ ByVal sel As Byte, _ ByVal port As Byte) _ As Integer |
VB Example
| USBm_InitLCD 2, &H89, &H0A |
This code fragment will select port A for the data lines to the LCD, B.0 for the RW line, B.1 for the RS line, and B.2 for the E line.
C Example
-TBD-
| Hardware: U401 USB Interface U421 USB Interface |
| Programming: USBm DLL Programming Download Files |
| Application Notes: U4x1 Application Notes Misc Applications and Information FAQ |