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 support@ccsinfo.com

number of USART

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



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

number of USART
PostPosted: Mon Jan 28, 2008 3:38 am     Reply with quote

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



Joined: 15 Nov 2005
Posts: 161
Location: Glasgow, UK

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

PostPosted: Mon Jan 28, 2008 7:06 am     Reply with quote

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



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

View user's profile Send private message

PostPosted: Mon Jan 28, 2008 8:17 am     Reply with quote

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?
Ttelmah
Guest







PostPosted: Mon Jan 28, 2008 9:10 am     Reply with quote

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
angel



Joined: 19 Oct 2004
Posts: 40

View user's profile Send private message

hi
PostPosted: Tue Jan 29, 2008 7:26 am     Reply with quote

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