Driving LCD HD47780 Displays
The BV4108 and BV41208 are both designed to drive LCD displays using the above controller. That is just about every character type display available, typically they come as 16 characters by 2 or 20 characters by 4. They are driven by a very small set of commands. The ByVac interface's can provide those commands directly to the display.
For the purpose of this article I have connected a BV4108 to a 16x2 display and connected them to a BV103 USB to serial convertor. This will allow serial input from a COM port. The same principles apply to the I2C display controller (BV4208) .

Basically the controller is very simple in that it will allow you to send either a command or data to the display. These are the following common commands: (assuming the device address is 'a')
Clear the display: ac1
Write fred to the display adfred
Move to line 2 of the display acc0
Note on a 4 line display, the value of the command (shown as c0 here) will vary and should be found by trial and error. From experience most 4 line by 20 displays are set to: Line 1 (80), Line 2 (c0) Line 3 (94) and Line 4 (d4). So as an example to place a character at the beginning of the third line the command will be:
Move to line 3 ac94
Be warned though that some values will appear to move to the next line but will not allow any text to go in so keep experimenting.
To move to characters within the line simply add the position so to place fred on the second line, 3 characters in add 3 ro c0 to give c3, thus:
Display 'fred' on line 2, 3 characters in acc3 <cr> adfred
For more exotic commands refer to the table below. when the 'd' is used for data, for example when writing 'fred' the RS line is held high, when 'c' is used as in ac1, the RS line is held low. As you can see form this sending ac1 will clear the display because on the command table, '1' is the command for clearing the display. I may be worthwhile experimenting with these command but don't be surprised if you have to reset the display as sending some combinations can stop the display working.
| HD44780 instruction set | |||||||||||
| Code | Description | ||||||||||
| RS | R/W | DB7 | DB6 | DB5 | DB4 | DB3 | DB2 | DB1 | DB0 | ||
| Clear display | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | Clears display and returns cursor to the home position (address 0). |
| Cursor home | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | * | Returns cursor to home position (address 0). Also returns display being shifted to the original position. DDRAM contents remains unchanged. |
| Entry mode set | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | I/D | S | Sets cursor move direction (I/D), specifies to shift the display (S). These operations are performed during data read/write. |
| Display On/Off control | 0 | 0 | 0 | 0 | 0 | 0 | 1 | D | C | B | Sets On/Off of all display (D), cursor On/Off (C) and blink of cursor position character (B). |
| Cursor/display shift | 0 | 0 | 0 | 0 | 0 | 1 | S/C | R/L | * | * | Sets cursor-move or display-shift (S/C), shift direction (R/L). DDRAM contents remains unchanged. |
| Function set | 0 | 0 | 0 | 0 | 1 | DL | N | F | * | * | Sets interface data length (DL), number of display line (N) and character font(F). |
| Set CGRAM address | 0 | 0 | 0 | 1 | CGRAM address | Sets the CGRAM address. CGRAM data is sent and received after this setting. | |||||
| Set DDRAM address | 0 | 0 | 1 | DDRAM address | Sets the DDRAM address. DDRAM data is sent and received after this setting. | ||||||
| Read busy-flag and address counter | 0 | 1 | BF | CGRAM / DDRAM address | Reads Busy-flag (BF) indicating internal operation is being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction). | ||||||
| Write to CGRAM or DDRAM | 1 | 0 | write data | Writes data to CGRAM or DDRAM. | |||||||
| Read from CGRAM or DDRAM | 1 | 1 | read data | Reads data from CGRAM or DDRAM. | |||||||
Command table
| Bit Names | ||
| Bit name | Setting / Status | |
| I/D | 0 = Decrement cursor position | 1 = Increment cursor position |
| S | 0 = No display shift | 1 = Display shift |
| D | 0 = Display off | 1 = Display on |
| C | 0 = Cursor off | 1 = Cursor on |
| B | 0 = Cursor blink off | 1 = Cursor blink on |
| S/C | 0 = Move cursor | 1 = Shift display |
| R/L | 0 = Shift left | 1 = Shift right |
| DL | 0 = 4-bit interface | 1 = 8-bit interface |
| N | 0 = 1/8 or 1/11 Duty (1 line) | 1 = 1/16 Duty (2 lines) |
| F | 0 = 5x7 dots | 1 = 5x10 dots |
| BF | 0 = Can accept instruction | 1 = Internal operation in progress |
