Timer
This code programs a/d node 709 to act as a timer.
stop
Value (4155) that stops the a/d counter. This is done to save energy and to avoid heating and slowing the counter when it's not being used.
mode
Saves a and stores value into io
start
Value (6155) that starts a/d. It selects Vss calibration, which is the fastest count.
sol
sol writes to up which waits for the start-of-line pulse. It then reads the counter (dup !b @b).
cal
An infinite loop
- Ignore both start and stop commands
- Call sol twice and subtracts
- Return count
go
An infinite loop
- Start a/d on command
- Read a/d (!b @b
- Read a/d again on command
- Stop
- Subtract readings (a/d is a down counter, so result is inverted)
- Return value
init
Normally starts at go. In case of calibrating against a scan line, starts at cal.