Commit Graph

2 Commits

Author SHA1 Message Date
alro65 210c44341f feat: LTspice RS-485 / NMEA 0183 interface simulation (SN65HVD1781)
Simulates the full RS-485 half-duplex channel on the ESP32+CAN+RS485 board:
  - SN65HVD1781 behavioral driver/receiver (3.3V native, 32 unit loads)
  - Half-duplex direction control via DE/RE GPIO4
  - 560Ω bias resistors keeping bus HIGH during idle (NMEA 0183 failsafe)
  - 120Ω termination at both ends of a 10m T-line model (Zo=120, Td=50ns)
  - Transmits ASCII 'G' (0x47) at 4800 bps — one complete NMEA character
  - Second node as passive 12kΩ unit-load receiver
  - .meas directives verify Vdiff > ±200mV (RS-485 spec) in both polarities

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 10:13:16 -04:00
alro65 fa8a65f687 feat: LTspice SPICE netlists for all hardware subcircuits
Four .cir behavioral simulations ready to open in LTspice via File→Open:
  1_buck_chain.cir      — dual MP2338 12V→5V→3.3V, verifies Rfb math + soft-start
  2_output_stage.cir    — PC817 + IRLML6344 isolated output (inverted logic confirmed)
  3_analog_input.cir    — analog input conditioning; flags ADC overvoltage on IN-BAT/WATER/OILP
  4_nmea2000_can.cir    — MCP2562T CAN transceiver, two-node NMEA2000 bus, T-line model

CRITICAL finding in 3_analog_input.cir: R_high=10K + R_low=15K gives 4.3V
at ESP32 ADC when measuring a 12V battery — exceeds 3.3V limit. Fix: use
R_high=100K (same as IN-RPM, which is correctly designed at 3.06V @ 14.4V).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:59:50 -04:00