I’m using a MCU ATmega16A and I have try with ATmega32A.
My LCD it is a character display 2 lines x 20 characters.
The LCD controller it is: Sunplus SPLC780.
Long time I didn’t have any problem. Since I decide to change the PORTD to the PORTA for the LCD 8-bit Data-Bus. The whole program remains intact except the definition for the Ports I use.
As long I use the PORTD for the Data-Bus of the LCD it is still function normally by using the EN, RS & RW signals at the PORTA or PORTB or PORTC without any problem.
The problem I encounter it is the characters are mispositioning or I can say skipping some characters to be displayed at the screen.
Using my debugger JTAG ICE MKII, and do step by step my code I found everything working properly and all the messages on the LCD screen it was ok.
After long time troubleshooting, I make it to work by adding a long delay of 0.75mS before the Enable signal to send the LCD instruction to read LCD busy flag and wait to be clear the busy flag. All the delays have been made according to the datasheet. The Enable pulse width with rise and fail it is 300nS (Datasheet refer Tpw = 230nS + Tr = 20nS + Tf = 20nS).
The MCU it is running an internal oscillator clock of 8MHz. I have tried also an external crystal oscillator of 8 and 16MHz, only at PORTD working all the combination without problem.
I have tried also to use a breadboard and prototyping PCB thinking maybe it is some bad wiring, but I see the same results as I have described above.
And I don’t have a logic analyzer…. To can check what it is actually happen.
Kindly someone advise me I feel so desperate… 5 days now I try everything to find out why happen this.
HAPPY NEW YEAR 2020 EVERYONE!!!