Traffic Light
Finite State Machine Exercise
Task
Light the three LEDs one at a time: red on PA0, then yellow on PA1, then green on PA2. Run the sequence twice, then leave all three off. The registers and bit fields are on the Datasheet tab.
Circuit
Pass condition
Each light goes out before the next one comes on, in the order red, yellow, green. There are twelve edges, four per pin. Timing is not graded.
Notes
This question needs no clock enable. Your program is built and run at -O0, then again at -O2, and must pass both.