86
78K/0 SERIES APPLICATION NOTE
5.3.2 Remote Control Reception by PWM Output and Free Running
In this program, the valid pulse widths when the remote control signal is the received signal are shown
in Table 5-2. The processing methods for each signal are explained in
<1>
to
<6>
.
Table 5-2. Valid Time of the Input Signal
Signal name
Output time
Valid time
Leader code (low)
9 ms
3 ms-10 ms
Leader code (high)
Normal
4.5 ms
3 ms-5 ms
Repeat
2.25 ms
1.8 ms-3 ms
Custom code/data code
0
1.125 ms
0.5 ms-1.8 ms
1
2.25 ms
1.8 ms-2.5 ms
<1> Leader code (low)
An interrupt request during the detection of the falling edge of INTP0 causes the 16-bit capture
register (CR01) value to be saved in memory. When the rising edge occurs, the pulse width
is measured from the difference with the 16-bit compare register (CR00).
<2> Leader code (high)
Based on an interrupt request due to the falling edge of INTP0, the pulse width during the high
level of the leader code is measured by the timer count.
<3> Custom/data code
Based on an interrupt request due to the falling edge of INTP0, the pulse width is measured
for each bit (1 period). After the 32nd bit of data is read in, test for a match of the inverse data
and custom code. Furthermore, the absence of a 33rd bit of data is verified.
<4> Repeat code detection
When the high level of the leader code is less than 3 ms, the pulse width is measured until the
rising edge of INTP0 after the leader code output.
<5> Valid time for repeat code
After valid data input, the overflow flag (OVF0) of the 16-bit timer/event counter is tested in
the main program. A valid time of 250 ms for the repeat code is measured.
<6> Time out during pulse width measurement
The OVF0 of the 16-bit timer/event counter during pulse width measurement is tested in the
main program. When detected twice, a time out occurs and data becomes invalid.
Because the 16-bit timer/event counter in this example is operated in the PWM output mode,
by linking the program shown in
Section
5.2
, remote control reception and PWM output can
be simultaneously executed.