CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to set states of pins in an software USART

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

How to set states of pins in an software USART
PostPosted: Fri Jun 24, 2005 5:19 am     Reply with quote

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







PostPosted: Fri Jun 24, 2005 5:44 am     Reply with quote

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

View user's profile Send private message Send e-mail

RE:
PostPosted: Sat Jun 25, 2005 3:30 am     Reply with quote

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
PostPosted: Sat Jun 25, 2005 3:34 am     Reply with quote

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







PostPosted: Sat Jun 25, 2005 5:42 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group