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

change pins TX/RX

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



Joined: 10 Oct 2008
Posts: 46
Location: GREECE

View user's profile Send private message

change pins TX/RX
PostPosted: Sat Dec 20, 2008 3:04 am     Reply with quote

Hello everybody

I wonder if I could change pins of tx/rx on 18f4620.
For example:
Code:
#use RS232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

change to
Code:
#use RS232(baud=9600, xmit=PIN_A0, rcv=PIN_A1)

Is it possible to do this?
Will it work?
vijay s



Joined: 20 Oct 2007
Posts: 17
Location: coimbatore,india

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

PostPosted: Sat Dec 20, 2008 4:36 am     Reply with quote

To make this PIN work as UART you have to use FORCE_SW in #use rs232.
it will generate software UART routines for the specified Pin.
_________________
with regards
vijay s
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Dec 20, 2008 7:56 am     Reply with quote

The hardware UART cannot be moved from C6/C7. If you change either one of those pins (or even if you swap TX and RX) in the USE RS232 command line, the compiler will automatically generate a software UART and the hardware UART will be disabled. It should not be necessary to use the FORCE_SW switch in the command line.

One word of caution. Using a sofware UART could be a problem if you are usings any non-UART interrupts. An interrupt from an ADC, for example, can interfere with a software UART and affect transmission or reception.


Last edited by dyeatman on Sat Dec 20, 2008 2:40 pm; edited 1 time in total
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

perhaps a razor knife and rework wire is the answer
PostPosted: Sat Dec 20, 2008 9:41 am     Reply with quote

if this question was generated because of a PCB layout error
the real solution is a razor knife - and some Kynar or fine teflon rework wiring to get the correct wiring to the hardware UART - the hardware uart is your friend in all circumstances - the software uart is strictly for the desperate. Very Happy
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