![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi everyone. I would like to know how do we process interrupts caused by the INT pin(RBO) in mikrobasic language?actually im using the PIC16F877A . thanks | |
| |
| | (permalink) |
| Once you have setup and enabled the interrupt, it's going to automatically jump to the hardware interrupt vector when the interrupt fires. Do what you need to do in the interrupt handler routine, clear the interrupt flag bit, and exit the interrupt handler. The data sheet tells you all you need to know about setting up and enabling the interrupt. I'm not familiar with mikrobasic, but most BASIC PIC compilers don't allow BASIC statements in the interrupt handler. These tend to corrupt system variables used internally by the compiler. So you may want to check with mikrobasic on that one. It may require code in your interrupt handler to be written in pure assembler. Some BASIC compilers offer a polled interrupt option, where the BASIC program statements are allowed to finish before the interrupt is serviced. With this option the compiler normally just inserts a return at the hardware interrupt vector. The interrupt fires, jumps to the hardware int vector, returns leaving global interrupts disabled, the BASIC command is allowed to complete, then it jumps to the actual interrupt handler routine. This approach is incredibly slow at servicing the interrupt, and normally it's easier to do this yourself by just monitoring interrupt flag bits, and leaving global interrupts disabled. Most all compilers have different methods, so it's definitely best to check with mikrobasic. Just to be sure. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| thanks guys.i got the answer .its so easy.first enable GIE and INTE then write a sub procedure called 'interrupt' and any interrupt will be vectored at this sub procedure | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Problem with LED Driver (STP16C596) | brian1234 | General Electronics Chat | 9 | 26th September 2006 09:53 PM |
| Status of a comparator affecting interrupts. | 2camjohn | Micro Controllers | 7 | 19th July 2005 12:14 PM |
| RF tranceiver problem | darvaish | General Electronics Chat | 2 | 3rd April 2005 08:44 AM |
| Mysterious Problem! | matasoft | Micro Controllers | 15 | 11th September 2004 08:50 PM |
| Big thermocouple ADC problem | Oznog | General Electronics Chat | 9 | 4th May 2004 09:42 PM |