Repository navigation
feat(emulator): add the ATtiny85 MCU profile (P6.2) - #334
Merged
ttbombadil merged 2 commits intoOct 24, 2026
Merged
Conversation
Port B with INT0 and PCINT0, timer 0 with its own registers and one-word vectors, the ATtiny timer 1, a four-channel ADC that reads REFS2 at bit 4, EEPROM timed for 8 MHz, watchdog and clock prescaler. INT0 and the pin-change interrupt share GIMSK and GIFR, which avr8js wires for one of them only; the profile wraps both hooks. Registered with the board hardware in P6.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paket
P6.2 MCU-Profil ATtiny85 (L). Basis ist
feature/browser-emulation(alle Vorgänger gemergt).Umgesetzt
packages/avr-emulator/src/mcu/attiny85.ts, exportiert alsATTINY85. Grundlage sind Spike P0.5 undavr/iotnx5.h; die Adressen sind I/O-Adressen + 0x20, die Vektoren haben je ein Wort (Vektor n an Wortadresse n).ATtinyTimer1von avr8js.Serialist ein Software-UART (P6.3).McuPeripherals.timersdarf jetzt auch den ATtiny-Timer 1 enthalten (Index = Timernummer).Funde in avr8js 0.21.1 (README des Pakets, Abschnitt „corrections and known differences“):
ATtinyTimer1rechnet den PWM-Modus phasenkorrekt und erzeugt bei gesetztem CTC1 kein Signal an OC1x. Genau so konfiguriert ATTinyCoreanalogWritean PB1/PB4. Die Register stimmen, und das Tastverhältnis in UnoSim kommt aus ihnen (P1.5). Ein Sketch, der den Pegel eines Timer-1-PWM-Pins liest, sieht dagegen LOW.Tests:
tests/attiny85-profile.test.tsmit 13 Fällen und drei ATTinyCore-Fixtures (attiny85-tiny_probe,tiny_interrupts,tiny_watchdog). Die Sketches legen ihre Ergebnisse im EEPROM ab, damit der Test ohne Software-UART-Decoder auskommt. Geprüft werden:delay(587);Abnahmeevidenz
npm run test:unit: App 3562 Tests, Emulator 648 Tests (7 s von 45 s).check,lint,knipundcheck:docsgrün; Pre-Push mit Sonar grün (S1848 und S5906 behoben).Abweichungen vom Plan
delay(587): Der Spike nannte 586–588 ms, das war zu eng.millis()springt nur beim Überlauf von Timer 0 (alle 2,048 ms), daher hinkt jede Ablesung bis zu 2,048 ms hinterher. Abgeleitet ergeben sich 585–589 ms, gemessen wurden 585.mcuProfileregistriert. Der bestehende Testpackages/avr-emulator/tests/atmega328p-boards.test.ts:39–41schreibt fest, dass der ATtiny85 noch kein Profil und keine Board-Hardware hat. Ihn zu ändern liegt außerhalb der Freigabe. Die Registrierung kommt mit der Board-Hardware (P6.4); dazu stelle ich die Frage gesondert.Geänderte bestehende Tests
Keine.
Für Menschen
Die Meldungen der drei Funde an avr8js (
wokwi/avr8js) sind nach außen gerichtet und gehören einem Menschen. Plan P6.2 sieht das für REFS2 bereits vor.🤖 Generated with Claude Code