MC5000_DevKit

An hardware puzzle that teaches the basics of programming.

View on GitHub

home « prev level To be continued…

Level 6

The customer TrafficControl Inc. wants you to create a new control mechanism for their pedestrian traffic lights.

Specification

Help

Cable connections
  • MCU1-P0 -> Button1
  • MCU1-P1 -> Red LED
  • MCU1-X0 -> Display
  • MCU1-X1 -> MCU2-X0
  • MCU1-P0 -> Green LED
  • MCU1-P1 -> Yellow LED

Hints
  • MCU2 should control the green and yellow LEDs when MCU1 sends an XBus signal
  • MCU1 displays the countdown in a loop and then sends the signal to MCU2
  • After sending the signal MCU1 waits for an XBus signal from MCU2 to switch back to red

Solution

MCU1

start:
mov 100 p1
teq p0 100
- jmp start
mov 10 acc
loop:
sub 1
mov acc x0
slp 4
tgt acc 0
+ jmp loop
mov 1 x1
slp 4
mov 0 p1
mov x1 dat

MCU2

teq x0 1
+ mov 100 p1
+ slp 5
+ mov 0 p1
+ mov 100 p0
+ slp 30
+ mov 0 p0
+ mov 100 p1
+ slp 5
+ mov 0 p1
+ mov 0 x0