Motorola MPC533 Reference Manual page 796

Table of Contents

Advertisement

MIOS14 Function Examples
can read registers A and B2 coherently (using a 32-bit read instruction) at any time, to get
the latest edge measurements. The software work is less than half that needed with a timer
that requires the software to read one edge and save the value and then wait for the second
edge.
MIOS14 Modulus Counter Submodule
From
Prescaler
or Pin
Clock
16-bit Up-Counter
Select
Figure 17-42. MIOS14 Example: Double Capture Pulse Width Measurement
17.13.2
MIOS14 Input Double Edge Period Measurement
Two samples are available to the software from an MIOS14 double action submodule for
period measurement. The software can read the previous and the current edge samples and
subtract them. As with pulse width measurement, the software can be sure not to miss
samples by ensuring that the interrupt response time is faster than the fastest input period.
Alternately, when the software is just interested in the latest period measurement, one 32-bit
coherent read instruction can get both the current and the previous samples. Depending on
the prescaler divide ratio, period times can be measured from 50 ns to 6.7 s.
Figure 17-43 shows a counter submodule and a DASM combination as an example of
period measurement. The software designates whether the rising or falling edge of the input
signal is to be used for the measurements. When the edge is detected, the state of the 16-bit
counter bus is stored in register A and the content of register B1 is transferred to register
B2. After register B2 is safely latched, the content of register A is transferred to register B1.
This procedure gives the software coherent current and previous samples in registers A and
B2 at all times. An interrupt is available for the cases where the software needs to be aware
of each new sample. Note that a software option is provided to also generate an interrupt
after the first edge.
17-72
PRELIMINARY—SUBJECT TO CHANGE WITHOUT NOTICE
MIOS14 Double Action Submodule
in IPWM mode (MOD3-MOD0 = 0b0001)
Two
16-bit
Counter
Buses
16-bit Register A
Bus
Select
16-bit Register B1
16-bit Register B2
Submodule Bus
MPC533 Reference Manual
Input
Signal
Edge
Detect
Input
Capture
Interrupt
on
Trailing
Edge
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpc534

Table of Contents