This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why is simulator not equal to real life hardware?

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";

The function to write a single character works fine:
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;
}

Here the function to print a whole string which brings garbage:
void writeText( char *txt  )
{
	while( *txt )
	{
	writeChar(*txt++);
	delay(250);
	}
}

Any help appreciated!

Rolf

0