View previous topic :: View next topic |
Author |
Message |
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
[RESOLVED] How to change the use of Tx I/O during execution? |
Posted: Fri Jan 19, 2007 8:07 am |
|
|
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)
|
|
Posted: Fri Jan 19, 2007 9:06 am |
|
|
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
|
|
Posted: Fri Jan 19, 2007 10:22 am |
|
|
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. |
|
|
|