Is it possible to use a script using TimerOne from Arduino in an ATmega8 and how would I go about it?
|
I will answer this assuming you are referring to the arduino-timerone library, whose source is located here. First of all, looking at the datasheets of the two parts, the ATmega8 is quite similar to the ATmega168/328, which the TimerOne library is stated to target (apart from some differences, including the number of PWM-capable outputs). In particular, in relation to Timer1, inspecting the timer's descriptions in the two datasheets and its specific functionalities exploited in the TimerOne code, the ATmega8 and ATmega168/328 should be swappable with each other. Lastly, the Arduino bootloader is made available to be burned onto an ATmega8 chip (IIRC, ATmega8 is one of the selectable boards in the Arduino 1.0 IDE). With all of the above in mind, the TimerOne library should very likely function without modification on sketches written to an Arduino-bootloaded ATmega8 chip. |
||||