Attiny85 Tiny Core - Override Timer1 Overflow Interrupt ISR with another one?

I'm implementing some code and I am not using millis() and micros() which take advantage of the existing Timer1 Overflow ISR in Wiring.C file.

I need to implement a different routine. Is there a smart way via code to override or reroute to my new ISR? Meaning without deleting or commenting things out in the Wiring.C file. I don't want to fuss with the core files, I just want my own routine on top.

For reference:
Here' the compile error I'm getting when I use my ISR:

core.a(wiring.c.o): In function __vector_4': C:\Users\Me\Documents\Arduino\hardware\tiny\cores\tiny/wiring.c:78: multiple definition of __vector_4'

Digging that up leads to : ISR(MILLISTIMER_OVF_vect)

Thanks!

With my variant of the core here:

There is a second core called "tinyNoMillis" which solves this problem by having a version of the core which removes all of the millis() related timer code.

Alternatively for any core, if you add this to your sketch:

int main (void) {
  sei();
  setup();
  for (;;) {
    loop();
  }
  return 0;
}

This will remove all of the millis() stuff, though it will also stop the analogRead(), analogWrite() and tone() functions working.

You can get the analogRead() functionality working again by doing the following:

#if F_CPU == 16000000
  // 16 MHz / 128 = 125 KHz
  #define ADC_ARDUINO_PRESCALER   B111
#elif F_CPU == 12000000
  // 12 MHz / 64 ~= 125 KHz
  #define ADC_ARDUINO_PRESCALER   B110
#elif F_CPU == 8000000
  // 8 MHz / 64 = 125 KHz
  #define ADC_ARDUINO_PRESCALER   B110
#elif F_CPU == 1000000
  // 1 MHz / 8 = 125 KHz
  #define ADC_ARDUINO_PRESCALER   B011
#elif F_CPU == 128000
  // 128 kHz / 2 = 64 KHz -> This is the closest you can get, the prescaler is 2
  #define ADC_ARDUINO_PRESCALER   B000
#else
  #error Add an entry for the selected processor speed.
#endif
int main (void) {
  sei();
  // This code will only run once, after each powerup or reset of board
  // set a2d prescale factor
  ADCSRA = (ADCSRA & ~((1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0))) | (ADC_ARDUINO_PRESCALER << ADPS0) | (1<<ADEN);
  // enable a2d conversions
  ADCSRA |= _BV(ADEN);
  setup();
  for (;;) {
    loop();
  }
  return 0;
}

http://forum.arduino.cc/index.php?topic=142948.msg1073702#msg1073702
http://forum.arduino.cc/index.php?topic=142948.msg1073712#msg1073712

Thanks! I'm aware of this option, but maybe you can quickly answer this for me...will this affect the USI clock stuff if I move millis to Timer0?? I'm using USI for for I2C communication.

The implementations I've seen do not use a timer so I suspect it will make no difference where you place millis.

Confirmed. I switched it over to Timer0 and I2C /USI is working ok.

Thanks!!

I solved this problem by installing David Mellis's ATtiny core on GitHub instead of Google Attiny Cores. This core included ATtiny 24 45 85, 14 44 84...

My core also is okay with this - it uses Timer 0 for millis on the '85 like, uh, every other board.

It's just a few (mostly old) cores that use Timer1, for reasons I never found compelling.