converting the LCD to 4-bit mode

As mentioned previously, the LCD can be used in a 4-bit mode. There are advantages and disadvantages, when compared to the 8-bit mode that it is currently operating in! One of the advantages is that it uses 4 data lines, which means 4 of the lines of one of the peripheral ports of the 6522 will be freed. This is valuable and the main reason for me venturing down the path of 4-bit mode. The disadvantages are that I will need to make modifications to the circuitry, rewrite portions of the code and the code will run slower than previously! However, I think that the 4 output pins that it will free up make this worth it!

Looking at the datasheet (figure 1) for the HD44780U, DB0 – DB3 are the four data bus pins that are not used when operating in 4-bit mode (these pins actually become disabled). DB4 – DB7 are the 4 data bus pins that will be used.

using the LCD driver module HD44780U in 4-bit mode
figure 1. using the HD44780U in 4-bit mode

To be able to achieve sending 8-bits of the data to the HD44780U, the data will be sent as two 4-bit operations. The order of the data transfer is important, the four high-order bits are sent first, followed by the four low-order bits.