printf

I have been using the printf function to debug, but recently I tried to run it via hyperterminal and several other terminal programs. I am wondering what additional formatting, &c. is done to the data before it reaches the RS-232 port. That is to say, if I:

unsigned long data; 
data = 0xdeadface;

and then:


printf("%08x",(long)data); 

The output at the terminal emulator is not “deadface”, nor is it Þ-úI the ASCII equvalent of 0xdeadface. I note that the “%c” command is not Kosher, so how would one send hex data?

**You need to add a “\r” (carriage return) in your print statement as shown below:


printf("%08x\r",(long)data); 

**


Ricky Torrance
Electrical Engineer
VexLABS