SCOPE Solution
RAMP
SCOPE ACT 1

Prerequisites
Unlocks
sc_a1_03_ramp locked
Par power1054
Par lines5
Par chips1
Objective
A rising sawtooth 0..255 then a snap back to 0.
Board Data
- Window: 264
- Pins: p0 OUT
- Channels: p0 ANALOG label=CH1_p0_DAC
- Peripherals: DAC data=p0 label=DAC_on_p0
Firmware Solution
; RAMP reference: rising sawtooth 0,1,2,...,255 then wrap (snap) to 0 and climb
; again. r0 is the level; inc wraps mod 256, so the snap is automatic.
loop:
out p0, r0 ; draw the current level
slp 1 ; one tick per level
inc r0 ; next level (wraps 255 -> 0)
jmp loop
Board Definition
# RAMP. ACT 1, analog. Step a register out through the DAC one level per tick. The
# first register (r0) is the counter the picture demands. The window runs past 256
# so the snap at the wrap is visible. Reference is sc_a1_03_ramp.asm.
# TITLE RAMP
# OBJECTIVE A rising sawtooth 0..255 then a snap back to 0.
ID sc_a1_03_ramp
WINDOW 264
DIR p0 OUT
PERIPH DAC data=p0 label=DAC_on_p0
CHAN p0 ANALOG label=CH1_p0_DAC
PAR power=1054 lines=5 chips=1