hyperterminal error

Thread Starter

thorwendel

Joined Oct 5, 2012
2
i have my interfacing for PIC16F877a, i'm using C programming, when i view my output on hyperterminal it shows some special characters, what's wrong with this?? please help..
 

djsfantasi

Joined Apr 11, 2010
9,237
Probably because the output from the PIC is sending binary or control characters to hyperterminal. If a non-ASCII or non-printable character is sent to hyperterminal, special characters will be displayed that will look "junky". For example, a byte with a decimal value of 175 (or hex AF or binary 1010 1111) is sent - hyperterminal will display a » on the screen.

By binary or control character, I mean somethng outside the ASCI printable characater set. Those in the ASCI printable character set are codes/bytes of value within 20hex to 7Ehex. (decimal 32 to 126) They represent letters, digits, punctuation marks, and a few miscellaneous symbols. There are 95 printable characters in total.

You may have to format all of your output to a string value before sending it to hyperterminal.
 

Thread Starter

thorwendel

Joined Oct 5, 2012
2
thanks! can you check my codes??

Rich (BB code):
int adc_rd; 
char txt1[10], txt2[10], txt3[10], txt4[10]; 
 
 void main() { 
 
ADCON1 = 0; 
TRISA =0xFF; 
 
UART1_Init(9600); 
Delay_ms(100); 
 
while(1){ 
adc_rd=ADC_Read(0); 
IntToStr(adc_rd, txt1); 
Delay_ms(2); 
adc_rd=ADC_Read(1); 
IntToStr(adc_rd, txt2); 
Delay_ms(2); 
adc_rd=ADC_Read(2); 
IntToStr(adc_rd, txt3); 
Delay_ms(2); 
adc_rd=ADC_Read(3); 
IntToStr(adc_rd, txt4); 
UART1_Write('A'); 
UART1_Write(','); 
UART1_Write_Text(txt1); 
UART1_Write(','); 
UART1_Write_Text(txt2); 
UART1_Write(','); 
UART1_Write_Text(txt3); 
UART1_Write(','); 
UART1_Write_Text(txt4); 
UART1_Write(','); 
  
Delay_ms(1000); 
}
}
 
Last edited by a moderator:
Top