CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Extra UARTs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bretesq



Joined: 07 Feb 2006
Posts: 16

View user's profile Send private message Send e-mail AIM Address

Extra UARTs
PostPosted: Sat Jun 17, 2006 11:50 pm     Reply with quote

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!
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Jun 18, 2006 2:13 am     Reply with quote

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!!
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Sun Jun 18, 2006 10:55 am     Reply with quote

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?
sebdey



Joined: 11 Sep 2003
Posts: 17
Location: Switzerland

View user's profile Send private message

Extra UART
PostPosted: Sun Jun 18, 2006 12:11 pm     Reply with quote

If you can use the SPI port, try the MAX3100 from Maxim's:

(http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1731)

We are using it in one of our products, no problems with it...
bretesq



Joined: 07 Feb 2006
Posts: 16

View user's profile Send private message Send e-mail AIM Address

Re: Extra UART
PostPosted: Sun Jun 18, 2006 12:55 pm     Reply with quote

sebdey wrote:
If you can use the SPI port, try the MAX3100 from Maxim's:

(http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1731)

We are using it in one of our products, no problems with it...


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
j_s_connell



Joined: 02 Feb 2004
Posts: 17

View user's profile Send private message

PostPosted: Sun Jun 18, 2006 5:25 pm     Reply with quote

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.
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Jun 18, 2006 6:18 pm     Reply with quote

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!!
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: Extra UARTs
PostPosted: Sun Jun 18, 2006 8:58 pm     Reply with quote

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.
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Jun 19, 2006 12:40 am     Reply with quote

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!!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Jun 19, 2006 2:56 am     Reply with quote

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).
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group