SCOPE Solution
NOT SAW
SCOPE ACT 4

Prerequisites
Unlocks
sc_a4_05_not_saw locked
Par power520
Par lines11
Par chips1
Objective
A counter is inverted before output, making a falling saw.
Board Data
- Window: 64
- Pins: p0 OUT
- Channels: p0 ANALOG label=CH1_p0_DAC
- Peripherals: DAC data=p0 label=DAC_p0
Firmware Solution
; NOT SAW reference. A counter starts at the per-case offset (input[0]) and climbs
; by the per-case step (input[1]); inverting it before the DAC turns the rising count
; into a falling saw. The seeds are read from the input, so one firmware draws all.
mov r2, 0
ldb r0, [r2] ; r0 = counter start offset (input[0])
mov r2, 1
ldb r4, [r2] ; r4 = ramp step (input[1])
loop:
mov r1, r0
not r1 ; invert: rising count becomes a falling saw
out p0, r1
slp 1
add r0, r4 ; climb by the per-case step
jmp loop
Board Definition
# NOT SAW. ACT 4. SCOPE waveform board.
# TITLE NOT SAW
# OBJECTIVE A counter is inverted before output, making a falling saw.
# The battery moves the ramp step and the counter start offset, seeded into the
# input, so a captured transcript of one falling saw diverges on the next: only a
# firmware that reads the seed and inverts the running counter locks every case.
ID sc_a4_05_not_saw
WINDOW 64
DIR p0 OUT
PERIPH DAC data=p0 label=DAC_p0
CHAN p0 ANALOG label=CH1_p0_DAC
CASE phase=0 k=8
INPUT addr=0 label=START
INPUT addr=1 label=STEP
PAR power=520 lines=11 chips=1