1
\$\begingroup\$

Is it possible to use a script using TimerOne from Arduino in an ATmega8 and how would I go about it?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you. That confirm what I reasearched. You covered more than I new already. \$\endgroup\$
    – Mr Men
    Commented Aug 22, 2012 at 10:51
  • \$\begingroup\$ @MrMen - If you found this answer useful (which you probably did, since you accepted it) don't forget to upvote. \$\endgroup\$
    – stevenvh
    Commented Aug 22, 2012 at 11:14
  • \$\begingroup\$ Done that ty((: \$\endgroup\$
    – Mr Men
    Commented Aug 22, 2012 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.