Page 37
| EM78P458/459 |
| OTP ROM |
| |
CONTW | |
MOV A, @0B00000000 | ; To employ Vdd as the reference voltage, to define P60 as |
IOW ADCONC | ; an analog input and set clock rate at fosc/4 |
En_ADC: | |
MOV A, @0BXXXXXXX1 | ; To define P60 as an input pin, and the others are dependent |
IOW PORT6 | ; on applications |
MOV A, @0B01000101 | ; To enable the OP1, and set the gain as 32 |
IOW GCON | |
BS ADCONR, ADPD | ; To disable the power-down mode of ADC |
ENI | ; Enable the interrupt function |
BS ADCONR, ADRUN | ; Start to run the ADC |
;If the interrupt function is employed, the following three lines may be ignored
POLLING:
JBC ADCONR, ADRUN | ; To check the ADRUN bit continuously; |
JMP POLLING | ; ADRUN bit will be reset as the AD conversion is completed |
(User program) | |
: | |
: | |
: | |
4.8 Dual Sets of PWM ( Pulse Width Modulation )
1. Overview
In PWM mode, both PWM1 and PWM2 pins produce up to a 10-bit resolution PWM output (see. Fig. 13 for the functional block diagram). A PWM output has a period and a duty cycle, and it keeps the output in high. The baud rate of the PWM is the inverse of the period. Fig. 14 depicts the relationships between a period and a duty cycle.
This specification is subject to change without prior notice. | 37 | 07.01.2003 (V1.3) |
Contents
BIT MICRO-CONTROLLER
EM78P458/459
Application Note
EM78P458/459
General Description
Features
EM78P458/459
PIN Assignment
EM78P459 Pin Description
Operational Registers
Function Description
R0 Indirect Addressing Register
R1 Time Clock /Counter
Program Counter Organization
R4 RAM Select Register
R3 Status Register
R5 ~ R6 Port 5 ~ Port
R7 ~ R8
Data Memory Configuration
RA Addata the converted value of ADC
R9 Adcon Analog to Digital Control
10. RB
11. RC
13. RE
Special Purpose Registers
RF Interrupt Status Register
15. R10 ~ R3F
IOC50 ~ IOC60 I/O Port Control Register
Control Register
Inte INT PAB PSR2 PSR1 PSR0
Bit 0 PSR0 ~ Bit 2 PSR2 TCC/WDT prescaler bits
OP2E OP1E
IOC90 Gcon I/O Configuration & Control of ADC
Vrefs COE IMS2 IMS1 IMS0 CKR1 CKR0
IOCB0 Pull-down Control Register
Description of AD Configuration Control Bits
Bit4Bit2 IMS2IMS0
IMS2IMS0
IOCD0 Pull-high Control Register
IOCC0 Open-Drain Control Register
IOCF0 Interrupt Mask Register
IOCE0 WDT Control Register
Wdte EIS
Cmpie PWM2IE PWM1IE Adie Exie Icie Tcie
PWM2E PWM1E T2EN T1EN
IOC51 Pwmcon
CALI1 SIGN1
IOC81 PRD1 Period of PWM1
Bit 5Bit 3 VOF12VOF10 Offset voltage bits
CALI2 SIGN2
Bit 5Bit 3 VOF22VOF20 Offset voltage bits
IOCB1 PRD2 Period of PWM2
TCC/WDT & Prescaler
I/O Ports
Block Diagram of TCC and WDT
Ccircuit of I/O Port and I/O Control Register for Port
Circuit of I/O Port and I/O Control Register for P60~P67
Function of Reset and Wake-up
Reset and Wake-up
Usage of Port 6 Input Changed Wake-up/Interrupt Function
Contw CLR R1
Status of T, and P of Status Register
Status of RST, T and P being Affected by Events
Values of RST, T, and P after Reset
Interrupt
Interrupt Input Circuit
Analog-To-Digital Converter ADC
BIT Symbol Vrefs COE IMS2 IMS1 IMS0 CKR1 CKR0
BIT Symbol Iocs Adrun Adpd ADIS2 ADIS1 ADIS0
ADC Control Register ADCON/R9, AD-CMP-CON/IOCA0, GCON/IOC90
ADCON/R9
CKR1 and CKR0 Bit 1 and Bit 0 The conversion time select
ADC Data Register ADDATA/RA
GCON/IOC90
Shows the Gains and the Operating Range of ADC
D Sampling Time
D Operation During Sleep Mode
D Conversion Time
Programming Steps/Considerations
CINT== 0XF
Demonstration Programs
Iocs Adrun Adpd ADIS2 ADIS1 ADIS0
Overview
Dual Sets of PWM Pulse Width Modulation
Functional Block Diagram of the Dual PWMs
Increment Timer Counter Tmrx TMR1H/TWR1L or TMR2H/TWR2L
PWM Period Prdx PRD1 or PRD2
PWM Programming Procedures/Steps
Comparator
Period = Prdx + 1 * 4 * 1/Fosc * Tmrx prescale value
Function description
Timer
TMR1X and TMR2X TMR1H/TWR1L and TMR2H/TMR2L
Prdx PRD1 and PRD2 PWM period register
External Reference Signal
Timer programming procedures/steps
Comparator
Programming the Related Registers
Wake-up from Sleep Mode
Using as An Operation Amplifier
Interrupt
Summary of the Initialized Values for Registers
Initialized Values after Reset
CALI1 SIGN1
Oscillator Modes
Oscillator
Summary of Maximum Operating Speeds
Crystal Oscillator/Ceramic Resonators Xtal
EM78P458
EM78P459
LXT
HXT
EM78P458 EM78P459
Vdd
External RC Oscillator Mode
EM78P458 EM78P459 Vcc Rext
RC Oscillator Mode with Internal Capacitor
External Power on Reset Circuit
Power-on Considerations
Residue-Voltage Protection
EM78P458 EM78P459 Rin
Enwdt Clks PTB HLF RCT HLP
Code Option Register Word
Bit 11 ~ Bit 9 VOF22~VOF20 Offset voltage bits
Bit 5 ~ Bit 0 ID5~ID0 Customer’s ID
List of the instruction set of EM78P458/459
Instruction Set
ADD A,R
Reset Timing CLK=0
Timing Diagrams
AC Test Input/Output Waveform
TCC Input Timing CLKS=0
Absolute Maximum Ratings
Crystal type, two clocks
Electrical Characteristics
AC Electrical CharacteristicTa=0C ~ 70 C, VDD=5V±5%, VSS=0V
ComparatorOP CharacteristicVdd = 5.0V,Vss=0V,Ta=0 to
IVR
Package Types
Appendix
OTP MCU
DIP