Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The table and diagram show the timing relationship between the various signals and the limits on their timing. You must meet those requirements when you interface other circuits to the IC. Violation of any of the timing requirements may cause the circuit or the interface circuits to not operate correctly.
void lcdSendCommand(unsigned char command )
{
_DATA = command;
RD = 1;
A0 = 1;
CS = 0;
WR = 0;
Delay1TCY(); //180ns Delay (Nop;)
CS = 1;
WR = 1;
A0 = 0;
}
/*********************************************************/
/* send Data to Controller */
/*********************************************************/
void lcdSendData(unsigned char value )
{
_DATA = value;
A0 = 0;
RD = 1;
CS = 0;
WR = 0;
Delay1TCY(); //180ns Delay (Nop;)
CS = 1;
WR = 1;
}
void lcdSendCommand(unsigned char command )
{
GLCD_RD = 1;
GLCD_COMMAND = 1;
GLCD_CS = 0;
GLCD_WR = 0;
GLCD_DATA = command;
Delay1TCY();
GLCD_CS = 1;
GLCD_WR = 1;
GLCD_COMMAND = 0;
}
/*********************************************************/
/* send Data to Controller */
/*********************************************************/
void lcdSendData(unsigned char value )
{
GLCD_RD = 1;
GLCD_COMMAND = 0;
GLCD_CS = 0;
GLCD_WR = 0;
GLCD_DATA = value;
Delay1TCY();
GLCD_CS = 1;
GLCD_WR = 1;
}
Your 180ns delay isn't near long enough. The minimum puls width for WR is 220ns. Call Delay1 at least four times for each transaction. You also need a delay between WR and CS. Right now, you're toggling both at the same time. Also, if you call the function too quickly, you violate min cycle time. Again, calling Delay1 multiple times each transaction will clear that up.