View previous topic :: View next topic |
Author |
Message |
angel
Joined: 19 Oct 2004 Posts: 40
|
number of USART |
Posted: Mon Jan 28, 2008 3:38 am |
|
|
Hello
i would like to know how many USARTs it is possible to implement in a PIC?. For instance a PIC16F877.
Is it possible 6 USARTS?
Thanks for your answer. |
|
![](templates/subSilver/images/spacer.gif) |
SET
Joined: 15 Nov 2005 Posts: 161 Location: Glasgow, UK
|
|
Posted: Mon Jan 28, 2008 7:06 am |
|
|
If your talking about low speed, and transmit only, then 6 would be ok. If receive as well - hmm, much more of a problem. Think instead external UARTs and/or more capable micros. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jan 28, 2008 8:17 am |
|
|
The general name for a serial communications unit is UART. Microchip has several variations on this and calls them UART, USART, EUSART or AUSART. Of these internal hardware units there are 0, 1 or 2 present depending on your chip.
External hardware UARTs can be added using SPI or I2C. Examples are the SC16IS760 and the MAX3100 (I don't like this one, a terrible interface makes it difficult to get the communications reliable) .
Besides the hardware UARTs you can also emulate a UART in software. The CCS compiler can generate an unlimited number of these software UARTs but with two limitations:
- No interrupts are generated.
- Only one soft UART can be active at a time.
Taking care it is possible to combine the hardware UARTS with the software UARTs for simultaneous reception and transmission.
More sophisticated software UARTs can be found on this forum and the internet. Some do support interrupts and/or can be used simultaneously.
Andrew (asmallri) is selling code for several software uarts: http://www.brushelectronics.com/index.php?page=software#SWUART
With the limited information provided it is impossible to say whether 6 UARTs are possible. Do they have to send/receive simultaneously? Single or full duplex? Baud rate? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Mon Jan 28, 2008 9:10 am |
|
|
Internal real USART's. look at the data sheet. For the 16F877, one.
You can implement software "UART's" (not USARTs), and the number of these is limited only by code size. Downside though is that these can implement only _one_ half duplex transfer at a time. You may have six of these 'implemented', but only one, and only in one direction at a time, can be in use. You can add more hardware UART's, either using SPI, with external chips, or by chosing a PIC with more channels available (normally two).
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
angel
Joined: 19 Oct 2004 Posts: 40
|
hi |
Posted: Tue Jan 29, 2008 7:26 am |
|
|
thanks.
I thought to use 6 but not at the same time. I mean in a sequential way... and without interruptions....
So it would be posible....
On the other hand I will check if it is possible at least an UART with interruption. I think one has to work... |
|
![](templates/subSilver/images/spacer.gif) |
|