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

second RS232 in PIC16F876A and interrupts

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



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

second RS232 in PIC16F876A and interrupts
PostPosted: Tue Sep 12, 2006 3:00 am     Reply with quote

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

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

PostPosted: Tue Sep 12, 2006 3:08 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Sep 12, 2006 3:36 am     Reply with quote

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

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

PostPosted: Tue Sep 12, 2006 5:18 am     Reply with quote

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