I downloaded you code and took a quick look.
I'm going to assume you're using winAVR and ATMEGA16.
I do not see any conversion from raw data to ASCII routines.
If you have a ADC value stored in a variable "unsigned char adcvalue" and you send the raw data through the UART without first converting to ASCII characters, you will get gibberish at the other end.
Here's why, an unsigned char can have a value range of 0 to 255, while an ASCII character has the same range, only values between 32 to 126 are used to represent a normal SINGLE character:
Therefore, you must convert your raw data (number) to a string of characters (ASCII) before you send the value through the UART.
Assume you have a adcvalue of 134, this would be converted to a character array msg: msg[0] = '1', msg[1] = '3', msg[2] = '4', msg[3]= '\0'.
The quickest and easiest way to do this conversion, if your compiler has it implemented in it's Standard C Library, is use the sprintf() in stdio.h.
Code:
example: sprintf(msg, "%d", adcvalue);
You can build an entire message using sprintf() if you make your message buffer long enough:
Code:
char msg[20];
unsigned char adcvalues[10];
// Load adcvalues with 10 adc readings
for(i=0; i<10; i++)
{
sprintf(msg, "ADC%d = %d/n", i, adcvalue[i]);
sendmsg(msg); //send to UART, SMS, etc
}
Would result in output as such:
ADC0 = 56
ADC1 = 134
ADC2 = 45
ADC3 = 236
...
...
Hope the info helps, let me know after adding conversion routines if you're still having problems.