View previous topic :: View next topic |
Author |
Message |
maxrate
Joined: 01 Jan 2007 Posts: 38 Location: Mississauga, Ontario, Canada
|
Simplex Serial (1 pin) using CCS #use rs232 stream? |
Posted: Sun Sep 27, 2009 6:05 pm |
|
|
Hello, I have a project where I need a couple of USARTs to simply send data from the PIC to a couple of computers (I only need to send, not receive). Is there a way to use the serial library #use rs232 with only a 'xmit' (no rcv) pin? I'm trying to save pins on the PIC as I need as many as the 18F4520 can offer me! thanks everyone. |
|
|
Guest
|
|
Posted: Sun Sep 27, 2009 6:33 pm |
|
|
Hi,
Yes, the compiler will create a software UART for this purpose, and use the pin specified. If you don't specify both a Tx and an RX pin, a software UART is created, but that doesn't seem to be a problem for you!
Chad |
|
|
maxrate
Joined: 01 Jan 2007 Posts: 38 Location: Mississauga, Ontario, Canada
|
|
Posted: Sun Sep 27, 2009 6:44 pm |
|
|
So, if I understand you correctly (and perhaps I'm being overly optimistic), if I don't specify a RX pin when defining a USART, the CCS library will create a simplex (not full duplex) port? I'll have to try that - never thought about trying that. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sun Sep 27, 2009 9:14 pm |
|
|
I would suggest - unless you already committed your C6,C7 pins
AND need a duplex Uart - that you use the hardware UART first.
Be warned - the software RX & TX uarts can receive &&|| transmit trash
easily when interrupted by any other process.
The software UART is NOT a cure all for needing multiple RS_232 ports
as using INTS can and will wreck reliability of the data stream eventually.
ONLY the hardware implemented USART RX/TX is immune. |
|
|
|