adnan_merter
Full Member level 3
- Joined
- Jan 23, 2008
- Messages
- 160
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 1,298
- Location
- The most beautiful city of the world
- Activity points
- 2,526
hi,
i am trying to establish rs232 connection but something strange is happening here,
this code works but i receive junk characters, my baudrate and my osc setttings are correct, my clock rate is 48Mhz
but when i give some time to pic like,
the code perfectly works, so my question is "why pic needs some time to process rs232, and how can i eliminate this delay?"
i am trying to establish rs232 connection but something strange is happening here,
Code:
#use rs232(baud=9600,parity=N,xmit=PIN_A0,rcv=PIN_A1,bits=8, stop=1,invert)
void main()
{
char a;
while(1){
a=getc();
putc(a);
}
}
this code works but i receive junk characters, my baudrate and my osc setttings are correct, my clock rate is 48Mhz
but when i give some time to pic like,
Code:
#use rs232(baud=9600,parity=N,xmit=PIN_A0,rcv=PIN_A1,bits=8, stop=1,invert)
void main()
{
char a;
while(1){
a=getc();
[B]delay_us(10);[/B]
putc(a);
}
}
the code perfectly works, so my question is "why pic needs some time to process rs232, and how can i eliminate this delay?"