* External reference voltage for ADC
* Defined by AD-CMPCON (IOCA0)<7>.
* “-“ -> the input pin of Vin- of the comparator.
I
* “+”-> the input pin of Vin+ of the comparator.
O
* Pin CO is the output of the comparator.
* Defined by AD-CMPCON (IOCA0) <5, 6>
* Real time clock/counter with Schmitt trigger input pin; it must be tied to
VDD or VSS if it is not in use.
* XTAL type: Crystal input terminal or external clock input pin.
* RC type: RC oscillator input pin.
* XTAL type: Output terminal for crystal oscillator or external clock input
pin.
* RC type: Clock output with a period of one instruction cycle time, the
prescaler is determined by the CONT register.
* External clock signal input.
* General-purpose Input only.
* Default value while power-on reset.
* General-purpose I/O pin.
I/O
* Default value while power-on reset.
* General-purpose I/O pin.
I/O
* Default value while power-on reset.
* Analog to Digital Converter.
I
* Defined by AD-CMPCON (IOCA0)<2:4>.
* Pulse width modulation outputs.
* Defined by PWMCON (IOC51)<6, 7>
* External reference voltage for ADC
* Defined by AD-CMPCON (IOCA0)<7>.
* ‘-’ -> the Vin- input pins of the comparators.
* ‘+’ -> the Vin+ input pins of the comparators.
* Pin CO is the output of the comparator.
* Defined by AD-CMPCON (IOCA0) <5, 6>
* If it remains at logic low, the device will be reset.
* Wake up from sleep mode when pins status changes.
* Voltage on /RESET/Vpp must not be over Vdd during normal mode.
* Pull-high is on if /RESET is asserted.
* Real time clock/counter with Schmitt trigger input pin; it must be tied to
VDD or VSS if it is not in use.
OTP ROM
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
7
4. FUNCTION DESCRIPTION
EM78P458/459
OTP ROM
ENTCC
Oscillator/
Timming
Control
Sleep
&
Wake Up
Control
WDT
Time-out
Prescaler
R1(TCC)
Comparators8 ADC2 PWMs
P
5
0
Fig. 2 The Functional Block Diagram of EM78P458/459
4.1 Operational Registers
IOC5
P
P
5
5
2
1
RAM
R5
P
P
P
5
5
5
5
4
3
/INT
Interrupt
Control
R4
P
P
5
5
7
6
WDT Timer
ROM
Instruction
Register
Instruction
Decoder
DATA & CONTROL BUS
P C
P
6
0
P
6
1
IOC6
R6
P
P
P
6
6
6
4
3
2
STACK 0
STACK 1
STACK 2
STACK 3
STACK 4
STACK 5
STACK 6
STACK 7
ALU
ACCR3
P
P
P
6
6
6
7
6
5
1. R0 (Indirect Addressing Register)
R0 is not a physically implemented register. Its major function is to perform as an indirect addressing
pointer. Any instruction using R0 as a pointer, actually accesses data pointed by the RAM Select
Register (R4).
2. R1 (Time Clock /Counter)
• Increased by an external signal edge through the TCC pin, or by the instruction cycle clock.
• The signals to increase the counter are decided by Bit 4 and Bit 5 of the CONT register.
• Writable and readable as any other registers.
3. R2 (Program Counter) & Stack
• R2 and hardware stacks are 12-bit wide. The structure is depicted in Fig. 4.
• Generates 4K×13 bits on-chip ROM addresses to the relative programming instruction codes. One
program page is 1024 words long.
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
8
EM78P458/459
OTP ROM
• The contents of R2 are set to all "0"s upon a RESET condition.
• "JMP" instruction allows the direct loading of the lower 10 program counter bits. Thus, "JMP" allows
PC to jump to any location within a page.
• "CALL" instruction loads the lower 10 bits of the PC, and then PC+1 is pushed into the stack. Thus,
the subroutine entry address can be located anywhere within a page.
• "RET" ("RETL k", "RETI") instruction loads the program counter with the contents of the top of stack.
• "ADD R2, A" allows a relative address to be added to the current PC, and the ninth and tenth bits of
the PC are cleared.
• "MOV R2, A" allows to load an address from the "A" register to the lower 8 bits of the PC, and the
ninth and tenth bits of the PC are cleared.
• Any instruction that is written to R2 (e.g. "ADD R2, A", "MOV R2, A", "BC R2, 6",⋅⋅⋅⋅⋅) will cause the
ninth bit and the tenth bit (A8~A9) of the PC to be cleared. Thus, the computed jump is limited to the
first 256 locations of a page.
• In the case of EM78P458/459, the most two significant bits (A11 and A10) will be loaded with the
content of PS1 and PS0 in the status register (R3) upon the execution of a "JMP", "CALL", or any
other instructions set which write to R2.
• All instructions are single instruction cycle (fclk/2 or fclk/4) except for the instructions which write to
R2, need one more instruction cycle.
A9 ~ A8A1 1~A 10A7 ~ A0
000
00
01
10
3FF
400
7FF
800
Page 0
Page 1
Page 2
CALL K
RET
RETI
RETL K
Stack 0
Stack 1
Stack 2
Stack 3
Stack 4
Stack 5
Stack 6
Stack 7
BFF
C00
11
FFF
Page 3
Fig. 3 Program Counter Organization
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
9
EM78P458/459
OTP ROM
4. R3 (Status Register)
7 6 5 4 3 2 1 0
CMPOUT PS1 PS0 T P Z DC C
• Bit 7 (CMPOUT) the result of the comparator output.
• Bit 6 (PS1) ~ 5 (PS0) Page select bits. PS0~PS1 are used to select a program memory page. When
executing a "JMP", "CALL", or other instructions which cause the program counter to be changed
(e.g. MOV R2, A), PS0~PS1 are loaded into the 11th and 12th bits of the program counter where it
selects one of the available program memory pages. Note that RET (RETL, RETI) instruction does
not change the PS0~PS1 bits. That is, the return will always be to the page from the place where the
subroutine was called, regardless of the current setting of PS0~PS1 bits.
0: increment if the transition from low to high takes place on the TCC pin;
1: increment if the transition from high to low takes place on the TCC pin.
• Bit 5 (TS) TCC signal source
0: internal instruction cycle clock. If P54 is used as I/O pin, TS must be 0.
1: transition on the TCC pin
• Bit 6 (INT) Interrupt enable flag
0: masked by DISI or hardware interrupt
1: enabled by the ENI/RETI instructions
• Bit 7 (INTE) INT signal edge
0: interrupt occurs at the rising edge on the INT pin
1: interrupt occurs at the falling edge on the INT pin
• CONT register is both readable and writable.
3. IOC50 ~ IOC60 (I/O Port Control Register)
• "1" puts the relative I/O pin into high impedance, while "0" defines the relative I/O pin as output.
• IOC50 and IOC60 registers are both readable and writable.
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
14
EM78P458/459
OTP ROM
4. IOC90 (GCON: I/O Configuration & Control of ADC )
7 6 5 4 3 2 1 0
OP2E OP1E G22 G21 G20 G12 G11 G10
• Bit 7 ( OP2E ) Enable the gain amplifier which input is connected to P64 and output is connected to
the 8-1 analog switch.
0 = OP2 is off ( default value ), and bypasses the input signal to the ADC;
1 = OP2 is on.
• Bit 6 ( OP1E ) Enable the gain amplifier whose input is connected to P60 and output is connected to
the 8-1 analog switch.
0 = OP1 is off (default value), and bypasses the input signal to the ADC;
1 = OP1 is on.
• Bit 5:Bit 3 (G22 and G20): Select the gain of OP2.
000 = IS x 1 (default value);
001 = IS x 2;
010 = IS x 4;
011 = IS x 8;
100 = IS x 16;
101 = IS x 32;
Legend: IS = the input signal
• Bit 2:Bit 0 (G12 and G10 ): Select the gain of OP1.
000 = IS x 1 (default value);
001 = IS x 2;
010 = IS x 4;
011 = IS x 8;
100 = IS x 16;
101 = IS x 32;
Legend: S = the input signal
5. IOCA0 ( AD-CMPCON ):
7 6 5 4 3 2 1 0
VREFS CE COE IMS2 IMS1 IMS0 CKR1 CKR0
• Bit 7: The input source of the Vref of the ADC.
0 = The Vref of the ADC is connected to Vdd (default value), and the P53/VREF pin carries out the
function of P53;
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
15
EM78P458/459
OTP ROM
1 = The Vref of the ADC is connected to P53/VREF.
• Bit 6 (CE): Comparator enable bit
0 = Comparator is off (default value);
1 = Comparator is on.
• Bit 5 ( COE ): Set P57 as the output of the comparator
0 = the comparator acts as an OP if CE=1.
1 = act as a comparator if CE=1.
• Bit4:Bit2 (IMS2:IMS0):
Input Mode Select. ADC configuration definition bit. The following Table describes how to define the
characteristic of each pin of R6.
Table 3 Description of AD Configuration Control Bits
IMS2:IMS0 P60 P61 P62 P63 P64 P65 P66 P67
000 A D D D D D D D
001 A A D D D D D D
010 A A A D D D D D
011 A A A A D D D D
100 A A A A A D D D
101 A A A A A A D D
110 A A A A A A A D
111 A A A A A A A A
• Bit 1: Bit 0 (CKR1: CKR0): The prescaler of oscillator clock rate of ADC
00 = 1: 4 (default value);
01 = 1: 16;
10 = 1: 64;
11 = The oscillator clock source of ADC is from WDT ring oscillator frequency.
( frequency=256/18ms≒14.2Khz)
6. IOCB0 (Pull-down Control Register)
7 6 5 4 3 2 1 0
/PD7 /PD6 /PD5 /PD4 /PD3 /PD2 /PD1 /PD0
• Bit 0 (/PD0) Control bit is used to enable the pull-down of the P60 pin.
0: Enable internal pull-down;
1: Disable internal pull-down.
• Bit 1 (/PD1) Control bit is used to enable the pull-down of the P61 pin.
• Bit 2 (/PD2) Control bit is used to enable the pull-down of the P62 pin.
• Bit 3 (/PD3) Control bit is used to enable the pull-down of the P63 pin.
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
16
EM78P458/459
OTP ROM
• Bit 4 (/PD4) Control bit is used to enable the pull-down of the P64 pin.
• Bit 5 (/PD5) Control bit is used to enable the pull-down of the P65 pin.
• Bit 6 (/PD6) Control bit is used to enable the pull-down of the P66 pin.
• Bit 7 (/PD7) Control bit is used to enable the pull-down of the P67 pin.
• IOCB0 register is both readable and writable.
7. IOCC0 (Open-Drain Control Register)
7 6 5 4 3 2 1 0
/OD7 /OD6 /OD5 /OD4 /OD3 /OD2 /OD1 /OD0
• Bit 0 (OD0) Control bit used to enable the open-drain of the P64 pin.
0: Enable open-drain output
1: Disable open-drain output
• Bit 1 (OD1) Control bit is used to enable the open-drain of the P65 pin.
• Bit 2 (OD2) Control bit is used to enable the open-drain of the P66 pin.
• Bit 3 (OD3) Control bit is used to enable the open-drain of the P67 pin.
• Bit 4 (OD4) Control bit is used to enable the open-drain of the P51 pin.
• Bit 5 (OD5) Control bit is used to enable the open-drain of the P52 pin.
• Bit 6 (OD6) Control bit is used to enable the open-drain of the P54 pin.
• Bit 7 (OD7) Control bit is used to enable the open-drain of the P57 pin.
• IOCC0 register is both readable and writable.
8. IOCD0 (Pull-high Control Register)
7 6 5 4 3 2 1 0
/PH7 /PH6 /PH5 - /PH3 /PH2 /PH1 /PH0
• Bit 0 (/PH0) Control bit is used to enable the pull-high of the P60 pin.
0: Enable internal pull-high;
1: Disable internal pull-high.
• Bit 1 (/PH1) Control bit is used to enable the pull-high of the P61 pin.
• Bit 2 (/PH2) Control bit is used to enable the pull-high of the P62 pin.
• Bit 3 (/PH3) Control bit is used to enable the pull-high of the P63 pin.
• Bit 4 Not used.
• Bit 5 (/PH5) Control bit is used to enable the pull-high of the P53 pin.
• Bit 6 (/PH6) Control bit is used to enable the pull-high of the P55 pin.
• Bit 7 (/PH7) Control bit is used to enable the pull-high of the P56 pin.
• IOCD0 register is both readable and writable.
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
17
EM78P458/459
OTP ROM
9. IOCE0 (WDT Control Register)
7 6 5 4 3 2 1 0
WDTE EIS - - - - - -
• Bit 7 (WDTE) Control bit is used to enable Watchdog Timer.
0: Disable WDT;
1: Enable WDT.
WDTE is both readable and writable
• Bit 6 (EIS) Control bit is used to define the function of the P50 (/INT) pin.
0: P50, input pin only;
1: /INT, external interrupt pin. In this case, the I/O control bit of P50 (bit 0 of IOC50) must be set to
"1".
When EIS is "0", the path of /INT is masked. When EIS is "1", the status of /INT pin can also be read
by way of reading Port 5 (R5). Refer to Fig. 7.
EIS is both readable and writable.
• Bits 0~5 Not used.
10. IOCF0 (Interrupt Mask Register)
7 6 5 4 3 2 1 0
- CMPIE PWM2IE PWM1IE ADIE EXIE ICIE TCIE
• Bit 0 (TCIE) TCIF interrupt enable bit.
0: disable TCIF interrupt
1: enable TCIF interrupt
• Bit 1 (ICIE) ICIF interrupt enable bit.
0: disable ICIF interrupt
1: enable ICIF interrupt
• Bit 2 (EXIE) EXIF interrupt enable bit.
0: disable EXIF interrupt
1: enable EXIF interrupt
• Bit 3 (ADIE) ADIF interrupt enable bit.
0: disable ADIF interrupt
1: enable ADIF interrupt
• Bit 4 (PWM1IE) PWM1IF interrupt enable bit.
0: disable PWM1 interrupt
1: enable PWM1 interrupt
This specification is subject to change without prior notice. 07.01.2003 (V1.3)
18
Loading...
+ 42 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.