I have a problem at the printf() function. I am using AT89C52 chip. and I am sending the data to the serial port. For instance when using the code below,
unsigned char value1,value2,value3,value4,value5;
and data taking from the serial port(rx/tx) like this:
but, data that I need should be like this:
I used all printf function but same problem.
awaiting for your reply
use "%02x%02x" with the printf function.
(printf_tiny does not support field width)
Beaten to it! As frief says, printf("%02x%02x", value1, value2); is the answer.
can I use printf_fast_f() function instead of printf()?
> can I use printf_fast_f() function instead of printf()?
Do you really need floating point???
Your code snippet gives no indications for that.
See section 3.16 about printf in the manual and check which flavour you need.
(or your local copy) would be the authoritative answer.
I'd also consider to continue using printf_tiny() because it is so cute
and write an extra function like puthex(); where you need an output format
that printf_tiny() does not support.
Dear Frieder ,
Yes, you are right. I dont need using printf_fast_f() but when I used printf()function I am getting some message!
?ASlink-Error-Could not get 21 consecutive bytes in internal RAM for area DSEG.
What does it mean?
Does someone know what is the meaning of error below?
?ASlink-Error-Could not get 21 consecutive bytes in internal RAM for area DSEG
this error appear when I used printf() function!!!
It means that printf is larger than printf_tiny and you now have run out of data memory.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.