A more involved example of the SCTimer/PWM is a Traffic Light application. NXP’s LPCOpen software library provides the source code for both the LPC1800 and LPC4300 series targeting the available demonstration board platforms. The source code is a subset of the example described here, and configures the Timer hardware to operate without overhead to the CPU. A traffic light demonstrates the use of Timer resources that control the on-time of both the pedestrian lights and the car lane lights, which operate on a regular interval until interrupted. Match registers hold the interval time for each signal, while Events are used to set the appropriate light on or off. State transitions keep the car lane and pedestrian lane synchronized to the defined Events. An external trigger provided by the pedestrian request button alters the flow of the traffic lane’s normal sequence by changing the time waiting for the pedestrian red to green signal transition. This example shows how the resources of the SCTimer/PWM are easily configured, allowing the user to extend the concepts to new applications. LPCOpen can be downloaded from “lpcware.com”.