Repository navigation
feat(emulator): model the software UART of the ATtiny85 (P6.3) - #335
Merged
ttbombadil merged 3 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>
TX is decoded from PB0 with the baud rate found from the edge distances and the bit width measured from them; RX drives PB1 through an analog comparator model. SoftwareUart offers the USART members SerialPorts uses, for the ATtiny85 board. 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.3 Software-UART ATtiny85 (M), Modell auf Paketebene. Gestapelt auf #334 (P6.2). Die Basis ist
feature/browser-emulation; bis #334 gemergt ist, enthält der Diff dessen Commit mit.Umgesetzt
packages/avr-emulator/src/io/software-uart.ts:SoftwareUartmodelliertTinySoftwareSerialvon ATTinyCore 1.5.2 (TX an PB0, RX an PB1 über den Analogkomparator). Die Klasse bietet die Mitglieder vonAVRUSART, dieSerialPortsnutzt, damit das ATtiny-Board in P6.4 dieselbe Serial-Schicht bekommt.configuredBaud, später die des Serial Monitors).writeByteerzeugt die Wellenform in simulierter Zeit.ACIEgesetzt und der Komparator an ist (Serial.begin()).Funde, nicht im Spike:
Mit dem Spike-Kriterium „95 %“ wurde 19200 deshalb nicht erkannt; jetzt gelten 90 %, dazu kommt die Startbit-Prüfung.
Abnahmeevidenz
tests/software-uart.test.ts, 7 Fälle mit ATTinyCore-Fixtures:Serial-Probe des Spikes vollständig (int-Überlauf,print(2.5), Umlaute, ADC, RAMEND);parseInt-Echo über den Komparator („got 21 / twice 42“);Serial.begin()und während eines laufenden Bytes abgewiesen;npm run test:unit: App 3562, Emulator 655;check,lint,knip,check:docsgrün; Pre-Push mit Sonar grün.Abweichungen vom Plan
SerialPorts/Worker und die Baudrate aus dem Serial Monitor brauchen die Board-Hardware und kommen mit P6.4. Das Benutzerhandbuch (Halbduplex, kein Empfang bei anderer Nutzung von PB1) kommt mit der Freigabe des Boards (P6.5).Geänderte bestehende Tests
Keine.
🤖 Generated with Claude Code