Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

rb0 interrupt received from wave generator is not detected

Not open for further replies.


Member level 4
Aug 24, 2005
Reaction score
Trophy points
Activity points
rb0 interuupt pic

hi i have made for frequency mesurement .m using internal oscillator and external interrupt is on pin rb0 . he problem m getting is the controller isnt detecting external interrupt received from a square wave generator, any reasons suggested?

Re: rb0 interuupt pic

I think it should detect the interrupt.
However, I do not sse where you save/restore the STATUS register in the ISR. Maybe that causes problems later in the code and makes it look like it did not detect an interrupt.

Please see page 109 of the datasheet (Example 14-1) for the correct way to save restore the W and STATUS registers. Simply copy that code.
It is important to use the swapf instruction to save/ restore the STATUS register, because, unlike the movf or movwf, this instruction, swapf does not alter the flags.

rb0 interuupt pic

well, I see additional problems just looking at your ISR code. You can exit the ISR without restoring W. Why do you call delay in the interrupt handler? You certainly won't measure anything faster than 10 hz... Maybe you should spend a little time understanding interrupts and how to use them.

Does toggling the TMR1ON bit work the way you expect it to? I think I'd just read TMR1H/L and then clear them on every interrupt. Though that does require some care in how you use the value in your main loop.

Also, I'd spend more time thinking about comments. There should be A LOT more of them (like every line) - your initialization code is a perfect example.

rb0 interuupt pic

thanks for replying i deleted the delay and my controller is detecting the external interrupt

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to