#include <18F4550.h>
#fuses HS,NOWDT
#use delay(clock=20MHz)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,BRGH1OK,STOP=1)
void main()
{
char c;
set_tris_c(0xBF);
clear_interrupt(INT_RDA);
enable_interrupts(GLOBAL);
enable_interrupts(INT_RDA);
while(TRUE)
{
c=getc(); //if getc() timeouts 0 is returned to c
putc(c);
}
}
This is my program which gives..
this following o/p on hyper terminal.in echo mode in hyperterminal ..
dD ddddddffffffaybzaybzddeettyyzzayayaybzbzbzc{
where in
most characters are correctly transmitted and rceived like d e f etc but definite charates like a , b ,c which are converted to definite wrong characters like
a is transmitted but receeived is y similarly b----> z c----> { everytime
point to be noted is
a=97 0110 0001 in ascii
y=121 0111 1001
b = 98 0110 0010
z=122 0111 1010
similar for c------>{
Please reply , I have tried for hours but not able to come out why there is problem with definite few characters ...
they only come wrong everytime....It doesnt seem to be a framing error as a,b,c might be transmitted at any time they have to come out wrong only that too definite wrong output ......pl help