I am using Keil uVision to program my microcontrollers. Using the Keil uLink.
I found the example for LCD code on the olimex site but it isn’t made for Keil so I did rewrite it so I can use it with Keil.
I can get a blinking cursor on it… but I can’t get any characters on it. When I write A… he moves down a line and put in a space… if I write a the cursor just disappears. Here is my code for writing characters can someone help me out?
void LCDSendChar(unsigned long a)
{
delay(4000); //delay for LCD char ~2ms
data = 0x0;
data = 0xffffff0f | a; //get high 4 bits
pGIO->GIOA.GIODOUT &= 0xffffff0f; //clear D4-D7
//data = data << 16;
pGIO->GIOA.GIODOUT = (pGIO->GIOA.GIODOUT | 0x000000f0) & data; //set D4-D7
pGIO->GIOB.GIODOUT = 0x02; //set RS port to 1 -> display set to char mode
E_Pulse(); //pulse to set d4-d7 bits
// clear data and shift data to get low 4 bytes :-)
data = 0x0;
a = a<<4;
data = 0xffffff0f | a; //get high 4 bits
pGIO->GIOA.GIODOUT &= 0xffffff0f; //clear D4-D7
//data = data << 16;
pGIO->GIOA.GIODOUT = (pGIO->GIOA.GIODOUT | 0x000000f0) & data; //set D4-D7
pGIO->GIOB.GIODOUT = 0x02; //set RS port to 1 -> display set to char mode
E_Pulse(); //pulse to set d4-d7 bits
}
I did use E_Pulse also to init the LCD so I guess that one is allright. Also LCDSendCommand seems to working because putting in spaces and a blinking cursor works.