Renesas M16C/64A Series User Manual page 811

Table of Contents

Advertisement

M16C/64A Group
32.16 Notes on Remote Control Signal Receiver
32.16.1 Starting/Stopping PMCi
The EN bit in the PMCiCON0 register controls the start/stop of PMCi. The ENFLG bit in the PMCiCON2
register indicates that operation started/stopped.
The PMCi circuit starts operating by setting the EN bit to 1 (operation enabled) and the ENFLG bit
becomes 1 (operating). After setting the EN bit to 1, it takes up to two cycles of the count source before
the ENFLG bit becomes 1.
When the EN bit is set to 0 (operation disabled), the PMCi circuit stops operating and the ENFLG bit
becomes 0 (operation stopped). After setting the EN bit to 0, it takes up to one cycle of the count source
before the ENFLG bit becomes 0.
Between setting the EN bit to 1 and the ENFLG bit becoming 1, and while the ENFLG bit is 1, do not
access bits in the PMCi associated registers (registers listed in Table 22.3 and Table 22.4 "Registers")
except for the ENFLG bit.
32.16.2 Reading the Register
When the following registers are read while data changes, an undefined value may be read.
Flags in registers PMCiCON2 and PMCiSTS
Registers PMCiTIM, PMC0DAT0 to PMC0DAT5, and PMC0RBIT
Follow the procedures below to avoid reading an undefined value.
In pattern match mode
Using an interrupt
Set the DRINT bit in the PMCiINT register to 1 (data reception complete interrupt enabled) and
read the registers within the PMCi interrupt routine.
Monitoring by a program 1
Set the DRINT bit in the PMCiINT register to 1 (data reception complete interrupt enabled) and
monitor the IR bit in the PMCiIC register by a program. Read the registers when the IR bit becomes
1 (interrupt request is generated).
Monitoring by a program 2
(1) Monitor the DRFLG bit in the PMCiSTS register.
(2) When the DRFLG bit becomes 1, monitor the DRFLG bit until it becomes 0.
(3) Read the necessary content of the registers when the DRFLG bit becomes 0.
In input capture mode
Using an interrupt
Set the TIMINT bit in the PMCiINT register to 1 (timer measure interrupt enabled) and read the
registers within the PMCi interrupt routine.
Monitoring by a program 1
Set the TIMINT bit in the PMCiINT register to 1 (timer measure interrupt enabled) and monitor the
IR bit in the PMCiIC register by a program. Read the registers when the IR bit becomes 1 (interrupt
request is generated).
If the register data may change at the same time as the register is read even with above
countermeasures, read the register more than once to determine whether the read value is correct.
32.16.3 Rewriting the Register
Rewrite the registers and bits related to PMC excluding the EN bit in the PMCiCON0 register when
both of the EN bit in the PMCiCON0 register and the ENFLG bit in the PMCiCON2 register are 0
(PMCi stops).
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
32. Usage Notes
Page 778 of 800

Advertisement

Table of Contents
loading

Table of Contents