Making the following project run on attiny85

I found this project on instructables, AM Transmitter With Arduino - Instructables, and it worked really well with my car’s stereo. My only issue with this project is that it requires something large like an uno or nano. Does someone with more knowledge of AVR microcontrollers have any idea if this project could be made to run on an attiny85 or any attiny for that matter?


The solution consists of transforming the analog input signal into a PWM signal, using the ADC and the 16-bit timer/counter1 of the ATmega MCU.

Tiny85 has no 16 bit timer so the code can’t run on a tiny85 (see the data sheet). The Arduino Pro Micro is smaller than a Nano and uses the mega328 chip.

I was looking at a list of attiny micros to find one with a 16-bit timer, then I remembered that I could just use a 328P without the Arduino board. So I think I will just buy a 328P with the optiboot loader and use an external crystal so I don’t have to rewrite anything.

1 Like

You're stuck with the ATmega, if you don';t want to modify code. It uses timer2 as well as timer1 - though I think it could be modified to work on an ATtiny841 which has enough timers, code changes would be needed because their timer2 is different.

With complete rewrite, it could be made to work on an attiny861 significantly better than it does on a 328p (smaller distance between frequency options). It could also be made to work (with complete rewrite) on modern avrs, and on the AVR Dx-series, it would do everything betterl