View previous topic :: View next topic |
Author |
Message |
pvol
Joined: 10 Oct 2008 Posts: 46 Location: GREECE
|
change pins TX/RX |
Posted: Sat Dec 20, 2008 3:04 am |
|
|
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
|
|
Posted: Sat Dec 20, 2008 4:36 am |
|
|
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
|
|
Posted: Sat Dec 20, 2008 7:56 am |
|
|
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
|
perhaps a razor knife and rework wire is the answer |
Posted: Sat Dec 20, 2008 9:41 am |
|
|
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. |
|
|
|