Munib said:
well i am not going for any general sensor, i have multiple sensors (temperature, pressure etc) so i cant be specific ,
Well, let say that converting data that sensor gives you, as results a value between 00000000 and 11111111. That is 0x00 - 0xFF, so a range between 0 and 255 decimal.
Let say the value you want to send is 0x7F or 127 decimal.
If you convert 0x7F to ASCII you must send 0x31 then 0x32 then 0x37.
Thus, on hyperterminal PC program you get printed clearly 127 and not a sign for non printable character 0x7F. In your own program you don't have to convert at transmission. Your program will do the job for displaying.
Obvious, the value 0x7F means nothing for your pressure sensor.
I mean 127 decimal could be the middle range for your measurements.
Thus 127 could mean 50 psi from a range between 0 and 100 psi.
Obvious you would want to send 50 instead 127, which seems much closer to the real measure.
But the purpose of the above example is just to give you some ideas.