BV4218 I2C LCD & Keypad Controller

bv4218 pcb

Version 2 has an optional buffered interface.

The BV4218 is designed to be attached to a standard LCD character display supporting the HD44780 or similar controller. In addition to that it can also read a 12 x 3 (or less) keypad. All of this is controlled through the I2C interface. The advantage of using this device is that all the software for driving the LCD and reading the keypad is done and also there is no impact on the ports of the host microcontroller.

The buffered controller has an 82P715 I2C buffer fitted and the appropriate pull up resistors. If another 82P715 is used at the other end the I2C bus can be extended for up to 30m!

Full details on how to use the device are given in the datasheet in the downloads section, There are also some code examples for Forth and PIC32-Basic.

FAQ:

One frequently asked question when using this controller is how do you display characters on the LCD display on a particular line. To find this out the data sheet for the HD44780 can be consulted but for most displays up to 4 lines the following command should be sent:

Line 1    0x80
Line 2    0xc0
Line 3    0x94
Line 4    0xd4

The following code snippet from PIC32_Basic shows how to handle this. If you ignore line 17 the case statement will set 'd' to one of 4 values plus 'pos'. As an example if you want to display something on line 3 at position 5 (5 characters along from the left hand side) the 'd' will be set to 0x94+5 which is 0x99. This when sent as a command (not data) will position the cursor to the desired postion.