View previous topic :: View next topic |
Author |
Message |
bchicta
Joined: 07 Mar 2012 Posts: 1
|
PIC16F877 |
Posted: Tue May 15, 2012 8:36 am |
|
|
Dans la PIC16F877, il y a un seul USART donc une seul connexion RS232 (pins C6 et C7 du port C), mais dans mon projet j'ai besoin des plusieurs connexion RS232. De manière Soft, comment peut programmer cette connexion à l'aide des autres pins normaux ?
Translation to English:
In the PIC16F877, there is one USART therefore a single RS232 connection (pins C6 and C7 of the port C), but in my project I need several RS232 connections. So in software, how can I program these connection using other normal i/o pins? |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue May 15, 2012 9:08 am |
|
|
Do the serial ports all have to operate asynchronously
or could you multiplex and use one port at a time? |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue May 15, 2012 10:35 am |
|
|
What sort of baud rates are you wanting for the other UARTS?
Mike |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Wed May 16, 2012 10:02 am |
|
|
Key questions are how many serial ports do you need, how fast must they run, and (most critical) will they potentially all transmit asynchronously? The most difficult operation is receiving data on multiple incoming ports at the same time. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu May 17, 2012 8:21 am |
|
|
Lastly as to the maximum COUNT of software UARTS that is safe and reliable to deploy?
In my experience the answer is ZERO. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 17, 2012 12:51 pm |
|
|
That's referring to CCS soft UARTs, I assume. What about interrupt-
driven soft uarts, that sample each bit, 3 or more times per bit, in a
Timer interrrupt routine ? |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Thu May 17, 2012 1:44 pm |
|
|
That was my point. At 115200 baud, it's not too likely. At 9600, there's a possibility.
People asking for advice on boards like this always take care to leave out the important information. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
ZERO UARTS of the CCS soft variety |
Posted: Thu May 17, 2012 2:41 pm |
|
|
I have been happy with dual hardware UARTS IN a PIC
but never felt safe with soft uarts, even when interrupt driven.
Perhaps with a 40 mhz or greater Fosc and timer based bit testing , MAYBE then, ......
but it is not worth it to risk a commercial product and my reputation with flaky data handling, which is what I feel soft UARTS represent.
And adding multiple interrupts to the program just ups the soft uart risk.
But for a SOLID 8 channels of 115200 baud ????
I would rather put the effort into a design based on the Philips SCC2698B
parallel mated to an 18f872x @ 40 MHz.
In THAT approach- I would have total confidence, since you have a total of 10 UARTS, all interrupt capable, and the SCC chip ports, all deeply buffered, and a controller PIC possessing enough ram && MIPS, to process the data you receive.
soft uarts are a hobbyist grade concept, but
NOT IMHO, for any product of any kind, unless perhaps @ 300 baud . |
|
|
|