velxio/frontend/src/components/simulator
David Montero Crespo 603b791daa feat(attiny85+customchip): full ATtiny85 ADC/Timer0 + custom-chip pipeline fixes
ATtiny85 (AVRSimulator + collectPinStates + connectAnalogInputsToMcu + SimulatorCanvas + Attiny85Element + examples):
- Add attiny85AdcConfig with correct register addresses (ADMUX=0x27,
  ADCSRA=0x26, ADCSRB=0x23, ADCL=0x24, ADCH=0x25, DIDR0=0x34, adcInterrupt=0x08).
  Without this, analogRead() polled the wrong address forever and the
  firmware hung on first ADC read.
- Add attiny85Timer0Config + instantiate AVRTimer so OVF fires at the
  ATTinyCore-expected ~1.024 ms cadence. delay() advance is still blocked
  on avr8js TIFR auto-clear semantics (separate upstream issue, see
  ATTINY85_TIMER0_UPSTREAM_ISSUE.md in velxio-prod test plan).
- Map ATtiny85 ADC channels to PB-style pin names (PB5/PB2/PB4/PB3 -> 0..3)
  in connectAnalogInputsToMcu so SPICE node voltages reach the right ADC
  channel.
- Recognise /^PB\d+$/ in collectPinStates.pinNameToArduinoPin so wires
  named "PB1" emit v_attiny85_pb1 V-source and the LED responds to MCU
  writes. Previously every PB-wire returned -1 and SPICE saw no source.
- SimulatorCanvas: subscribe pin 1 (PB1) for the built-in LED on the
  attiny85 board kind (Digispark convention), instead of falling through
  to the pin-13 default.
- Attiny85Element: remove the hand-drawn "yellow LED" circle that was
  floating above the chip. The bare DIP-8 has no on-board LED; examples
  wire a real wokwi-led + resistor instead.
- examples.ts: add a real wokwi-led + 220 Ohm wokwi-resistor + wires to
  attiny85-blink, and add missing series resistors to attiny85-button-led
  and attiny85-ntc-sensor. attiny85-pwm-fade was already correct.

Custom-chip pipeline (CustomChipPart + simulatorBridges):
- Add a requestAnimationFrame loop that calls instance.tickTimers() every
  frame in CustomChipPart. Chips that register vx_timer_create (e.g. an
  i8080 stepping its core, or a sensor publishing samples) had timers
  added to the queue but nothing fired them; tickTimers was dead code.
- Gate the ESP32 backend path with detectSimulatorKind(sim)==='esp32'.
  The previous `typeof sim.registerSensor === 'function'` check matched
  AVR and RP2040 simulators too (they expose registerSensor for I2C
  sensor proxies), routing client-side chips to a non-existent ESP32
  worker on those boards.
- Replace direct simulator.usart.writeByte calls in avrUartTx with a
  JS-level FIFO + setTimeout(1ms) drainer. avr8js writeByte drops bytes
  under burst load (a chip emitting print_string lost ~99% of bytes via
  non-immediate, or kept only the last byte via immediate). The drainer
  attempts one non-immediate write per tick and retries on RXC busy /
  RXEN off. Added a guard for ATtiny85 (no USART -> would queue forever).

End-to-end verified: i8080-banner-streamer now prints the boot banner
followed by "uptime ticks: 0xNN" lines stepping every ~50 ms, executing
real Intel 8080 instructions inside the WASM chip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 18:10:08 -03:00
..
BoardOnCanvas.tsx fix(board): raspberry-pi-pico renders a real Pico, not Nano RP2040 Connect 2026-05-15 00:31:19 -03:00
BoardOptionsModal.css feat(board-options): per-board options modal + persistence 2026-05-18 21:50:45 -03:00
BoardOptionsModal.tsx feat(board-options): per-board options modal + persistence 2026-05-18 21:50:45 -03:00
BoardPickerModal.tsx feat(editor): translate Oscilloscope + property dialog + selection bar + console + custom chips + sensor + board picker (Editor block 9) 2026-05-09 12:25:30 -03:00
CameraToggle.tsx feat(webcam): universal compatibility — any webcam on any PC ✅ 2026-05-03 00:48:24 -03:00
CanvasMinimap.css fix(minimap): hit-test against clamped rect + shrink to 100x75 2026-05-14 22:53:34 +02:00
CanvasMinimap.tsx fix(minimap): hit-test against clamped rect + shrink to 100x75 2026-05-14 22:53:34 +02:00
CircuitVerificationModal.tsx Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
ComponentPalette.css
…
ComponentPalette.tsx
…
ComponentPropertyDialog.css feat(canvas): inline two-step delete confirm in ComponentPropertyDialog 2026-05-08 12:25:13 -03:00
ComponentPropertyDialog.tsx feat(editor): translate Oscilloscope + property dialog + selection bar + console + custom chips + sensor + board picker (Editor block 9) 2026-05-09 12:25:30 -03:00
InstallLibrariesModal.css refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
InstallLibrariesModal.tsx feat(editor): translate InstallLibrariesModal + SerialMonitor (Editor block 8) 2026-05-09 11:35:22 -03:00
LibraryManagerModal.css refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
LibraryManagerModal.tsx feat(editor): translate ComponentPicker + LibraryManager modals (Editor block 7) 2026-05-09 11:29:07 -03:00
Oscilloscope.css refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
Oscilloscope.tsx feat(editor): translate Oscilloscope + property dialog + selection bar + console + custom chips + sensor + board picker (Editor block 9) 2026-05-09 12:25:30 -03:00
PinOverlay.tsx feat: add touch-friendly components for improved mobile usability 2026-05-08 11:12:26 -03:00
PinPickerDialog.tsx feat(i18n): translate small editor remates + admin internals (Blocks 11+12) 2026-05-09 16:22:16 -03:00
SelectionActionBar.tsx feat(simulator): wire color palette from PR #170 + Copilot suggestions 2026-05-11 12:14:36 -03:00
SensorControlPanel.css refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
SensorControlPanel.tsx fix(sensor-panel): per-sensor state when switching between same-type sensors 2026-05-16 22:28:52 -03:00
SerialMonitor.tsx feat(editor): translate InstallLibrariesModal + SerialMonitor (Editor block 8) 2026-05-09 11:35:22 -03:00
SimulatorCanvas.css feat(canvas): keyboard shortcuts + toolbar undo/redo buttons 2026-05-08 12:11:53 -03:00
SimulatorCanvas.tsx feat(attiny85+customchip): full ATtiny85 ADC/Timer0 + custom-chip pipeline fixes 2026-05-19 18:10:08 -03:00
WireInProgressRenderer.tsx refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00
WireLayer.tsx feat: add touch-friendly components for improved mobile usability 2026-05-08 11:12:26 -03:00
WireModeBanner.tsx feat: add touch-friendly components for improved mobile usability 2026-05-08 11:12:26 -03:00
WireRenderer.tsx refactor: rename components and update prefixes to 'velxio-' for consistency 2026-04-21 16:45:45 -03:00