View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
second RS232 in PIC16F876A and interrupts |
Posted: Tue Sep 12, 2006 3:00 am |
|
|
Hi Everibody,
I need to use second RS232 in a working project to receive a wireless comunication. All working fine if I use option to disable interrupts in #use RS232 statement otherwise I don't receive anything from wireless.
In original project I use hardware RS232 and TIMER0 with it's interrupt.
Timer0 overflow every 100us to controll phase by triac.
Hardware RS232 are 9600 baud and wireless RS232 are 1200 baud.
I tryed to use lower baud rate then 1200 but it doesn't work.
I don't want disable interrupts during receve wireless comunication.
Have you got any suggestion about ? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Tue Sep 12, 2006 3:08 am |
|
|
If you are using the CCS software UART the timer interrupt will break the bit timing. There are a few options for dealing with this problem however (in general) you will probably need to write your own software UART handler to replace the CCS one.
If you do not want to write your own then I sell software drivers for this type of application. Feel free to check out the info on my site which broadly discusses what is required from a resource perspective to either develop your own or use my drivers. http://www.brushelectronics.com/index.php?page=software _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Tue Sep 12, 2006 3:36 am |
|
|
Hi,
Does it solve my problem ?
Why CCS software UART doesn't support use of interrupts?
Regards, |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Tue Sep 12, 2006 5:18 am |
|
|
The CCS software UART using CPU ticks to do the bit timing. While it is doing this function it can do nothing else without affwecting the bit timing. In your sample application the bit timing process will be interrupt by both the hardware UART interrupt handler and the timer interrupt.
You need a different mechanism to handle the bit timing such as using one or more timers (transmit and receive bit timing). The CCS software UART is a great tool but it does not fit all applications. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|