External Interrupt @ t2313 doesnt work

Hello,

I’m trying to get this code working on my t2313:

byte led = 2;
volatile int dly = 500;

void setup() {
  pinMode(led, OUTPUT);
  digitalWrite(6,HIGH);    // pullups
  digitalWrite(7,HIGH);
  attachInterrupt(0, less_dly, LOW);
  attachInterrupt(1, more_dly, LOW);
}

void loop() {
  digitalWrite(led, HIGH);
  delay(dly);
  digitalWrite(led, LOW);
  delay(dly);
}

void less_dly() {
  dly = dly-10;
}

void more_dly() {
  dly = dly+10;
}

The t2313 is running at 1Mhz with this core: http://code.google.com/p/arduino-tiny/ . Its not doing anything at all. Not even the loop() blinking. I’m thankful for any help!

Does the LED blink every 500ms if you comment-out the attachInterrupt calls?

Ok pretty stupid but I mixed the pins up. I was connecting the LED to pin2 (AVR) and not pin2 (Arduino). The pull up command was also wrong and needed to be changed to 4/5.

Now it works fine. Thank you for forcing me to check it again :)

| Arduino | | AVR (t2313) | | - | - | - | | --------- | | -------------- | | - | | 1=RST | | 0 | | 2=RX | | 1 | | 3=TX | | 2 | | 4=IO | | 3 | | 5=IO | | 4 | | 6=INT0 | | 5 | | 7=INT1 | | ... | | ... |