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

Redirectable PINs and UART

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



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

Redirectable PINs and UART
PostPosted: Wed Jun 15, 2011 12:41 pm     Reply with quote

Thinking out loud! Can you redirect the pins of a UART on PICs such as the PIC18F27J13 in software? I.E. Can you change the function of the pins on the fly in code, it would be nice to redirect the TX of a hardware UART to different pins for a project I am thinking of!
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Re: Redirectable PINs and UART
PostPosted: Wed Jun 15, 2011 5:16 pm     Reply with quote

Will Reeve wrote:
Thinking out loud! Can you redirect the pins of a UART on PICs such as the PIC18F27J13 in software? I.E. Can you change the function of the pins on the fly in code, it would be nice to redirect the TX of a hardware UART to different pins for a project I am thinking of!


If you are talking about the Peripheral Pin Select, then the answer is "yes".

But you'll need code to change it on-demand like that -- which isn't hard, but I vaguely remember #pin_select didn't play well mid-stream code. (It's good for start up)

I would experiment. Maybe that's changed -- or maybe someone else has some suggestions.

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jun 15, 2011 11:16 pm     Reply with quote

By it's preprocessor command nature, the #pin_select statements work only at start-up. To change the pin allocation during run-time, you have to write to the respective peripheral pin-select registers directly.
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