I'm new to embeded C. I've got a Phytec Philips C552 chip and connected a LCD to it. I've made a simple prg to display char or string. Char works perfectly string brings only garbage. When I run the prg in sim it looks ok to me, on the target hardware not. I've browsed thru the forum and found some threads about STARTUP.A51a nd pointers. I've no idea if this problems applies to me. Here some code fragments of my prg: Just after the <includes> is:
code const char welcome[] = "Hello World";
void writeChar( char dataOut ) { checkBF(); P4 = 0; P4 = _iror_( (dataOut & 0xF0),4 ); RS = 1; E = 1; _nop_(); E = 0; P4 = (dataOut & 0x0F); RS = 1; E = 1; _nop_(); E = 0; }
void writeText( char *txt ) { while( *txt ) { writeChar(*txt++); delay(250); } }