Syscall 2: Firmware, home

BenchChapter 8: Scarcity

B57LOW SIDE

The task

M1 is a MOSFET switch. While P0 holds its gate high, M1 connects the LED to ground.

V1 powers the LED, not the chip. P1 ticks every 20 cycles.

Flash short, then long: lit one tick, dark one, lit two, dark two, and repeat.

The board

The chip of LOW SIDEChip u1 with 2 ports: P0 digital out, reaching R1, M1; P1 timer 20 cycles.u1CHIP SC-2P0DIGITAL OUTR1, M1P1TIMER 20 CYCLES
The chip's ports, each with its kind and the parts its signal reaches. Cyan reads, lemon writes.
Sources
V1 5 V
Resistors
R1 1 kΩ and R2 330 Ω
LEDs
D1 green
Transistors
M1, an N channel MOSFET
Probes
CH1

Key idea

P0 high lights the LED. CH1 sits low while M1 conducts.

Hints

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

Hint 1Show

Each OUT holds until the next, so the long flash is just one more sleep.

Hint 2Show

Sleep, write 1, sleep, write 0, sleep, write 1, sleep twice, write 0, sleep.

Solution

Reveal the Full SolutionThe complete program for LOW SIDE. 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.

A MOSFET switches the LED's own supply: short, then long.

u1SC-2 standard

IN P1
MOV A, 1
OUT P0
IN P1
MOV A, 0
OUT P0
IN P1
MOV A, 1
OUT P0
IN P1
IN P1
MOV A, 0
OUT P0
IN P1
CYCLES
56
at par
ENERGY
112
at par
NODES
1
at par
INSTRUCTIONS
14
at par