View previous topic :: View next topic |
Author |
Message |
pasini
Joined: 12 Dec 2005 Posts: 50 Location: Curitiba - Brazil
|
Multiple UART + Interrupts |
Posted: Wed Jul 19, 2006 7:15 am |
|
|
It is possible to have multiple UARTs in any PIC MCU, even if your MCU does not have a hardware UART because then you have a software UART, isn�t it ?
Also, if I use the hardware UART I can use an interrupt to receive data ( #INT_RDA ). Will #INT_RDA also work for software UART ?
If yes, how do I receive the data for multiple UARTs ? How do I differentiate each of the UARTs to receive data ?
Thanks in advance.
Pasini |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Wed Jul 19, 2006 7:32 am |
|
|
Some PICs (typically the 68 pin packages and above) have 2 hardware UARTS. You can have software UARTS. If you use the CCS compiler you will be able to create half duplex UARTs via the #yse rs232 directive (they can send, or receive but not both simultaneously).
You can emulate full duplex UARTS in software including interrupt support. This requires use of 1 or more times and possibly external interrupt pins depending on what performance level you are trying to achieve.
For example, one one of my projects I have a PIC18F452 @ 40MHz runnning one hardware UART and two software UARTs simultaneously at 115Kbps full duplex as well as other peripherals such as a USB controller. However this is VERY resource intensive. (Shamelessplug follows) If you are interested in purchasing the source code for some SW UART full duplex drivers then check out the software page on my web site. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|