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

[RESOLVED] How to change the use of Tx I/O during execution?

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



Joined: 12 Sep 2003
Posts: 32
Location: France (Paris)

View user's profile Send private message

[RESOLVED] How to change the use of Tx I/O during execution?
PostPosted: Fri Jan 19, 2007 8:07 am     Reply with quote

Hello,

I am writing a test program for my product and during the test phase, I would like to change the Tx output (Serial communication) into a standard I/O port. Same question for Rx input.
The serial communication has been setup by using the #USE pragma.


thank you for your help.
Franck


Last edited by franckcl on Fri Jan 19, 2007 9:08 am; edited 1 time in total
franckcl



Joined: 12 Sep 2003
Posts: 32
Location: France (Paris)

View user's profile Send private message

PostPosted: Fri Jan 19, 2007 9:06 am     Reply with quote

I have found ! here under the solution:
Code:

bit_clear(RCSTA1,7); // Serial port 1 disabled
bit_clear(RCSTA2,7); // Serial port 2 disabled
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Jan 19, 2007 10:22 am     Reply with quote

I like setup_uart() better than the direct register addressing.

Code:
setup_uart(FALSE, stream)   // disable uart
setup_uart(TRUE, stream)   // enable uart
Stream is an optional stream identifier.

I noticed this command also toggles the RCSTA.CREN (Continuous receive enable) bit which might be an improvement over your code.
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