I am trying to get analog data from AN0, convert it and send through rs232.
My circuit is working fine and simulations return as expected.
My only problem is that when I start the circuit, hyperterminal displays weird chars. I know hyperterm is not suppose to view binary data thats where I am stuck.
My code is ;
Code: Select all
short temp_res ;
char buf[4];
void main() {
Usart_Init(19200);
ADCON1 = 0;
TRISA = 0xFF;
do {
temp_res = ADC_Read(0) >> 2 ;
IntToStr(temp_res, buf);
Usart_Write(buf);
Delay_ms(100);
} while (1);
}
oooooooooooooooooooooooooooooo
My input is 2-4V AC, circuit and everything is fine except this.
How can I view meaningful stuff in hyperterm ?
Thank you!