When LCD is working in 4 bit mode, then data has to be sent by nibbles – portions of 4 bits. Just remember that first goes high nibble then follows lower one. Each nibble has to be strobed with control signal E separately. Following list is describing how to start LCD in 4 bit mode:
- Wait for 15 ms after power is switched on;
- Write 00000011 (0x03) to LCD;
- Wait for 5 ms;
- Write 00000011 (0x03) to LCD;
- Wait for 160 us;
- Write 00000011 (0x03) to LCD;
- Wait for 160 us;
- Write 00000010 to enable 4 bit mode (after this command start sending in nibbles);
- Set interface length;
- Turn off display (0x00 and 0x08 nibbles);
- Write 00000001 (0x00 and 0x01 in nibbles) to clear display;
- Set cursor move direction by setting cursor bits;
- Enable display;
After initialization is complete you may write any character or command to it.
nice