Syscall 2: Firmware, home

BenchChapter 12: Shared buses

B94FSK

The task

P1 reads a data bit on CH1. Send it as a tone on P0: fast for a 1, slow for a 0.

On each tick of P2, add 20 to a phase in B for a 1, or 10 for a 0, wrapping at 100.

P0 is high while the phase is 50 or more.

The board

The chip of FSKChip u1 with 3 ports: P0 digital out, reaching R1, D1, CH2; P1 digital in, reaching V1, CH1; P2 timer 20 cycles.u1CHIP SC-2P0DIGITAL OUTR1, D1, CH2P1DIGITAL INV1, CH1P2TIMER 20 CYCLES
The chip's ports, each with its kind and the parts its signal reaches. Cyan reads, lemon writes. On a narrow screen, scroll the board sideways to see all of it.
Sources
V1 2 V square at 25 Hz and V2 1.2 V square at 62.5 Hz
Resistors
R1 330 Ω
LEDs
D1 green
Probes
CH1 and CH2

Key idea

The step is 10 plus 10 times the bit.

Hints

Each hint goes a step further than the one before. Open them one at a time.

Hint 1Show

This is VCO with the step taken from a bit instead of a knob.

Hint 2Show

IN P2, IN P1, MUL 10, ADD 10, ADD B, MOD 100, MOV B, A, DIV 50, OUT P0.

Solution

Reveal the Full SolutionThe complete program for FSK. Open it only when you want the answer.

The reference program

The game's own solution. It passes every test and scores exactly par on every benchmark.

Frequency shift keying from a phase accumulator.

u1SC-2 standard

IN P2
IN P1
MUL 10
ADD 10
ADD B
MOD 100
MOV B, A
DIV 50
OUT P0
CYCLES
712
at par
ENERGY
1424
at par
NODES
1
at par
INSTRUCTIONS
9
at par