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

HW UART, Disable TX pin?

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



Joined: 03 Jun 2005
Posts: 21

View user's profile Send private message

HW UART, Disable TX pin?
PostPosted: Sun Oct 28, 2012 11:06 pm     Reply with quote

Is it possible to disable/float the transmit pin of the HW UART?

Essentially, I only want the PIC to listen to the RS232 bus but not be able to affect the current bus transmissions. (Obviously the easiest thing to do is just physically not connect the pin, but I am trying to implement a software solution!)

I tried the #use RS232(FLOAT_HIGH, ....) option but that does not work with the HW UART.
Ttelmah



Joined: 11 Mar 2010
Posts: 19536

View user's profile Send private message

PostPosted: Mon Oct 29, 2012 2:03 am     Reply with quote

The solution has been posted here before.
What you do is enable the hardware UART 'as normal', then add to your code:
Code:

#bit TXEN=getenv("BIT:TXEN")

//Then just

TXEN=FALSE;
//will turn off just the transmit side of the UART


You can then use the pin as normal.
The compiler won't actually add the transmit 'code' to your software unless you perform a putc (or something else that uses this like printf), so the overhead is tiny.

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