Simulator Traffic LightsOpen a browser window or tab containing the microcontroller simulator.

Copy and paste this program into the code editing area. Press F8 to assemble the code.

Click the TRAFFIC button on the highlighted "C" to connect the traffic Lights to PORTC.
If necessary, drag the lights to a more visible position.

Step the program and watch the traffic lights. Answer the reviseOmatic questions on this task.

This program should run unaltered on the PICAXE 28X1 chip.
Time delays will need to be added or the lights will flash in a continuous blur.
Remember to use LED current limiting resistors in the interface.


TASK: Work out the correct numbers needed to control the traffic lights. Use the grid below to design the correct number sequence.

; ===== CONNECT TRAFFIC LIGHTS TO PORTC =====
        MOVW    0x00
        MOVWR   TRISC
START:
        MOVW    0x55    ; This number is wrong
        MOVWR   PORTC

        MOVW    0xA     ; This number is wrong
        MOVWR   PORTC

        MOVW    0xC     ; This number is wrong
        MOVWR   PORTC

        MOVW    0x2     ; This number is wrong
        MOVWR   PORTC

        JMP     START

You can use this grid to help design the correct hexadecimal numbers.

Design Grid