Intterrupts

What is the difference between a pin-change interrupt and an external interrupt?

Thanks!
baum

The external interrupts are associated with specific interrupt pins. They can be set to signal on a LOW level, RISING edge, FALLING edge, or CHANGE (both rising and falling edge).

There is one "Pin Change" interrupt per port (8-bit group of I/O pins). The pins within the group can be individually masked. The pins are sampled periodically and the interrupt is signaled if any of the un-masked pins has changed. If you have more than one pin in a port enabled you have to read the interrupt flag register to find out which pin(s) changed.

But on the attiny, every pin has a pcint (pin change interrupt)!!!!

http://www.atmel.com/dyn/resources/prod_documents/2535S.pdf (2ndPage)

Pin-change... • Applies to all pins • Overloaded; all pins on a port are vectored through a single interrupt handler • Fires only on CHANGE • Processor clock does not need to be running

External... • Applies to only specific pins • One-to-one; each pin has a dedicated interrupt handler • Can be configured to fire on RISING, FALLING, LOW, CHANGE • Requires the processor clock to be running (except LOW)

But on the attiny, every pin has a pcint (pin change interrupt)!!!!

Each pin on that processor is capable of generating a pin-change interrupt. If any pin is configured to generate a pin-change interrupt, when the interrupt occurs, execution is vectored through a single interrupt service routine.

How do I call the ISR and get the pin state?

Is it something like

PCINT << 4?

How do I call the ISR

Are you asking how to enable pin-change interrupts?

and get the pin state?

digitalRead

So I can use digital read w/ your cores; how do i do pchange interrupts?

You're going to have a tough time using any core with an ATtiny13. It [u]really[/u] does not have much memory (64 bytes of SRAM; 4 bytes are used just getting into loop). The processor was really meant to be programmed using assembly or possibly "raw" C.

There is an enormous amount of information available regarding pin-change interrupts.

http://www.google.com/search?q=arduino+pin+change http://www.arduino.cc/playground/Main/PcInt http://www.arduino.cc/playground/Main/PinChangeInt http://arduino-tiny.googlecode.com/files/PinChangeInterrupt-0001.zip http://arduino.cc/forum/index.php/topic,51838.msg369796.html#msg369796

I was talking about the '85... sorry!

So in summary, external interrupts execute certain code when triggered, pin change interrupts are a register that stores the inputs on that port?

I was talking about the '85... sorry!

In that case, just snag the Pin Change library from the Tiny Core website and play a bit.

baum: So in summary, external interrupts execute certain code when triggered

Yes.

pin change interrupts are a register that stores the inputs on that port?

No. "Pin change interrupts" also execute certain code when triggered. The difference is that up to eight pins are tied to a single interrupt service routine and only CHANGE is supported.