![]() ![]() RS232 communication and Interrupts Hi, I’m looking for an example (for CCS-C compiler) of a program that combines interrupts AND RS232 communications. Just to describe what I’m trying to do: my application has three major functions 1- Ext. Button detections (INT_RB) 2- Detect, if a RS232 Cable is plugged or not (using INT_Timer2) 3- if a RS232 cable is detected, than start a RS232 dialog. Well all these 3 functions are working perfectly – separately. Programming a serial port. • SCON Program • Main and Interrupt functions for mode 3 serial UART communication. End of Lesson 10 on C Programming Examples for. Jul 08, 2008 Hi, I need to use a transmitter interrupt and receiver interrupt in C. Rs232 transmitter program download Hi. Timer Interrupt CFunctions 1 and 2 are working well together, with enable/disable int. But when the function 3 (RS232 dialog) is suppose to start, it hangs (the whole prog. Is stopped) I suspect an interrupt conflict but until now I could not solve it. I cannot really use MPLab to debug because LCD display and RS232 com are used, and the project is far too complex. I’m using a PIC16F877A, but an example for any other PIC would be nice. Thank you for any help. To start with, i think there is no need to disable interrupts of whatever origin once you are inside the ISR, you would better check for all flags in some sequence( the only way for this processor to implement some sort of priority-scheme) inside one general ISR, once THE INTERRUPToccurs no other can disturb anyway. System Interrupts System InterruptsInterrupt C ProgrammingI do not understand the idea behind installing a 1 ms timer interrupt and next disabling them for 5 ms. As a general approach, you better create one ISR in this case, checking all flags for all enabled interrupt sources and spend minimal time inside the ISR, certainly not put any delay in there.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |