View previous topic :: View next topic |
Author |
Message |
bretesq
Joined: 07 Feb 2006 Posts: 16
|
Extra UARTs |
Posted: Sat Jun 17, 2006 11:50 pm |
|
|
Hi guys,
I'm doing a personal project now where I'd like to setup a "Serial" server for my 4 servers I have running in a datacenter. I have got the ethernet working with the enc28j60 chip and the tcp/ip stack from microchip/ccs. What hardware UART chip would you recommend for me to use to gain the 4+ serial devices I have. I'd like them to be able to transfer at least at a rate of 38400 bps each. I don't think using the software UART within a PIC18 chip would be that efficient. Anyone have some insight?
Thanks! |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Sun Jun 18, 2006 2:13 am |
|
|
I have implemented two software UART and a hardware UART on a PIC18F452 running at 40MHz. Both software UARTs were running at 115Kbps.
Maxim make an SPI connected UART but I have not yet implemented it. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
newguy
Joined: 24 Jun 2004 Posts: 1903
|
|
Posted: Sun Jun 18, 2006 10:55 am |
|
|
asmallri wrote: | I have implemented two software UART and a hardware UART on a PIC18F452 running at 40MHz. Both software UARTs were running at 115Kbps.
Maxim make an SPI connected UART but I have not yet implemented it. |
I'm curious how this was done in general - would you mind letting me know if the following assumptions are correct?
Regarding the soft RS232 comms - are they transmit only, or are they capable of receiving as well?
If they are capable of receiving, do you poll them, or are they connected to the PIC's external interrupts, or the interrupt-on-change pins?
I assume that your setup involves the interrupt scenario. Can both s/w UARTs be used simultaneously? |
|
![](templates/subSilver/images/spacer.gif) |
sebdey
Joined: 11 Sep 2003 Posts: 17 Location: Switzerland
|
|
![](templates/subSilver/images/spacer.gif) |
bretesq
Joined: 07 Feb 2006 Posts: 16
|
Re: Extra UART |
Posted: Sun Jun 18, 2006 12:55 pm |
|
|
I'm not sure I can use the SPI port since I will be using it to interface the ENC28J60. Can you use that port for the both? I have very limited knowledge SPI protocol.
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
j_s_connell
Joined: 02 Feb 2004 Posts: 17
|
|
Posted: Sun Jun 18, 2006 5:25 pm |
|
|
The spi bus can be shared with the enc28j60, as long as you have an extra CS (chip select line) for the uart chip. People using the enc28j60 often share the spi bus with an sd/mmc card (to store web pages). See this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=27330
for some reference designs where the enc28j60 is shared on the spi bus. |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Sun Jun 18, 2006 6:18 pm |
|
|
Quote: |
I'm curious how this was done in general - would you mind letting me know if the following assumptions are correct?
Regarding the soft RS232 comms - are they transmit only, or are they capable of receiving as well? |
Full duplex transmission and reception.
Quote: |
If they are capable of receiving, do you poll them, or are they connected to the PIC's external interrupts, or the interrupt-on-change pins?
|
They use the external interrupts. This is requires for accurate start bit edge detection only. It could use either port b interrupt or interrupt on change but it gets messy with interrupt on change.
Quote: |
I assume that your setup involves the interrupt scenario. Can both s/w UARTs be used simultaneously? |
Yes. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Extra UARTs |
Posted: Sun Jun 18, 2006 8:58 pm |
|
|
bretesq wrote: | Hi guys,
I'm doing a personal project now where I'd like to setup a "Serial" server for my 4 servers I have running in a datacenter. I have got the ethernet working with the enc28j60 chip and the tcp/ip stack from microchip/ccs. What hardware UART chip would you recommend for me to use to gain the 4+ serial devices I have. I'd like them to be able to transfer at least at a rate of 38400 bps each. I don't think using the software UART within a PIC18 chip would be that efficient. Anyone have some insight?
Thanks! |
I'd use an ST ARM7. The have plenty of serial ports. If you can keep the code under 32K then you can use the IAR compiler or GCC compiler if you need more room. |
|
![](templates/subSilver/images/spacer.gif) |
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Jun 19, 2006 12:40 am |
|
|
I forgot to add, I use a single timer for the transmit bit timing servicing multiple sw uarts. It is tricky impementing the software UARTs transmit logic because all paths through the transmit interrupt handler state machine for a given comm port must be the same otherwise jitter (and therefore the possibility or errors) will be introduced for the remaining comm ports lower down in the chain of the transmit bit interrupt handler. My interrupt handler is implemented in assember and it took me a full day of tuning to ensure this condition was met. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jun 19, 2006 2:56 am |
|
|
Quote: | What hardware UART chip would you recommend for me to use to gain the 4+ serial devices I have. I'd like them to be able to transfer at least at a rate of 38400 bps each. | There are PIC processors with 2 internal hardware UARTs, running at 40MHz and with some tweaking I guess the other two UARTs can be implemented in software. For a new design however I wouldn't use a software UART, it will take a lot of time/effort to get them stable. For low quantities it will be cheaper to use external hardware UARTs, they are flexible and you can easily add more chips when more serial ports are required.
Two years ago we looked at the Maxim 3100 but decided not to use it for it was hard to get at. A single sample was readily available but lead time for more than 5 pieces was 10 weeks. We are now using the new Philips SC16IS760.
You might consider using another processor, like Mark mentioned there are other processor families around with much more serial ports. Besides the ARM7 you can also have a look at the Rabbit processors (4 serial ports). |
|
![](templates/subSilver/images/spacer.gif) |
|