Hello everybody,
It took me some hours of fun making this simple project. It turned out - after understanding the PSoC - that both the PSoC Creator the Pioneer board are easy to use and offer great flexibility - as they claim.
The project is an exercise - and should be treated as such - on the schematic editor of the PSoC Creator.
Two LEDs are flashing on 8Hz in an alternating manner, resembling a police car's emergency lights:
- 3 flashes RED
- 3 flashes BLUE
- repeat
The LEDs are configured on standard outputs:
P1.6 RED
P0.3 BLUE
All the rest is done by the hardware, no software needed.
The flashing hardware is a state machine with 12 states, sinthesized previously on paper by hand.
The LED's final states are decoded by the last two NAND gates.
The big deal was to synthesize the D inputs of each FF. The result:
D0 = NOT Q0
D1 = Q1 XOR Q0
D2 = ((NOT Q3) AND (Q2 XOR (Q1 AND Q0))) OR (Q2 AND (NOT Q1) AND (NOT Q0)) OR (Q3 AND Q1 AND Q0)
D3 = (Q3 AND (NOT Q2)) OR (Q2 AND (Q3 AND (NOT Q1) AND (NOT Q0)) OR ((NOT Q3) AND Q1 AND Q0))
And finally the two LEDs:
R_LED = Q0 NAND Q3
B_LED = Q0 NAND (NOT Q3)
Building the project yields to the following hardware usage:
Flash used: 1200 of 32768 bytes (3.7 %).
SRAM used: 228 of 4096 bytes (5.6 %).
Regards,