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 support@ccsinfo.com

Using R6 and R7 for I/O and Serial UART?

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








Using R6 and R7 for I/O and Serial UART?
PostPosted: Fri Dec 02, 2005 10:43 am     Reply with quote

Hi,
I am using the #use rs232 function with the hardware uart on a PIC18F series. However I can't then use output_low(PIN_C7) to drive pin c7 low. I only need to use the rs232 a certain parts of the program. I seem to remember a way to switch the #use directive on/off as required? Can't find it in the manual. Any ideas?
TTelmah
Guest







PostPosted: Fri Dec 02, 2005 11:24 am     Reply with quote

I think the easiest for what you describe, would be just to turn the peripheral off. So:
Code:

#bit SPEN=0xFAB.7

//Then to use the RS232:
SPEN=TRUE;
printf("TEST");

//Then to set C7 low
SPEN=FALSE;
output_low(PIN_C7);


The problem is that the peripheral enable, overrides the pin's output drive, so though the output is still 'commanded', the peripheal override prevents the pin from being driven.

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