View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
How to set states of pins in an software USART |
Posted: Fri Jun 24, 2005 5:19 am |
|
|
Hi,
Compiler: PCM
MCU : 16F877
I have setup a software USART on pins D4, D5 of PIC 16F877. The pins are connected to the Rxd and Txd pins of a 16F628.
Kindly advise what should be the state of the pins, High, low or float.
I am currently using float I find that most of the times data is not sent at all although the pin state changes to high ( both pins). Ins pite of this I can see no pulses on my scope.
But please remember communication takes place some times.
thanks
arunb |
|
|
Ttelmah Guest
|
|
Posted: Fri Jun 24, 2005 5:44 am |
|
|
The transmit pin should be left high when not sending. Otherwise the receiver will not reliably see the 'start bit', which is a low.
Best Wishes |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Sat Jun 25, 2005 3:30 am |
|
|
Hello,
Thanks for the reply.
Does the software USART do this autmatically ( making Txd high after transmission) ?? or do I have to do it ???
What about Rxd ???
thanks
arunb |
|
|
Guest
|
Re: How to set states of pins in an software USART |
Posted: Sat Jun 25, 2005 3:34 am |
|
|
arunb wrote: | Hi,
Compiler: PCM
MCU : 16F877
I have setup a software USART on pins D4, D5 of PIC 16F877. The pins are connected to the Rxd and Txd pins of a 16F628.
Kindly advise what should be the state of the pins, High, low or float.
I am currently using float I find that most of the times data is not sent at all although the pin state changes to high ( both pins). Ins pite of this I can see no pulses on my scope.
But please remember communication takes place some times.
thanks
arunb |
just place in your code #use rs232 directive and you did not worry of the state of the Rx and Tx pin of your UART. |
|
|
Ttelmah Guest
|
|
Posted: Sat Jun 25, 2005 5:42 am |
|
|
It is all automatic.
The 'stop' bit, is a high, and the pin is left in this state when the character is finished.
Best Wishes |
|
|
|