Re: can someone help me to check the code of my LCD 4 bit co
Hi,
Please note the following:
1. When LED is inited for four bit interfacing, you have to give the commands also as nibbles only.
2. The enable pin has to be toggled even for commands loading.
3. First load the data nibble and then set RS, R/W and finally toggle the EN bit to ensure that the RS and R/W bits which will change during data loading to port are set up to reqired states before toggling EN pin.
4. As per the data sheet I have, the first three data nibbles are 0X02 mostly being the MS nibble of 0x28 the function set command and during this period, the interface works in 8bit mode and LS nibbles are then don't care bits.
5. Next you have to give 0x28 as two nibbles followed by commands for Display ON/OFF, Entry Mode Set and Clear Display and command bytes as two nibbles only.
6. Only after the above sequence, you can send the data byte, again as two nibbles, but setting RS=1.
Please see your user manual once again and correct for above. You can make two subroutines, one each to Write Command and Write Data ,and call them each time after the CMD/Data byte loaded into W register.
Regards,
Laktronics