Attiny85 IRremote Code

To start, the goal of my project is to create a small device that you can program with an Ir remote, then you can push a button and it will resend the code it previously learned. I only need to store one code, so this simplifies things a lot. I started with the Arduino uno. I got the code down to the correct size and reduced the ram usage to fit the attiny85. Now that i'm waiting for my attiny to arrive, i decided to try to compile the code for attiny with arduino as ISP. This is where things go very wrong; I get this error:

/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'void IRsend::sendRaw(unsigned int*, int, int)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:12: error: 'TCCR1A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:16: error: 'TCCR1A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:20: error: 'TCCR1A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'void IRsend::enableIROut(int)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:38: error: 'TIMSK1' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:48: error: 'TCCR1A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:48: error: 'WGM11' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:48: error: 'TCCR1B' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:48: error: 'WGM13' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:48: error: 'ICR1' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'void IRrecv::enableIRIn()':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:64: error: 'TCCR1A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:64: error: 'TCCR1B' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:64: error: 'WGM12' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:67: error: 'TIMSK1' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'void IRsend::mark(int)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:223: error: 'TCCR2A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:223: error: 'COM2B1' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'void IRsend::space(int)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:231: error: 'TCCR2A' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:231: error: 'COM2B1' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'long int IRrecv::decodePHOENIX_LTX(decode_results*)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:270: error: 'Serial' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:275: error: 'Serial' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp: In member function 'long int IRrecv::decodeLAZER_TAG_TEAM_OPS(decode_results*)':
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:323: error: 'Serial' was not declared in this scope
/Users/Justin/Documents/Arduino/libraries/IRremoteGOOD/IRremote.cpp:328: error: 'Serial' was not declared in this scope

I did some reading around and found that the code utilizes Timer2 on the arduino uno. I was informed that i would need to change to either timer0 or timer1 for the attiny. I tried finding the values like TCCR2A and changing them to something like TCCR0A. Still nothing, i get about the same errors. My question is has anyone previously done this? What am I screwing up? Any help is appreciated.

Oh and here is the link to both the optimized library and the code I am using: https://dl.dropbox.com/s/j50pj90wnmwz84g/IRCode.zip?dl=1

The timers are different in detail - you can't just change the digit and hope.

So how would I fix my code?

You need to modify the timer code yourself and add/change what's required...

or

Find some other code that's already suited for the job.

Jsut210: So how would I fix my code?

You look at the datasheet for the Attiny85.

For example, page 92. It appears that you have register TCCR1 rather than TCCR1A.

Whether the bits do the same thing as on the Atmega328 or not you would have to check.

I am about to give up on this, I have no understanding of how the internal clocks work on the attiny85…sadly theres no way im reading the huge datasheet.

I suggest you grab the firmware for the TV-B-Gone kit (just Google it).

That uses an Attiny85 to send our IR remote codes. So the basics of sending codes is already there.

I took a look at that, I didn't understand some of the code. I think it was in raw C. I've only used the adruino C/C++ I'll take another look and see what I can see. Do you happen to know about any tutorial explaining the raw C system?

This guy use an Attiny45 for an IR receiver:

http://funduino.blogspot.dk/2012/02/tiny-ananta.html