EM78P458/459
OTP ROM
3. Programming the Related Registers
When defining TMRX, refer to the related registers of its operation as shown in Table 9.It must be
noted that the PWMX bits must be disabled if their related TMRXs are employed. That is, bit 7 and bit
6 of the PWMCON register must be set to ‘0’.
Table 10 Related Control Registers of TMR1 and TMR2
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3 Bit 2
Bit 1 Bit 0
IOC51 PWMCON/IOC51 PWM2E PWM1E T2EN T1EN T2P1 T2P0 T1P1 T1P0
4. Timer programming procedures/steps
(1) Load PRDX with the TIMER period.
(2) Enable interrupt function by writing IOCF0, if required
(3) Load a desired value to PWMCON with the TMRX prescaler value and enable both TMRX and
disable PWMX.
4.10 Comparator
EM78P458/459 has one comparator, which has two analog inputs and one output. The comparator
can be employed to wake up from the sleep mode. Fig. 16 shows the circuit of the comparator.
Cin-
-
CO
CMP
Cin+
+
Fig. 16 Comparator Operating Mode
1. External Reference Signal
The analog signal that is presented at Cin- compares to the signal at Cin+, and the digital output (CO)
of the comparator is adjusted accordingly.
• The reference signal must be between Vss and Vdd.
• The reference voltage can be applied to either pi of comparator.
• Threshold detector applications may be of the same reference.
• The comparator can operate from the same or different reference source.
2. Comparator Outputs
• The compared result is stored in the CMPOUT of R3.
• The comparator outputs is output to P57 by programming bit5<COE> of the AD-CMPCON register
to 1.
This specification is subject to change without prior notice.
41
06.25.2004 (V1.4)