# Timer SPICE ## What this builds A small suite of 555 timer circuits, simulated in SPICE: an astable, a monostable, and (if on) a couple of applications. Periods, duty cycles, and trip points are compared to documented formulas and to plots. A shipped model card or a behavioural equivalent is used. No breadboard, no parts, and no oscilloscope are required. Read `spekkr.inputs.json` first. `vcc`, `ra`, `rb`, and `c` are the default timing values. `applications` adds two circuits. `model_note` prefers a shipped 555 model. `engine` is the simulator. ## Out of scope - A breadboard, a real 555, or a bench instrument in the checks. - A vendor's encrypted model that cannot be shipped. - A mains-voltage or a safety-certified design. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Astable and monostable - The astable period and duty cycle at the default `ra`, `rb`, `c`, and `vcc` match the formulas in `design.md` within 5% (or the tighter bound in the file). - The monostable pulse width matches `1.1 * r * c` (or the file's formula) within 5%, for a documented trigger. - Trip points are near 1/3 and 2/3 of `vcc`, within 5%, on the threshold and trigger nodes, as in the file. Accept when: period, duty, pulse width, and trip points all match the file's bounds. ### R2. Applications, plots, files - If `applications` is on, the two application netlists produce the documented periods or pulse widths in the file, within the same kind of bound. - Plots: astable waveforms, monostable, a trip-point close-up, and one application. One command runs SPICE, measures, and writes the plots. No breadboard. Accept when: the command passes, the plots are written, and a deliberately wrong capacitor in a fixture fails the period bound. ### R3. Inputs - Inputs are read from `spekkr.inputs.json`. Values outside the ranges or choices in `design.md` are refused before a netlist, a board or a testbench is built. - Options turn the optional circuits, ports or features in the Inputs table on or off. Accept when: an illegal input is refused by name, and the default input set produces the measurements in `design.md`. ### R4. Checks and report - One command runs the simulation or the testbench, writes the plots or dumps, and compares them to the numbers in `design.md`. - The command works without a physical board, a lab instrument or a network. Accept when: the command passes at the defaults, and fails if a documented value in the netlist or the ROM is corrupted on purpose. ## Verification ngspice (or an equivalent) plots are measured against documented periods, duty cycles, pulse widths, and trip points, within a stated bound. Application circuits, if on, are included. No breadboard and no oscilloscope are required. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to run the netlists, how the formulas are listed, and that a bench is not a check.