Fried input pin?

Hi all,

Whilst interfacing with an LM1815 IC I seem to have killed the the digital input.

All was working well - but now it seems to go a bit mental. Tried a simple button input and that plays up as well.

Can I just replace the main Arduino chip?

James

It's worth a shot.

How do the other digital inputs behave? Can you just switch over to a different one?

I want to use the 2 and 3 pins as I am using interrupts :slight_smile:

I've ordered a new chip so will wait and see :slight_smile:

You can also use the pin change interrupts on any I/O pin instead of the dedicated interrupt pins on PD2 and PD3.

Say that again?

I can use other pins with attachInterrupt? How so?

Sorry, you have to "color outside the lines" a bit. attachInterrupt() does not support the pin-change feature of the microcontroller yet.

The pin-change interrupts are documented in Section 10 of the ATmega328 datasheet.

You could, for example, use digital pin 8 (Port B pin 0):

void setup() {
  PCMSK0 = _BV(PCINT0); // Enable PCINT group 0
  PCICR = _BV(PCIE0); // Enable PCINT0, (Port B pin 0)
}

ISR(SIG_PIN_CHANGE0) {
  // handle pin change interrupt
}

Digital pins are in sets of ports? Maybe I have only fried one port... I can try that code and see if it's just the port A or pin 3 and 4...

Thanks!

If you need to know which pin actually caused the interrupt, you'll have to take care of that yourself with pin change interrupts!
Any pin in a pin group will fire the interrupt if it changes.