wokwi / avr8js

Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
https://blog.wokwi.com/avr8js-simulate-arduino-in-javascript/
MIT License
462 stars 73 forks source link

Support for simulating ATtinyx5 (e.g. ATtiny85) timers #64

Closed urish closed 3 years ago

urish commented 3 years ago

ATtiny devices use a single TIFR that is shared among both timers. Same goes for TIMSK. Thus, the bit indices for these registers are different and are timer dependent. For instance, TOV0 is second least significant bit, while its current value is hardcoded to the least significant bit.

We need to make TOV / OCFA / OCFB bit positions configurable, as well as TOIE, OCIEA and OCIEB.