Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Product List
PWM and Timer Applications Slide 6

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”.

PTM Published on: 2014-03-20