DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
426 of 571
NXP Semiconductors
UM10316
Chapter 24: LPC29xx Modulation and Sampling Control Subsystem
•
Capture inputs to measure time between events
•
Synchronization between several PWM signals
•
Synchronization between ADCs
•
Synchronization between PWMs and ADCs
•
Timed and synchronized renewal of settings
•
Interrupt generation for a wide range of events
In the next paragraphs, a number of possible applications are described.
3.1 Continuous level measurement
To measure voltages with constant intervals, MSCSS_Timer0 can be configured to
generate pulses with constant intervals. Using the match outputs and trigger inputs of the
ADC, these pulses can be used to start the ADC. If the ADC is configured to run once on
the trigger it delivers the output value after conversion and waits for the next trigger.
Remark:
There is no built-in mechanism to avoid over-triggering of the ADC, so the user
has to configure the triggers in such a way that the triggering rate does not exceed the
capabilities of the ADC. Note also that is possible to start the second ADC with the
sync_out of the first ADC, but since sync_out is triggered on scan-complete this is not the
recommended method.
3.2 Comparator functionality
Since the ADC has a compare functionality it can run continuously without reading the
sampled values, but as soon as the sampled value exceeds a certain threshold an
interrupt is generated to the processor. This reduces load on the processor since no
polling loop needed.
The sample speed can be set by adjusting the parameter adc_clk or by using
MSCSS_Timer0 to trigger the ADC. With MSCSS_Timer0 it is possible to set up the
sample speed for each ADC individually: adc_clk influences all ADCs.
Remark:
The above comparison is done on unfiltered data, so it can be inaccurate if no
external filtering is done on the analog signal.
3.3 Dimmer using PWMs
The PWM can be used as a dimmer for lighting for example. Since the voltage produced
by the generator of the car varies with the load of the engine and load of the generator, the
illumination varies accordingly. Voltage on the power lines for lighting can thus be steered
using the PWM to have a constant illumination, or adjusted to certain levels.
Not applying the full power of the generator to the lighting bulbs but a constant 12 V
instead considerably extends bulb lifetime.
For checking the voltage the ADCs can be used, as in the level-monitoring described in
3.4 Generating sine waves
For several applications it can be useful to generate a sine wave without having a high
processor load.