PDA

View Full Version : Interrupt portb



tazntex
- 18th August 2008, 13:10
Good Morning,
While reading the manual about on_interrupt it says:INTCON = %10010000
enables the interrupt for RB0/INT. Is this the only dedicated port for using interrupt or can it be changed to portb bit 1-7? I have read through the manual and I don't see any reference to changing the input.

Thanks

Melanie
- 18th August 2008, 14:04
You really DO need to download and look at the Datasheet for the PIC you're using.

Look in the section near the end entitled SPECIAL FEATURES OF THE CPU, there you will find the section on INTERRUPTS. Different PICs have different arrangements - the Datasheet tells you what is and isn't available on that PIC.

For example, on the 16F628, you get a PortB.0 interrupt, the only other interrupts available on PortB is a single combined interrupt for the four Ports B.4 through B.7. This arrangement is NOT GUARANTEED on every chip (since some don't have a PortB or only have a partial PortB).

skimask
- 18th August 2008, 14:04
While reading the manual about on_interrupt it says:INTCON = %10010000 enables the interrupt for RB0/INT. Is this the only dedicated port for using interrupt or can it be changed to portb bit 1-7? I have read through the manual and I don't see any reference to changing the input.

That is the only dedicated-single-input interrupt pin for that purpose.
However, you can (if the PIC supports it) enable various PORTB pins for the interrupt-on-change function.

EDIT: Timing! It's all in the timing! Mel wins...

HenrikOlsson
- 18th August 2008, 14:07
Hi,
Generally speaking the INT0 interrupt is on PortB.0 and the Interrupt on change feature is on PortB.4-7. With that being said the dataheet for your particular PIC has specific info on each interrupt and how it is controlled. Some have more than one external interrupt (INT1 etc) some don't, some can enable/disable the IOC feature on individual pins (within the predefined group), some can't etc etc.

/Henrik.

sayzer
- 18th August 2008, 15:50
If we are talking about 16F628A, then you can use two 628A in your project with RB7-RB4 int source.

This way, you get 8 pins for interrupt.

Connect two pics to each other and control one another.

Nice?

skimask
- 18th August 2008, 17:07
Use a stack of 10F200's, GP1/GP2/GP3 interrupt inputs, GP0 is a serial interrupt output, simulated 'open-drain' setup, feeding a master PIC on RxD. A bit like the stacked interrupt chain (8259? 8279? INT2?) on the old PC's...

Darrel Taylor
- 18th August 2008, 20:42
10F200's don't have interrupts.
<br>

tazntex
- 18th August 2008, 20:52
Thanks everyone, I am using the 16F628A. I will go back to the datasheet and see if I can make out what it is talking about.

skimask
- 18th August 2008, 21:05
10F200's don't have interrupts.
<br>
I know...used the term interrupt in the wrong context...

What I meant to get across was 'a very tight loop, polling the pins, waiting for an event on any of the input pins, and reacting to that input event with an output event on another pin.'

The 10F2xx may not have interrupts, but they do have Wake-From-Sleep, which might be just as good. (just noticed, the 10F doesn't have a RETFIE instruction either!)