Attiny 45/85 on arduino, will intterrupt work?

i was reading on this site http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585

on how to work attiny 45/85 with arduino board,

so my question is, will interrupt work as atmel328 do?

seems like...

seen the datasheet: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=ATTINY45-20PI-ND ?

-arne

yes but does arduino support it?

oh - hum...

since millis() works, interrupts will work, 2...

maybe some register addresses r different... my arduino IDE doesnt know the attiny45... does urs?

-arne

Here it shows how can arduino read it http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585

oh - i c - the IDE can be upgraded... cool! 8-)

so can anyone help me on how can i make interupt work?

could u specify what doesnt work?

according to ur URL millis() will work... so interrupts work...

or not?

-arne

i tried interrupt and it doesnt work

how did u try it? -arne

attachInterrupt(1, blink, CHANGE); and attachInterrupt(0, blink, CHANGE);

but it seems it can't understand witch one is 1 or 0 interrupt

any idea please?

did u test if millis() works? -arne

nop, why?

why dont u do that first:

void setup() { pinMode(2,OUTPUT); }
void loop() {
  digitalWrite(2,HIGH);
  delay(100);
  digitalWrite(2,LOW);
  delay(2000);
}

(with a led in series with 10kR at digital pin 2)?

my idea is: if delay+millis dont work, then ur URL is wrong... if they do work, then ur sketch is wrong...

-arne

i tried this and it doesnt works

int led_pin =4;
volatile int state = LOW;

void setup()
{
  pinMode(led_pin, OUTPUT);
  attachInterrupt(0, blink, CHANGE);
}

void loop()
{

  digitalWrite(led_pin,state);
}

void blink()
{
  state = !state;
}

any other code (digitaWrite,analogRead,delay...) works

What is feeding into pin2 that is generating the interrupt? Does the attiny 45/85 use the same input pin for the interrupt that attachInterrupt is supposed to be watching for?

pin2 on attiny 45 is INT2,

so when i call attachInterrupt(0, blink, CHANGE); i call pin2 right? why i have the problem?

can u find out what the content of the interrupt registers is (before and after the attachInt...() call)?

e. g. MCUCR, GIMSK, PCMSK, ...

maybe u could do it with a flash code? 1: long on, then short off 0: short on, then short off after 8 bits: long off

or does serial work?

-arne

i really dont understand what you mean, i only know some things on arduino