MX10E8050IPC [Macronix]
On-chip Flash program memory with in-system programming; 片内Flash程序存储器,具有在系统编程型号: | MX10E8050IPC |
厂家: | MACRONIX INTERNATIONAL |
描述: | On-chip Flash program memory with in-system programming |
文件: | 总88页 (文件大小:1007K) |
中文: | 中文翻译 | 下载: | 下载PDF数据表文档文件 |
PRELIMINARY
MX10E8050I /
MX10E8050IA
Major Difference
Product
Feature
Default
ISP
IAP
Package
Clock mode
MX10E8050IPC
MX10E8050IQC
MX10E8050IUC
44 Pin PDIP
44 Pin PLCC
44 Pin LQFP
6
UART
YES
MX10E8050IAQC
6
I2C
YES
44Pin PLCC
P/N:PM0887
Specifications subject to change without notice, contact your sales representatives for the most update information.REV. 1.6, MAR. 28, 2005
1
PRELIMINARY
MX10E8050I /
MX10E8050IA
FEATURES
- 80C51 CPU core
-Threestandard16-bitTimers
- 3.0 ~ 3.6V voltage range
- On-chip Flash program memory with in-system
programming ( ISP )
- Operating frequency up to 40MHz (12x), 20MHz(6x)
- 64K bytes Flash memory for code memory
- 1280 bytes internal data RAM
- Low power consumption
- Code and data memory expandable to 64K Bytes
- Four 8 bit and one 4 bit general purpose I/O ports
- In - Application Programming( IAP ) capability
- On-chip WatchDog Timer
- Four channel PWM outputs/4bit general purpose I/O
ports ( PLCC & LQFP only )
- UART
- 7 interrupt sources with four priority level
- 5 volt tolerant input
- 400kb/s I2C
- 6x / 12x clock mode
PIN Configurations
6
1
40
7
39
PLCC44
17
29
18
Pin Function
28
Pin Function
Pin Function
31
32
33
34
35
36
37
38
39
40
41
42
43
44
P2.7/A15
PSEN
ALE
P4.1/PWM1
EA
P0.7/AD7
P0.6/AD6
P0.5/AD5
P0.4/AD4
P0.3/AD3
P0.2/AD2
P0.1/AD1
P0.0/AD0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
P4.2/PWM2
P1.0/T2
P1.1/T2EX
P1.2
P1.3
P1.4
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
P3.4/T0
P3.5/T1
P3.6/WR
P3.7/RD
XTAL2
XTAL1
V
SS
P4.0/PWM0
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P1.5
P1.6/SCL
P1.7/SDA
RST
P3.0/RxD
P4.3/PWM3
P3.1/TxD
P3.2/INT0
P3.3/INT1
V
CC
P/N:PM0887
Specifications subject to change without notice, contact your sales representatives for the most update information. REV. 1.6, MAR. 28, 2005
2
PRELIMINARY
MX10E8050I /
MX10E8050IA
44
34
VCC
(T2) P1.0
(T2EX) P1.1
P1.2
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
1
1
33
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
P0.4 (AD4)
P0.5 (AD5)
P0.6 (AD6)
P0.7 (AD7)
EA
2
3
LQFP44
P1.3
4
P1.4
5
11
23
P1.5
6
(SCL)P1.6
(SDA)P1.7
RESET
7
8
12
Pin Function
22
9
(RXD) P3.0
(TXD)P3.1
(INT0) P3.2
(INT1) P3.3
(T0) P3.4
(T1) P3.5
(WR) P3.6
(RD) P3.7
XTAL2
10
11
12
13
14
15
16
17
18
19
20
Pin Function
Pin Function
1
2
3
P1.5
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
V
31
32
33
34
35
36
37
38
39
40
41
42
43
44
P0.6/AD6
P0.5/AD5
P0.4/AD4
P0.3/AD3
P0.2/AD2
P0.1/AD1
P0.0/AD0
ALE
SS
P1.6/SCL
P1.7/SDA
RST
P4.0/PWM0
P2.0/A8
P2.1/A9
P2.2/A10
P2.3/A11
P2.4/A12
P2.5/A13
P2.6/A14
P2.7/A15
PSEN
PSEN
P2.7 (A15)
P2.6 (A14)
P2.5 (A13)
P2.4 (A12)
P2.3 (A11)
P2.2 (A10)
P2.1 (A9)
P2.0 (A8)
4
5
6
7
8
P3.0/RxD
P4.3/PWM3
P3.1/TxD
P3.2/INT0
P3.3/INT1
P3.4/T0
V
CC
P4.2/PWM2
P1.0/T2
P1.1/T2EX
P1.2
P1.3
P1.4
9
10
11
12
13
14
15
P3.5/T1
XTAL1
P3.6/WR
P3.7/RD
XTAL2
ALE
P4.1/PWM1
EA
VSS
XTAL1
P0.7/AD7
Table. 1 Pin Description
Package Type
I/O SYMBOL
I/O P0.0-P0.7
I/O P2.0-P2.7
I/O P1.0-P1.7
PDIP PLCC
PIN PIN
LQFP
PIN
DESCRIPTION
Port:8-bit open drain bidirectional I/O Port
39-32 43-36
21-28 24-31
37-30
18-25
40-44,1-3
Port:8-bitquasi-bidirectionalI/OPortwithinternalpull-up
Port:8-bitquasi-bidirectionalI/OPortwithinternalpull-up
, except P1.6 and P1.7
1-8
2-9
I/O P3.0-P3.7
I/O P4.0~P4.3/
10-17 11,13-19
5,7-13
Port:8-bitquasi-bidirectionalI/OPortwithinternalpull-up
NA
9
23,34,1,12 17,28,39,6 4bit Quasi-bidirectional I/O port or PWM PWM0~PWM3
I
RESET
VCC
10
44
22
21
20
32
33
35
4
reset input
I
40
20
19
18
29
30
31
38
16
15
14
26
27
29
Positive power supply
Ground
I
VSS
I
XTAL1
XTAL2
PSEN
ALE
XTAL connection input
XTAL connection output
Program store enable output
Address latch enable output
External access input
O
O
O
I
EA
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
3
PRELIMINARY
MX10E8050I /
MX10E8050IA
Mnemonic
Pin Number
Type
Name and Function
PDIP
20
PLCC
LQFP
16
Vss
Vcc
22
44
I
I
Ground: 0 volt reference
40
38
Power Supply: This is the power supply voltage for normal,
idle and power-down operation
P0.0 ~ 0.7
P1.0~1.7
39-32
43-36
37-30
I/O
I/O
Port 0: Port 0 is an open drain, bi-directional I/O port. Port 0
pins have 1s written to them float and can be used as high
impedance inputs. Port 0 is also the multiplexed low-order
address and data bus during accessed to external program
and data memory. In this application, it uses strong internal
pull-ups when emitting 1s.
1-8
2-9
40-44
1-3
Port1: Port 1 is an 8-bit bi-directional I/O port with internal
pull-ups. Port 1 pins that have 1s written to them are pulled
high by the internal pull-ups and can be used as inputs. As
inputs, Port 1 pins that are externally pulled low will source
current because of the internal pull-ups. Note that P1.6 and
P1.7 are open drain pins for I2C function.
Alternate functions for port 1 include:
1
2
2
3
40
41
I/O
I
T2(P1.0): Timer/Counter 2 external count input/clock out
T2EX(P1.1):Timer/Counter 2 Reload / Capture /Direction
control
3
4
42
43
44
1
I
SDA (P1.7): Data line for I2C
SCL (P1.6): Clock line for I2C
4
5
I/O
I/O
I/O
I/O
I/O
I/O
5
6
6
7
7
8
2
8
9
3
P2.0~2.7
21-28
24-31
18-25
Port 2 : Port 2 is an 8-bit bi-directional I/O port with internal
pull-ups. Port2 pins that have 1s written to them are pulled
high by the internal pull-ups and can be used as inputs. As
inputs, Port 2 pins that are externally pulled low will source
current because of the internal pull-ups. Port 2 emits the high
ordered address byte during fetches from external program
memory and during accesses to external data memory that
use 16-bit addresses (MOVX @DPTR). In this application, it
uses strong internal pull-ups when emitting 1s. During
accesses to external data memory using 8-bit addresses
(MOVX@RI), port 2 emits the contents of P2 special
`function register.
P3.0~3.7
10-17
11,
5,
I/O
Port 3: Port 3 is an 8-bit bi-directional I/O port with internal
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
4
PRELIMINARY
MX10E8050I /
MX10E8050IA
13-19
7-13
pull-ups. Port 3 pins that have 1s written to them are pulled
high with the internal pull-ups and can be used as inputs. As
inputs, Port 3 pins that are externally pulled low will source
current because of the internal pull-ups. Port 3 also serves
the special features of MX10E8050I family, as listed below:
RxD (P3.0) : Serial input port
10
11
12
13
14
15
16
17
11
13
14
15
16
17
18
19
5
I
7
O
I
TxD (P3.1) : Serial output port
8
INT0 (P3.2) : External interrupt 0
9
I
INT1 (P3.3) : External interrupt 1
10
11
12
14
I
T0 (P3.4) : Timer 0 external input
I
T1 (P3.5) : Timer 1 external input
O
O
I/O
WR (P3.6) : External data memory write strobe
RD (P3.7) : External data memory read strobe
Port 4: Port 4 is an 4-bit bi-directional I/O port with internal
pull-ups. Port 4 pins that have 1s written to them are pulled
high with the internal pull-ups and can be used as inputs. As
inputs, Port 4 pins that are externally pulled low will source
current because of the internal pull-ups. Port 4 also serves
the special features of MX10E8050I family, as listed below:
PWM0 (P4.0) : PWM module output 0
P4.0~P4.3
P4.0
P4.1
P4.2
P4.3
RST
23
34
1
17
28
39
6
I
I
I
I
I
PWM1 (P4.1) : PWM module output 1
PWM2 (P4.2) : PWM module output 2
12
10
PWM3 (P4.3) : PWM module output 3
9
4
Reset : A high on this pin for eight machine cycles while the
oscillator is running, reset the devices.
ALE
30
33
27
O
Address Latch Enable: Output pulse for latching the low byte
of the address during an access to external memory. In
normal operation, ALE is emitted at constant rate of 1/6 the
oscillator frequency in 12x clock mode. 1/3 the oscillator
frequency in 6x clock mode, and can be used for external
timing or clocking. Note that one ALE pulse is skipped during
each access to external data memory.
PSEN
29
31
32
35
26
15
O
Program Strobe Enable:The read strobe to external program
memory. When executing code from external program
memory, PSEN is activated twice each machine cycle.,
except the two PSEN activation are skipped during each
access to external data memory. PSEN is not activated
during fetch from internal program memory.
EA
I
External Access Enable/ Programming Supply Voltage: EA
must be external held low to enable the device to fetch code
from external program memory locations 0000H and FFFFH
for 64 K devices.
XTAL 1
19
18
21
20
15
14
I
Crystal 1: Input to the inverting oscillator amplifier and input
to the internal clock generator circuits.
XTAL 2
O
Crystal 2: Output from the inverting oscillator amplifier.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
5
PRELIMINARY
MX10E8050I /
MX10E8050IA
BLOCK DIAGRAM
P4.0-P4.3
P0.0-P0.7
P2.0-P2.7
Vcc
Vss
PORT 4
PORT 0
PORT 4
LATCH
PORT 2
DRIVERS
DRIVERS
DRIVERS
PORT 0
LATCH
PORT 2
LATCH
ROM
RAM
PWM
PROGRAM
ADDR.
T3
STACK
POINTER
ACC
WATCHDOG
TIMER
REGISTER
TMP2
TMP1
BUFFER
B
REGISTER
ALU
PC
INCREMENTER
T0/T1/T2
SFRs
TIMERS
PSW
PROGRAM
COUNTER
PSEN
ALE
TIMING
DPTR
AND
EA
CONTROL
RST
PORT 1
PORT 3
LATCH
I2C
LATCH
PORT 1
Input Filter
PORT 3
OSC.
DRIVERS
Output Stage
DRIVERS
XTAL2
XTAL1
P1.0-P1.7
P3.0-P3.7
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
6
PRELIMINARY
MX10E8050I /
MX10E8050IA
FUNCTIONAL DESCRIPTION
General
TheMX10E8050ISerialisa stand-alonehigh-performanceandlowpowermicrocontrollerdesignedforuseinmany
applicationswhichneedcodeprogrammability.
The Flash EPROM offers customers to program the device themselves. This feature increases the flexibility in
many applications, not only in development stage, but also in mass production stage.
In addition to the 80C51 standard functions, the MX10E8050I Serial provides a number of dedicated hardware
functions. MX10E8050I Serial is a control-oriented CPU with on-chip program and data memory. It can execute
program with internal memory up to 64k bytes. MX10E8050I Serial has two software selectable modes of reduced
activity for power reduction Idle, and Power-down. The idle mode freezes the CPU while allowing the RAM, Timers,
serial ports, interrupt system and other peripherals to continue functioning. The Power-down mode saves the RAM
contents but freezes the oscillator causing all other chip functions to be inoperative. Power-down mode can be
terminated by an external reset ,and in addition , by either of the two external interrupts can be terminated as the
power down mode does.
MEMORY ORGANIZATION
The Central Processing Unit (CPU) manipulates operands in three memory spaces; these are the 256 bytes
internal data memory (RAM), 1k byte auxiliary data memory (AUX-RAM) and 64k byte internal MTP program memory
( FLASH ROM ).
Program Memory
The program memory address space of the MX10E8050I Serial comprises an internal and an external memory
space. The MX10E8050I Serial has 64k byte of program memory on-chip.
Program Protection
If the user choose to set security lock in MTPmemory, the program content is protected from reading out of chip.
Internal Data Memory
The internal data memory is divided into three physically separated parts: 256 byte of RAM, 1k bytes ofAUX-RAM,
and 128 bytes special function register area (SFR). These parts can be addressed as follows (see Fig.1 and Table. 2)
- RAM 0 to 127 can be addressed directly and indirectly as in the 80C51. Address pointers are R0 and R1 of
the selected register bank.
- RAM 128 to 255 can only be addressed indirectly . Address pointers are R0 and R1 of the selected register
bank.
- AUX-RAM 0 to 1023 is indirectly addressable as the external data memory locations 0 to 1023 by the
MOVXinstructions.AddresspointersareR0andR1oftheselectedregisterbankandDPTR.SFRscanonly
be addressed directly in the address range from 128 to 255.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
7
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table. 2 Internal data memory access
LOCATION
ADDRESSED
RAM 0 to 127
DIRECT and INDIRECT
INDIRECT only
RAM 128 to 255
AUX-RAM 0 to 1023
Special Function Register (SFR) 128 to 255
INDIRECT only with MOVX
DIRECT only
Fig. 1 shows the internal memory address space. Table 3 shows the Special Function Register (SFR) memory
map. Location 0 to 31 at the lower RAM area can be devided into four 8-bit register banks. Only one of these
banks may be enabled at a time. The next 16 bytes, locations 32 through 47, contain 128 directly addressable bit
locations.
The stack can be located anywhere in the internal 256 byte RAM. The stack depth is only limited by the available
internal RAM space of 256 bytes. All registers except the Program Counter and the four 8-byte register banks
reside in the SFR address space.
Five methods to access memory space are as floww :
- Register
- Direct
- Register-Indirect
- Immediate
- Base-Register plus Index-Register-Indirect.
The first three methods can be used for addressing destination operands. Most instructions have a 'destination /
source' field that specifies the data type, addressing methods and operands involved. For operations other than
MOVs, the destination operand is also a source operand.
Access to memory addresses is as follows:
- Register in one of the four 8-byte register banks through Direct or Register-Indirect addressing.
- 256 bytes of internal RAM through Direct or Register-Indirect addressing. Bytes 0-127 of internal RAM may be
only be addressed indirectly as data RAM.
- SFR through direct addressing at address location 128-255.
OVERLAPPED SPACE with different access schemes
255
127
1023
64k
Indirect
Only
SFRs
direct only
AUXILIARY
RAM
FLASH memory
through
MOVX access
Direct and
Indirect
0
0
MAIN RAM
SFRs
AUX-RAM
INTERNAL PROGRAM MEMORY
INTERNAL DATA MEMORY
Fig.1 Internal program and data memory address space
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
8
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table. 3 SFR Register Map
HIGH NIBBLE OF SFR ADDRESS
LOW
0
8
9
A
B
C
D
E
F
P0%
P1%
P2%
P3%
P4%
PSW%
ACC%
B%
11111111 11111111
11111111 11111111 11111111 00000000 00000000 00000000
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
SP
PWMC
00000111
DPL
10000000
AUXR1
00000000
DPH
00000000
PWMP3
00000000
00000000
FMCON
00000001 00000000
FMDATA PWM3
PWM2
00000000 00000000
PWMP2
00000000
PCON
IPH
00000000
00000000
IP%
TCON%
00000000 00000000
TMOD SBUF
00000000 XXXXXXXX 00000000 00000000 11111110 11111000
SCON%
IE%
T2CON%
S1CON
PDCON
00000000 00000000 00000000 00000000
SADDR SADEN T2MOD S1STA
00000000
TL0
RCAP2L
00000000 00000000
RCAP2H S1ADR
00000000 00000000 XXXXXX1X 00000000
S1DAT
00000000
TL1
EBTCON
PWMP1
00000000
TH0
TL2
PWM0
00000000
TH1
00000000
TH2
00000000
PWM1
00000000
AUXR
00000000
00000000
PWMP0
00000000
T3
00000000
11111111
NOTES :
% = Bit addressable register
x = Undefined
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
9
PRELIMINARY
MX10E8050I /
MX10E8050IA
Special Function Registers
Symbol Description
Direct
Bit Address, Symbol, or Alternative Port Function
MSB LSB
E7 E1 E0
Reset
Address
E0H
Function
00H
ACC
Accumulator
Auxiliary
E6
-
E5
-
E4
-
E3
-
E2
-
AUXR
8EH
A2H
F0H
-
EXTRAM AO
00000000B
AUXR1 Auxiliary1
-
-
ENBOOT -
-
0
-
DPS 00000000B
B
B register
F7
F6
F5
F4
F3
F2
F1
F0
00H
DPTR
Data pointer(2-byte)
Data pointer high
Data pointer low 83H
82H
DPH
DPL
00H
00H
EBTCON Enable T3
FMCON Flash control
FMDATA Flash data
EBH
E4H
E5H
EB
xxxxxx1xB
PPARAM
Bit7
AF
EA
BF
-
PALE
PCEB
POEB
PWEB
-
-
PREADYB00000001B
Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 00000000B
AE AD AC AB AA A9 A8
ET2 ES1 ES ET1 EX1 ET0 EX0 00000000B
BE BD BC BB BA B9 B8
PT2 PS1 PS PT1 PX1 PT0 PX0 x0000000B
B6 B5 B4 B3 B2 B1 B0
PT2H PS1H PSH PT1H PX1H PT0H PX0H x0000000B
IE
Interrupt Enable A8H
Interrupt priority B8H
IP
B7
-
IPH
Interrupt priority B7H
high
87
86
AD6 AD5 AD4 AD3 AD2 AD1 AD0 FFH
96 95 94 93 92 91 90
P16 P15 P14 P13 P12 P11 P10 FFH
A6 A5 A4 A3 A2 A1 A0
AD14 AD13 AD12 AD11 AD10 AD9 AD8 FFH
85
84
83
82
81
80
P0
P1
P2
P3
P4
Port 0
Port 1
Port 2
Port 3
Port4
80H
90H
A0H
B0H
AD7
97
P17
A7
AD15
B7
B6
B5
T1
B4
T0
B3
INT1 INT0 TxD RxD FFH
C3 C2 C1 C0
B2
B1
B0
RD
WR
C0H
87H
-
-
-
-
PWM3 PWM2 PWM1 PWM0 FH
PCON Power Control
SMOD1 SMOD0 -
WLE GF1 GF2 PD IDL
00xx0000B
PDCON ROM enable code F8H
Bit7
D7
Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 00000000B
D6
D5
F0
D4
D3
D2
D1
-
D0
P
PSW
Program Status Word D0H
CY
AC
DSCB
RS1 RS0 OV
000000x0B
PWMC PWM control
F1H
PWMD
PWMP
0.7
PWM3E PWM2E
DSCA
PWM1E PWM0E 1000x000B
PWMP0 Prescaler vector 0 FEH
PWMP1 Prescaler vector 1 FBH
PWMP2 Prescaler vector 2 F6H
PWMP PWMP PWMP PWMP PWMP PWMP PWMP 00000000B
0.6
0.5
0.4
0.3
0.2
0.1 0.0
PWMP
1.7
PWMP PWMP PWMP PWMP PWMP PWMP PWMP 00000000B
1.6
1.5
1.4
1.3
1.2
1.1 1.0
PWMP
2.7
PWMP PWMP PWMP PWMP PWMP PWMP PWMP 00000000B
2.6
2.5
2.4
2.3
2.2
2.1 2.0
PWMP3 Prescaler vector 3 F3H
PWMP PWMP PWMP PWMP PWMP PWMP PWMP PWMP 00000000B
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
10
PRELIMINARY
MX10E8050I /
MX10E8050IA
3.7
PWM PWM PWM PWM PWM PWM PWM PWM 00000000B
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0
PWM PWM PWM PWM PWM PWM PWM PWM 00000000B
1.7 1.6 1.5 1.4 1.3 1.2 1.1 1.0
PWM PWM PWM PWM PWM PWM PWM PWM 00000000B
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0
PWM PWM PWM PWM PWM PWM PWM PWM 00000000B
3.6
3.5
3.4
3.3
3.2
3.1 3.0
PWM0 PWM0 ratio
PWM1 PWM1 ratio
PWM2 PWM2 ratio
PWM3 PWM3 ratio
FCH
FDH
F4H
F5H
3.7
3.6
3.5
3.4
3.3
3.2
3.1
3.0
RACAP2H Timer 2 Capture High CBH
RACAP2L Timer 2 Capture Low CAH
00H
00H
SADDR Slave Address
A9H
00H
SADEN Slave address Mask B9H
00H
SBUF
Serial Data Buffer 99H
xxxxxxxxB
9F
9E
9D
9C
9B
9A
99
98
RI
SCON Serial Control
SP Stack Pointer
98H
81H
SM0/FE SM1 SM2 REN TB8 RB8 TI
00H
07H
DF
DE
DD
DC
DB
DA
AA
D9
D8
S1CON I2C Control
S1STA I2C Status
S1DAT I2C data
D8H
D9H
DAH
DBH
88H
CR2 ENS1 STA STO SI
CR1 CR0
00H
00H
S1STA.7 S1STA.6 S1STA.5 S1STA.4 S1STA.3
S1DAT.7 S1DAT.6 S1DAT.5 S1DAT.4 S1DAT.3 S1DAT.2 S1DAT.1 S1DAT.0 00H
S1ADR I2C address
S1ADR.7 S1ADR.6 S1ADR.5 S1ADR.4 S1ADR.3 S1ADR.2 S1ADR.1 GC
00H
00H
TCON
Timer Control
TF1 TR1 TF0 TR0 IE1
CF CE CD CC CB
IT1
CA
IE0
C9
IT0
C8
T2CON Timer 2 Control C8H
T2MOD Timer 2 Mode ControlC9H
TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL 00H
-
-
-
-
-
-
T2OE DCEN xxxxxx00B
TH0
TH1
TH2
TL0
TL1
TL2
Timer High 0
Timer High 1
Timer High 2
Timer Low 0
Timer Low 1
Timer Low 2
8CH
8DH
CDH
8AH
8BH
CCH
89H
FFH
00H
00H
00H
00H
00H
00H
TMOD Timer Mode
GATE C/T
M1
M0
GATE C/T
M1
M0
00H
FFH
T3
Timer 3
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
11
PRELIMINARY
MX10E8050I /
MX10E8050IA
AUXR (8EH)
EXTRAM
A0
- EXTRAM : External RAM Select Switch. Set 1 to select (MOVX) the external RAM directly.
Default is 0 to switch (MOVX) to external RAM only when the address is larger than 1k.
- AO : Turn off ALE output in internal execution mode.
( 1 : Turn off )
( 0 : Turn on )
Watchdog Timer/WDT/T3 (FFH)
- WDT consists of an 11-bit prescaler and an 8-bit timer formed by SFR T3.
EBTCON (EBH)
/EW
- /EW: After reset, /EW bit is set, and WDT is disable.
POWER CONTROL Register/PCON (87H)
SMOD1
SMOD0
X
WLE
GF1
GF0
PD
IDL
- SMOD1:Double baud rate bit for UART.
-SMOD0:Frameerrordetectionbit.
- WLE: Watchdog load enable. This flag must be set prior to loading WDT and is cleared when WDT is loaded.
- GF1/GF0: general-purpose flag bit.
-PD:Power-downbit.Settingitactivatespower-downmode.
- IDL: Idle mode bit. Setting it activates idle mode.
- The CPU & Peripheral status during 2 power saving mode:
Idle mode
OFF
Power-down mode
CPU
OFF
OFF
OFF
Int,Timer.
ON
Oscillator ckt ON
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
12
PRELIMINARY
MX10E8050I /
MX10E8050IA
I/O facilities
MX10E8050I serial has one 8 bits port, port 0, which is open drain, three 8 bits ports, port1/2/3 and a four-bits port
port 4 . They are quasi bi-directional ports except P1.6 and P1.7. These five ports are fully compatible to standard
80C51's port 0/1/2/3/4.
- Port3: pins can be configured individually to provide: external interrupt inputs (external interrupt 0/1);
external inputs for Timer/ counter 0 and Timer /counter1, and UART receive / transmit.
- Port 1.6, Port 1.7 : pins are used to be I2C clock and data I/O, which are open drain
Port pins which are not used for alternate functions may be used as normal bidirectional I/O pins. The generation or
use of a Port 1 or Port 3 pin as an alternate function is carried out automatically by writing the associated SFR bit with
proper value.
+3V
2 oscillator
penods
P2
strong pull-up
P1
P3
I/O PORT
1,2,3,4
exclude P1.6,P1.7
O
from port latch
n
input data
INPUT
BUFFER
read port pin
I/O buffers in the MX10E8050I (Ports 1,2,3,4)
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
13
PRELIMINARY
MX10E8050I /
MX10E8050IA
Timer/Counter
MX10E8050I Serial Timer/Counter 0 and 1 are fully compatible to standard 80C51's.
The MX10E8050I Serial contains two 16-bit Timer/counters, Timer 0 and Timer 1. Timer 0 and Timer 1 may be
programmed to carry out the following functions:
- measure time intervals and pulse durations
- count events
- generate interrupt requests.
Timer 0 and Timer 1
Timers 0 and 1 each have a control bit in TMOD SFR that selects the Timer or counter function of the
corresponding Timer. In theTimer function, the register is incremented every machine cycle. Thus, one can think of
it as counting machine cycles. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of
the oscillator frequency.
In the counter function, the register is incremented in response to a HIGH-to-LOW transition at the corresponding
samples, when the transition shows a HIGH in one cycle and a LOW in the next cycle, the counter is incremented.
Thus, it takes two machine cycles (24 oscillator periods) to recognize a HIGH-to-LOW transition. There are no
restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once
before it changes, it should be held for at least one full machine cycle.
Timer 0 and Timer 1 can be programmed independently to operate in one of four modes (refer to table 5) :
- Mode 0 : 8-bit Timer/counter with devided-by-32 prescaler
- Mode 1 : 16-bit Timer/counter
- Mode 2 : 8-bit Timer/counter with automatic reload
- Mode 3 : Timer 0 :one 8-bit Timer/counter and one 8-bits Timer. Timer 1 :stopped.
When Timer 0 is in Mode 3, Timer 1 can be programmed to operate in Modes 0, 1 or 2 but cannot set an interrupt
request flag and generate an interrupt. However, the overflow from Timer 1 can be used to pulse the Serial Port
transmission-rgate generator. With a 16 MHz crystal, the counting frequency of these Timer/counters is as follows:
- in the Timer function, the Timer is incremented at a frequency of 1.33 MHz (oscillator frequency divided by 12).
- in the counter function, the frequency handling range for external inputs is 0 Hz to 0.66 MHz (oscillator
frequency divided by 24).
Both internal and external inputs can be gated to the Timer by a second external source for directly measuring
pulse duration.
The Timers are started and stopped under software control. Each one sets its interrupt request flag when it
overflows from all logic 1's to all logic 0's (respectively, the automatic reload value), with the exception of Mode 3
as previously described.
TMOD: TIMER/COUNTER MODE CONTROL REGISTER
This register is located at address 89H.
Table. 4 TMOD SFR (89H)
7
6
5
4
3
2
1
0
GATE
(MSB)
TIMER 1
C/ T
M1
M0
GATE
C/ T
M1
M0
(LSB)
TIMER 0
keep the above table with the following table
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
14
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table. 5 Description of TMOD bits
MNEMONIC
TIMER 1
GATE
POSITION
TMOD.7
FUNCTION
Timer 1 gating control : when set, Timer/counter '1' is enabled only while 'Int1'
pin is high and 'tr1' control bit is set. when cleared, Timer/counter '1' is enabled
whenever 'tr1' control bit is set.
C/T
TMOD.6
Timer or counter selector: cleared for Timer operation (input from internal
system clock). set for counter operation (input from 'T1' input pin).
Operation mode: see table 6.
M1
TMOD.5
TMOD.4
M0
Operation mode: see table 6.
TIMER 0
GATE
TMOD.3
TMOD.2
Timer 0 gating control: when set, Timer/Counter '0' is enabled only while 'Int0'
pin is high and 'tr0' control bit is set. when cleared, Timer/counter '0' is enabled
whenever 'tr0' control bit is set.
C/T
Timer or counter selector: cleared for Timer operation (input from internal
system clock). set for counter operation (input from 'T0' input pin).
Operation mode: see table 6.
M1
M0
TMOD.1
TMOD.0
Operation mode: see table 6.
Table. 6 TMOD M1 and M0 operating modes
M1
0
M0 FUNCTION
0
1
0
8-bit Timer/counter : 'THx' with 5-bit prescaler.
0
16-bitTimer/counter : 'THx' and 'TLx' are cascaded, there is no prescaler.
8-bit autoload Timer/counter : 'THx' holds a value which is to be reloaded into 'TLx' each time it
overflows.
1
1
1
1
1
Timer 0:TL0 is an 8-bitTimer/counter controlled by the standard Timer 0 control bits. TH0 is an 8-
bit Timer controlled by Timer 1 control bits.
Timer 1 : Timer/counter 1 stopped.
TCON: TIMER/COUNTER CONTROL REGISTER
This register is located at address 88H.
Notes :
Symbol Description
Direct
Address
89H
Bit Address, Symbol, or Alternative Port Function
Reset
Function
00H
MSB
LSB
M1 M0
TMOD Timer Mode
GATE C/T
M1
M0
GATE C/T
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
15
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table. 7 TCON SFR (88H)
7
6
5
4
3
2
1
0
TF1
(MSB)
TR1
TF0
TR0
IE1
IT1
IE0
IT0
(LSB)
keep the above table with the following table
Table. 8 Description of TCON bits
MNEMONIC POSITION FUNCTION
TF1
TCON.7
Timer 1 overflow flag : set by hardware on Timer/Counter overflow. Cleared when
interrupt is processed.
TR1
TF0
TCON.6
TCON.5
Timer 1 control bit : set/cleared by software to turn Timer/counter ON/OFF.
Timer 0 overflow flag: set by hardware on Timer/Counter overflow. Cleared when
interrupt is processed.
TR0
IE1
TCON.4
TCON.3
Timer 0 control bit : set/cleared by software to turn Timer/counter ON/OFF.
Interrupt 1 edge flag: set by hardware when external interrupt is detected. Cleared
when interrupt is processed.
IT1
IE0
IT0
TCON.2
TOCN.1
TOCN.0
Interrupt 1 type control bit : set/cleared by software to specify falling edge/LOW
level triggered external interrupt.
Interrupt 0 edge flag: set by hardware when external interrupt is detected. Cleared
when interrupt is processed.
Interrupt 0 type control bit: set/cleared by software tospecify falling edge/LOW
level triggered external interrupt.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
16
PRELIMINARY
MX10E8050I /
MX10E8050IA
TIMER 2 OPERATION
Timer 2
Timer 2 is a 16-bit Timer/Counter which can operate as either an event timer or an event counter, as selected by C/
T2* in the special function register T2CON(see Figure 2). Timer 2 has three operating modes: Capture,Auto-reload
(up or down counting), and Baud RateGenerator, which are selected by bits in the T2CON as shown in Table 9.
Capture Mode
InthecapturemodetherearetwooptionswhichareselectedbybitEXEN2inT2CON.IfEXEN2=0,thentimer2isa
16-bittimerorcounter(asselectedbyC/T2*inT2CON)which,uponoverflowingsetsbitTF2,thetimer2overflowbit.
This bit can be used to generate an interrupt (by enabling the Timer 2 interrupt bit in the IE register). If EXEN2= 1,
Timer 2 operates as described above, but with the added feature that a 1- to -0 transition at external input T2EX
causes the current value in theTimer 2 registers,TL2 andTH2, to be captured into registers RCAP2Land RCAP2H,
respectively. In addition, the transition atT2EX causes bit EXF2 inT2CONto be set, and EXF2 likeTF2 can generate
aninterrupt(whichvectorstothesamelocationasTimer2overflowinterrupt.TheTimer2interruptserviceroutinecan
interrogate TF2 and EXF2 to determine which event caused the interrupt). The capture mode is illustrated in Figure B
(There is no reload value for TL2 and TH2 in this mode. Even when a capture event occurs from T2EX, the counter
keeps on counting T2EX pin transitions or osc/6 pulses (osc/12 in 12 clock mode).).
Auto-Reload Mode ( Up or Down Counter )
In the 16-bit auto-reload mode, Timer 2 can be configured (as either a timer or counter [C/T2* in T2CON]) then
programmedtocountupordown.ThecountingdirectionisdeterminedbybitDCEN(DownCounterEnable)whichis
located in the T2MODregister (see Figure 4). When reset is applied theDCEN=0 which means Timer 2 will default to
counting up. IfDCENbit is set, Timer 2 can count up or down depending on the value of the T2EX pin.
Figure 5 shows Timer 2 which will count up automatically sinceDCEN=0. In this mode there are two options selected
bybitEXEN2inT2CONregister. IfEXEN2=0, thenTimer2countsupto0FFFFHandsetstheTF2(OverflowFlag)bit
upon overflow. This causes the Timer 2 registers to be reloaded with the 16-bit value in RCAP2L and RCAP2H. The
values in RCAP2L and RCAP2H are preset by software means.
If EXEN2=1, then a 16-bit reload can be triggered either by an overflow or by a 1-to-0 transition at input T2EX. This
transition also sets the EXF2 bit. TheTimer 2 interrupt, if enabled, can be generated when eitherTF2 or EXF2 are 1.
In Figure 6DCEN=1 which enables Timer 2 to count up or down. This mode allows pin T2EX to control the direction
of count. When a logic 1 is applied at pin T2EX Timer 2 will count up. Timer 2 will overflow at 0FFFFH and set the TF2
flag, which can then generate an interrupt, if the interrupt is enabled. This timer overflow also causes the 16-bit value
in RCAP2Land RCAP2H to be reloaded into the timer registersTL2 andTH2.
When a logic 0 is applied at pin T2EX this causes Timer 2 to count down. The timer will underflow when TL2 and TH2
become equal to the value stored in RCAP2L and RCAP2H. Timer 2 underflow sets the TF2 flag and causes 0FFFFH
to be reloaded into the timer registers TL2 and TH2.
The external flag EXF2 toggles when Timer 2 underflows or overflows. This EXF2 bit can be used as a 17th bit of
resolution if needed. The EXF2 flag does not generate an interrupt in this mode of operation.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
17
PRELIMINARY
MX10E8050I /
MX10E8050IA
(MSB)
TF2
(LSB)
EXF2
RCLK
TCLK
EXEN2
TR2
C/T2
CP/RL2
Symbol
TF2
Position
Name and Significance
T2CON.7
T2CON.6
Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2 will not be set
when either RCLK or TCLK = 1.
EXF2
Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and
EXEN2 = 1. When Timer 2 interrupt is enabled, EXF2 = 1 will cause the CPU to vector to the Timer 2
interrupt routine. EXF2 must be cleared by software. EXF2 does not cause an interrupt in up/down
counter mode (DCEN = 1).
RCLK
TCLK
T2CON.5
T2CON.4
T2CON.3
Receive clock flag. When set, causes the serial port to use Timer 2 overflow pulses for its receive clock
in modes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for the receive clock.
Transmit clock flag. When set, causes the serial port to use Timer 2 overflow pulses for its transmit clock
in modes 1 and 3. TCLK = 0 causes Timer 1 overflows to be used for the transmit clock.
EXEN2
Timer 2 external enable flag. When set, allows a capture or reload to occur as a result of a negative
transition on T2EX if Timer 2 is not being used to clock the serial port. EXEN2 = 0 causes Timer 2 to
ignore events at T2EX.
TR2
T2CON.2
T2CON.1
Start/stop control for Timer 2. A logic 1 starts the timer.
C/T2
Timer or counter select. (Timer 2)
0 = Internal timer (OSC/6 in 6 clock mode or OSC/12 in 12 clock mode)
1 = External event counter (falling edge triggered).
CP/RL2
T2CON.0
Capture/Reload flag. When set, captures will occur on negative transitions at T2EX if EXEN2 = 1. When
cleared, auto-reloads will occur either with Timer 2 overflows or negative transitions at T2EX when
EXEN2 = 1. When either RCLK = 1 or TCLK = 1, this bit is ignored and the timer is forced to auto-reload
on Timer 2 overflow.
Figure 2. Timer / Counter 2 (T2CON) Control Register
Table 9 : Timer 2 Operation Modes
RCLK + TCLK
CP / RL2
TR2
1
MODE
0
0
1
X
0
1
X
X
16-bit Auto-reload
16-bit Capture
Baud rate generator
( off )
1
1
0
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
18
PRELIMINARY
MX10E8050I /
MX10E8050IA
OSC
÷
n*
C/T2 = 0
C/T2 = 1
TL2
(8-bits)
TH2
(8-bits)
TF2
T2 Pin
Control
TR2
Capture
Transition
Detector
Timer 2
Interrupt
RCAP2L
RCAP2H
T2EX Pin
EXF2
Control
EXEN2
* n = 12 in 12 clock mode.
n = 6 in 6 clock mode.
Figure 3 : Timer 2 in Capture Mode
T2MOD
Symbol
Address = 0C9H
Reset Value = XXXX XX00B
Not Bit Addressable
T2OE
1
DCEN
0
Bit
7
6
5
4
3
2
Function
-
Not implemented, reserved for future use.*
Timer 2 Output Enable bit.
T2OE
DCEN
Down Count Enable bit. When set, this allows Timer 2 to be configured as an up/down counter.
*
User software should not write 1s to reserved bits. These bits may be used in future 8051 family products to invoke new features.
In that case, the reset or inactive value of the new bit will be 0, and its active value will be 1. The value read from a reserved bit is
indeterminate.
Figure 4 : Timer 2 Mode (T2MOD) Control Register
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
19
PRELIMINARY
MX10E8050I /
MX10E8050IA
OSC
÷
n*
C/T2 = 0
C/T2 = 1
TL2
(8-BITS)
TH2
(8-BITS)
T2 PIN
CONTROL
TR2
RELOAD
TRANSITION
DETECTOR
RCAP2L
RCAP2H
TF2
TIMER 2
INTERRUPT
T2EX PIN
EXF2
CONTROL
EXEN2
* n = 12 in 12 clock mode.
n = 6 in 6 clock mode.
Figure 5 : Timer 2 in Auto-Reload Mode (DCEN = 0)
(DOWN COUNTING RELOAD VALUE)
FFH
FFH
TOGGLE
EXF2
÷
n*
OSC
C/T2 = 0
OVERFLOW
TL2
TH2
TF2
INTERRUPT
C/T2 = 1
T2 PIN
CONTROL
TR2
COUNT
DIRECTION
1 = UP
0 = DOWN
RCAP2L
RCAP2H
(UP COUNTING RELOAD VALUE)
T2EX PIN
* n = 12 in 12 clock mode.
n = 6 in 6 clock mode.
Figure 6 : Timer 2 Auto-Reload Mode (DCEN = 1)
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
20
PRELIMINARY
MX10E8050I /
MX10E8050IA
Timer 1
Overflow
÷ 2
"0"
"0"
"1"
OSC
÷ n*
C/T2 = 0
C/T2 = 1
SMOD
RCLK
"1"
TL2
(8-bits)
TH2
(8-bits)
T2 Pin
Control
RX Clock
÷ 16
÷ 16
"1"
"0"
TR2
Reload
TCLK
Transition
Detector
RCAP2L
RCAP2H
TX Clock
Timer 2
Interrupt
T2EX Pin
EXF2
Control
EXEN2
Note availability of additional external interrupt.
* n = 2 in 12 clock mode.
n = 1 in 6 clock mode.
Figure 7. Timer 2 in Baud Rate Generator Mode
Table 10 : Timer 2 Generated Commonly Used Baud Rates
Baud Rate
Timer 2
Osc Freq
12 clock
mode
RCAP2H RCAP2L
375 k
9.6 k
2.8 k
2.4 k
1.2 k
300
110
300
110
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
12 MHz
6 MHz
FF
FF
FF
FF
FE
FB
F2
FD
F9
FF
D9
B2
64
C8
1E
AF
8F
57
6 MHz
Baud Rate Generator Mode
Bits TCLK and / or RCLK in T2CON(Table 10) allow the serial port transmit and receive baud rates to be derived
from either Timer 1 or Timer 2. When TCLK = 0, Timer 1 is used as the serial port transmit baud rate generator.
When TCLK = 1, Timer 2 is used as the serial port transmit baud rate generator. RCLK has the same effect for
the serial port receive baud rate. With there two bits, the serial port can have different receive and transmit baud
rates - one generated by Timer1, the other by Timer2.
Figure 7 shows the Timer2 in baud rate generation mode. The baud rate generation mode is like the auto-reload
mode, in that a rollover in TH2 causes the Timer 2 registers to be reloaded with the 16-bit value in registers
RCAP2H and RCAP2L, which are preset by software.
The baud rates in modes 1 and 3 are determined by Timer 2's overflow rate given below :
Timer 2 Overflow Rate
Modes 1 and 3 Baud Rates =
16
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
21
PRELIMINARY
MX10E8050I /
MX10E8050IA
The Timer can be configured for either "timer" or "counter" operation. In many applications, it is configured for
"timer" operation ( C/T 2* = 0). Timer operation is different for Timer 2 when it is being used as a baud rate
generator.
Usually, as a timer it would increment every machine cycle ( i.e., 1/6 the oscillator frequency in 6 clock mode, 1/
12 the oscillator frequency in 12 clock mode). As a baud rate generator, it increments at the oscillator frequency
in 6 clock mode (OSC/2 in 12 clock mode).
Thus the baud rate formula is as follows :
Oscillator Frequency
Modes 1 and 3 Baud Rates =
[ n * x [65536 - (RCAP2H, RCAP2L) ] ]
*n = 32 in 12 clock mode or 16 in 6 clock mode
Where : (RCAP2h, RCAP2L) =The content of RCAP2H andRCAP2Ltakenas a 16-bit unsignedinteger.
The Timer 2 as a baud rate generator mode shown in Figure7, is valid only if RCLK and / or TCLK = 1in T2CON
register. Note that a rollover in TH2 does not set TF2, and Will not generate an interrupt. Thus, the Timer 2
interrupt does not have to be disabled when Timer 2 is in the baudrate generator mode. Also if the EXEN2 (T2
external enable flag) is set, a 1-to-0 transition in T2EX (Timer / counter 2 trigger input) will set EXF2 (T2 external
flag) but will not cause a reload from (RCAP2H, RCAP2L) to (TH2, TL2). Therefore when Timer 2 is in use as a
baud rate generator, T2EX can be used as an additional external interrupt, if needed.
When Timer 2 is in the baud rate generator mode, one should not try to read or write TH2 and TL2. As a baud rate
generator, Timer 2 is accurate. The RCAP2 registers may be read, but should not be written to, because a write
might overlap a reload and cause write and / or reload errors. The timer should be turned off (clearTR2) before
accessing the Timer 2 or RCAP2 registers.
Table 10 shows commonly used baud rates and how they can be obtained from Timer 2.
Summary Of Baud Rate Equations
Timer 2 is in baud rate generating mode. If Timer 2 is being clocked through pin T2(P1.0) the baud rate is :
Timer 2 Overflow Rate
Baud Rate =
16
If Timer 2 is being clocked internally, The baud rate is :
fOSC
Baud Rate =
[ n * x [65536 - (RCAP2H, RCAP2L) ] ]
*n = 32 in 12 clock mode or 16 in 6 clock mode
Where fOSC = Oscillator Frequency
To obtain the reload value for RCAP2H and RCAP2L, the above equation can be rewritten as :
fOSC
RCAP2H, RCAP2L = 65536 - (
)
n * x Baud Rate
Timer / Counter 2 Set-up
Except for the baud rate generator mode, the values given for T2CON do not include the setting of the TR2 bit.
Therefore, bit TR2 must be set, separately, to turn the timer on. see Table 11 for set-up of Timer 2 as a timer. Also
see Table 12 for set-up of Timer 2 as a counter.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
22
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 11 : Timer 2 as a Timer
T2CON
MODE
INTERNAL CONTROL
EXTERNAL CONTROL
(Note 1)
00H
(Note 2)
08H
16-bit Auto-Reload
16-bit Capture
01H
09H
Baud rate generator receive and transmit same baud rate
34H
36H
Receive only
Transmitonly
24H
26H
14H
16H
Table 12 : Timer 2 as a Counter
T2CON
MODE
INTERNAL CONTROL
EXTERNAL CONTROL
(Note 1)
02H
(Note 2)
0AH
16-bit
Auto-Reload
03H
0BH
NOTES :
1. Capture / reload occurs only on timer / counter overflow.
2. Capture / reload occurs on timer / counter overflow and a 1-to-0 transition onT2EX (P1.1) pin except when
Timer 2 is used in the baud rate generatior mode.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
23
PRELIMINARY
MX10E8050I /
MX10E8050IA
Interrupt system
The MX10E8050I Serial contains a 7-source (2 external interrupts, Timer 0, Timer1, Timer2, I2C and UART) with
four priority levels interrupt structure.
Each External interrupts INT0 and INT1, can be either level-activated or transition-activated depending on bits IT0
and IT1 in TCON SFR. The flags that actually generate these interrupts are bits IE0, IE1 in TCON. When an
external interrupt is generated, the corresponding request flag is cleared by the hardware where the service routine
is vectored to, if the interrupt is transition-activated. If the interrupt is level-activated the external source has to
hold the request active until the requested interrupt is actually generated. Then it has to deactive the request
before the interrupt service routine is completed, otherwise another interrupt will be generated.
The Timer 0 and Timer 1 Interrupts are generated by TF0 and TF1, which are set by a rollover in their respective
Timer/counter register (except for Timer 0 in Mode 3 of the serial interface). When a Timer interrupt is generated,
the flag that generated it is cleared by the on-chip hardware when the service routine is vectored to.
IE : INTERRUPT ENABLE REGISTER
This register is located at address A8H.
Table. 13 IE SFR (A8H)
7
6
5
4
3
2
1
0
EA
ET2
ES1
ES
ET1
EX1
ET0
EX0
(LSB)
(MSB)
keep the above table with the following table
Table. 14 Description of IE bits
MNEMONIC POSITION
FUNCTION
EA
IE.7
Disable all interrupt
- Low, all disabled.
- High, each interrupt source is individually enabled or disabled by setting or
clearing its enable bit.
ET2
ES1
ES
IE.6
IE.5
IE.4
Enable /Disable Timer2 interrupt.
- Low, disabled
- High, enabled
Enable / Disable l2C Interrupt.
- Low, disabled
- High, enabled
Enable /Disable UART interrupt.
- Low, disabled
- High, enabled
ET1
EX1
IE.3
IE.2
Enable /Disable Timer1 overflow interrupt.
Enable / Disable External interrupt 1.
- Low, disabled
- High, enabled
ET0
EX0
IE.1
IE.0
Enable / disable Timer0 overflow interrupt.
Enable / Disable External interrupt 0.
- Low, disabled
- High, enabled
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
24
PRELIMINARY
MX10E8050I /
MX10E8050IA
IP : INTERRUPT PRIORITY REGISTER
This register is located at address B8H.
Table. 15 IP SFR (B8H)
7
-
6
5
4
3
2
1
0
PT2
PS1
PS
PT1
PX1
PT0
PX0 ( LSB )
keep the above table with the following table
Table. 16 Description of IP bits
MNEMONIC POSITION
FUNCTION
RESERVED
-
IP.7
IP.6
PT2
Define Timer2 interrupt priority level.
- High, assign a high priority level.
Define I2C interrupt priority level.
PS1
IP.5
- High, assign a high priority level.
Define interrupt priority level of UART.
Define Timer1 overflow interrupt priority level.
PS
IP.4
IP.3
IP.2
PT1
PX1
Define External interrupt 1 interrupt priority level.
- High, assign a high priority level.
PT0
PX0
IP.1
IP.0
Define Timer0 overflow interrupt priority level.
Define External interrupt 0 interrupt priority level.
- High, assign a high priority level.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
25
PRELIMINARY
MX10E8050I /
MX10E8050IA
IPH : INTERRUPT HIGH PRIORITY REGISTER
This register is located at address B7H.
Table. 17 IPH SFR (B7H)
7
-
6
5
4
3
2
1
0
PT2H PS1H PSH
PT1H PX1H PT0H PX0H ( LSB )
keep the above table with the following table
Table. 18 Description of IPH bits
MNEMONIC POSITION
FUNCTION
-
IPH.7
IPH.6
RESERVED
PT2H
Define Timer2 interrupt priority level.
- High, assign a high priority level.
Define I2C interrupt priority level.
- High, assign a high priority level.
Define interrupt priority level of UART.
Define Timer1 overflow interrupt priority level.
PS1H
IPH.5
PSH
IPH.4
IPH.3
IPH.2
PT1H
PX1H
Define External interrupt 1 interrupt priority level.
- High, assign a high priority level.
PT0H
PX0H
IPH.1
IPH.0
Define Timer0 overflow interrupt priority level.
Define External interrupt 0 interrupt priority level.
- High, assign a high priority level.
NAME
PRIORITY WITHINLEVEL
(HIGHEST) 1
VECTORADDRESS
0003H
IE0
I2C
2
3
4
5
6
7
002BH
TF0
000BH
IE1
0013H
TF1
001BH
RI + TI
TF2 + EXF2
0023H
(LOWEST)
0033H
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
26
PRELIMINARY
MX10E8050I /
MX10E8050IA
OSCILLATOR CHARACTERISTICS
XTAL1andXTAL2aretheinputandoutput, respectively, ofaninvertingamplifier.Thepinscanbeconfiguredforuse
asanon-chiposcillator.Todrivethedevicefromanexternalclocksource, XTAL1shouldbedrivenwhileXTAL2isleft
unconnected. There are no requirements on the duty cycle of the external clock signal, because the input to the
internal clock circuitry is through a divide-by-two flip-flop. However, minimum and maximum high and low times
specified in the datasheet must be observed.
RESET
A reset is accomplished by holding the RST pin high for at least two and half machine cycles (15 oscillator periods in
6-clock mode, or 30 oscillator periods in 12-clock mode), while the oscillator is running. To ensure a good power-on
reset, the RST pin must be high long enough to allow the oscillator time to start up (normally a few milliseconds) plus
two machine cycles.At power-on, the voltage onV CC and RST must come up at the same time for a proper start-up.
Ports 1,2, and 3 will asynchronously be driven to their reset condition when a voltage above VIH (min.) is applied to
RST.
IDLE MODE
In idle mode, the CPU puts itself to sleep while all of the on-chip peripherals stay active. The instruction to invoke the
idle mode is the last instruction executed in the normal operating mode before the idle mode is activated. The CPU
contents, theon-chipRAM, andallofthespecialfunctionregistersremainintactduringthismode.Theidlemodecan
be terminated either by any enabled interrupt (at which time the process is picked up at the interrupt service routine
and continued), or by a hardware reset which starts the processor in the same manner as a power-on reset.
POWER_DOWN MODE
In the power-down mode, the oscillator is stopped and the instruction to invoke power-down is the last instruction
executed. The power-down mode can be terminated by a RESET in the same way as in the 80C51 or in addition by
one of two external interrupts, INT0 or INT1. A termination with an external interrupt does ont affect the internal data
memory and does not affect the internal data memory and does not affect the special function registers. This makes
it possible to exit power-down without changing the port output levels. To terminate the power-down mode with any
external interrupt INT0 or INT1 must be switched to level-sensitive and must be enabled. The external interrupt input
signal INT0 and INT1 must be kept low until the oscillator has restarted and stabilized. An instruction following the
instruction that puts the device in the power-down mode will be executed. A reset generated by the watchdog timer
terminatesthepower-downmodeinthesamewayasanexternalRESET,andonlythecontentsoftheon-chipRAM
are preserved. The control bits for the reduced power modes are in the special function register PCON.
DESIGN CONSIDERATIONS
At power-on, the voltage on VCC and RST must come up at the same time for a proper start-up.
When the idle mode is terminated by a hardware reset, the device normally resumes program exectution, from where
it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access
to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected
write when idle is terminated by reset, the instruction following the one that invokes idle should not be one that writes
to a port pin or to external memory.
Table 19 shows the state of I/O ports during low current operation modes.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
27
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 19. External Pin Status During Idle and Power-Down Modes
MODE
IDLE
PROGRAM MEMORY ALE
PSEN
PORT0
Data
PORT1
Data
PORT2
Data
PORT3
Data
Internal
1
1
0
0
1
1
0
0
IDLE
External
Float
Data
Data
Address
Data
Data
Power-down Internal
Power-down External
Data
Data
Float
Data
FF
Data
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
28
PRELIMINARY
MX10E8050I /
MX10E8050IA
Watchdog Timer
TheWatchdogTimer (WDT) see Fig.8 , consists of an 11-bit prescaler and an 8-bit Timer formed by SFRT3. The
Timer is incremented every 1.5 ms, derived from the system clock frequency of 16 MHz by the following formula :
fTimer = fclk / (12 x (2048)). The 8-bit Timer increments every 12 x 2048 cycles of the on-chip oscillator. When a Timer
overflow occurs, the microcontroller is reset. The internal RESET signal is not inhibited when the external RST pin
is kept 0 into high impedance, no matter if the XTAL-clock is running or not.
To prevent a system reset the Timer must be reloaded in time by the application software. If the processor suffers
a hardware / software malfunction, the software will fail to reload the Timer. This failure will result in an overflow
thus prevent the processor from running out of control. This time interval is determined by the 8-bit reload value
that is written into register T3.
Watchdog time interval = [ 100 - T3 ] x 12 x 2048 / oscillator frequency (12x mode)
[ 100 - T3 ] x 6 x 2048 / oscillator frequency ( 6x mode)
The watch-dog Timer can only be reloaded if the condition flag WLE (SFR PCON bit 4) has been previously set
high by software. At the moment the counter is loaded WLE is automatically cleared.
In the idle state the watchdog Timer and reset circuitry remain active.
The watchdog Timer is controlled by the watchdog enable signal EW (SFR EBTCONbit 1). A LOW level enables
the watchdog Timer. A HIGH level disable the watchdog Timer.
Internal Bus
Timer T3
(8-bit)
Prescaler
(11-bit)
f
CLK/12
to reset circuitry
LOAD LOADEN
Clear
Write T3
Clear
WLE
PD
LOADEN
PCON. 4
PCON. 1
EW
Internal Bus
Fig. 8 Watchdog Timer T3
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
29
PRELIMINARY
MX10E8050I /
MX10E8050IA
Pulse Width Modulated Outputs
TheMX10E8050Icontains fourpulsewidthmodulatedoutputchannels.Thesechannelsgeneratepulsesofprogram-
mable length and interval. Two kinds of user modes are available. One is to use two channels as a pair of PWM output
with one prescaler and four channels as two pairs of PWM outputs with each own single prescaler. The operation thus
is like two set of independently PWM modules. The repetition frequency is defined by an 8-bit prescaler, which
supplies the clock for the counter. The prescaler and counter are common to the both PWM channels in each set. The
8-bit counter counts modulo 255, i.e., from 0 to 254 inclusive. The value of the 8-bit counter is compared to the
contents of two registers: PWM0 and PWM1 or PWM2 and PWM3. Provided the contents of either of these registers
is greater than the counter value, the corresponding PWM0 or PWM1 or PWM2 or PWM3 output is set LOW. If the
contents of these registers are equal to, or less than the counter value, the output will be HIGH. The pulse-width-ratio
isthereforedefinedbythecontentsoftheregistersPWM0andPWM1orPWM2andPWM3.Thepulse-width-ratiois
in the range of 0 to 1 and may be programmed in increments of 1/255. The other one operation is that to use four
channels as four independently PWM outputs with each own prescaler.
fOSC
fPWM
=
2 x (1 + PWMP) x 255
This gives a repetition frequency range of 123Hz to 31.4KHz (fOSC = 16MHz). At fOSC = 24MHz, the frequency range
is 184Hz to 47.1KHz. By loading the PWM registers with either 00H or FFH, the PWM channels will output a
constant HIGH or LOW level, respectively. Since the 8-bit counter counts modulo 255, it can never actually reach
the value of the PWM registers when they are loaded with FFH.
When a compare register (PWM0 or PWM1 or PWM2 or PWM3) is loaded with a new value, the associated output is
updated immediately. It does not have to wait until the end of the current counter period. Every PWMn output pins are
driven by push-pull drivers. These pins are not used for any other purpose.
The PWM function is enabled by setting SFR PWMC. SFR PWMC also controls operational mode and enable out.
After reset, P4.0 to P4.3 are used to as the PWM output.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
30
PRELIMINARY
MX10E8050I /
MX10E8050IA
PWM Module Prescaler frequency control Register / PWMPX
PWMPX.7
PWMPX.6 PWMPX.5 PWMPX.4
PWMPX.3
PWMPX.2
PWMPX.1
WMPX.0
PWMPX
X = 0, 1, 2, or 3
PWMP0
PWMP1
PWMP2
PWMP3
0FEH
0FBH
0F6H
0F3H
BIT
SYMBOL
FUCTION
PWMPX.7-0 PWMPX.7-0
Prescaler division factor = (PWMPX) + 1
PWM Module Pulse width Register / PWMX
PWMX.7 PWMX.6 PWMX.5
PWMX.4
PWMX.3
PWMX.2
PWMX.1
PWMX.0
PWMX
X = 0, 1, 2, or 3
PWM0 0FCH
PWM1 0FDH
PWM2 0F4H
PWM3 0F5H
BIT
SYMBOL
FUCTION
LOW/HIGH ration of PWMX signal = (PWMX) / [255 - (PWMX)]
PWMX.7-0
PWMX.7-0
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
31
PRELIMINARY
MX10E8050I /
MX10E8050IA
DSCA/DSCB = 1
PWM0/2
OUTPUT
BUFFER
8-BIT COMPARATOR
PWM 0/2
f
CKL
PRESCALE (PWMP 0/2)
PRESCALE (PWMP 1/3)
8-BIT COUNTER
8-BIT COUNTER
1/2
OUTPUT
BUFFER
PWM 1/3
8-BIT COMPARATOR
PWM1/3
DSCA/DSCB = 0
PWM0/2
OUTPUT
BUFFER
8-BIT COMPARATOR
8-BIT COUNTER
8-BIT COMPARATOR
PWM 0/2
f
CKL
1/2
PRESCALE (PWMP 0,1)
(PWMP 2,3)
OUTPUT
BUFFER
PWM 1/3
PWM1/3
Fig. 9 Functional Diagram of Pulse Width Modulated Outputs
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
32
PRELIMINARY
MX10E8050I /
MX10E8050IA
UART
Enhanced UART
In addition to the standard operation the UART can perform framing error detect by looking for missing stop bits, and
automatic address recognition. The UART also fully supports multiprocessor communication as does the standard
80C51 UART.
WhenusedforframingerrordetecttheUARTlooksformissingstopbitsinthecommunication.Amissingbitwillset
the FE bit in the SCONregister. The FE bit shares the SCON.7 bit with SM0 and the function of SCON.7 is determined
by PCON.6 (SMOD0) (see Figure 10). If SMOD0 is set then SCON.7 functions as FE. SCON.7 functions as SM0
when SMOD0 is cleared. When used as FE SCON.7 can only be cleared by software.
Automatic Address Recognition
Automatic Address Recognition is a feature which allows the UART to recognize certain addresses in the serial bit
stream by using hardware to make the comparisons. This feature saves a great deal of software overhead by eliminat-
ing the need for the software to examine every serial address which passes by the serial port. This feature is enabled
bysettingtheSM2bitinSCON. Inthe9bitUARTmodes, mode2andmode3, theReceiveInterruptflag(RI)willbe
automatically set when the received byte contains either the “Given” address or the “Broadcast” address. The 9-bit
mode requires that the 9th information bit is a 1 to indicate that the received information is an address and not data.
Automatic address recogintion is shown in figure 12.
The 8 bit mode is called Mode 1. In this mode the RI flag will be set if SM2 is enabled and the information received has
a valid stop bit following the 8 address bits and the information is either a Given or Broadcast address.
Mode 0 is the Shift Register mode and SM2 is ignored.
Using the Automatic Address Recognition feature allows a master to selectively communicate with one or more
slaves by invoking the Given slave address or addresses. All of the slaves may be contacted by using the Broadcast
address. Two special Function Registers are used to define the slave’s address, SADDR, and the address mask,
SADEN. SADEN is used to define which bits in the SADDR are to b used and which bits are “don’t care”. The
SADEN mask can be logically ANDed with the SADDR to create the “Given” address which the master will use for
addressing each of the slaves. Use of the Given address allows multiple slaves to be recognized while excluding
others. The following examples will help to show the versatility of this scheme:
Slave 0
SADDR = 1100 0000
SADEN = 1111 1101
Given = 1100 00X0
Slave 1
SADDR = 1100 0000
SADEN = 1111 1110
Given = 1100 000X
In the above example SADDR is the same and the SADEN data is used to differentiate between the two slaves. Slave
0 requires a 0 in bit 0 and it ignores bit 1. Slave 1 requires a 0 in bit 1 and bit 0 is ignored. A unique address for Slave
0 would be 1100 0010 since slave 1 requires a 0 in bit 1. A unique address for slave 1 would be 1100 0001 since a 1
in bit 0 will exclude slave 0. Both slaves can be selected at the same time by an address which has bit 0 = 0 (for slave
0) and bit 1 = 0 (for slave 1). Thus, both could be addressed with 1100 0000.
In a more complex system the following could be used to select slaves 1 and 2 while excluding slave 0:
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
33
PRELIMINARY
MX10E8050I /
MX10E8050IA
Slave 0
Slave 1
Slave 2
SADDR = 1100 0000
SADEN = 1111 1001
Given = 1100 0XX0
SADDR = 1110 0000
SADEN = 1111 1010
Given = 1110 0X0X
SADDR = 1110 0000
SADEN = 1111 1100
Given = 1110 00XX
In the above example the differentiation among the 3 slaves is in the lower 3 address bits. Slave 0 requires that bit 0
= 0 and it can be uniquely addressed by 1110 0110. Slave 1 requires that bit 1 = 0 and it can be uniquely addressed
by 1110 and 0101. Slave 2 requires that bit 2 = 0 and its unique address is 1110 0011. To select Slaves 0 and 1 and
exclude Slave 2 use address 1110 0100, since it is necessary to make bit 2 = 1 to exclude slave 2.
The Broadcast Address for each slave is created by taking the logical OR of SADDR and SADEN. Zeros in this result
are trended as don’t-cares. In most cases, interpreting the don’t-cares as ones, the broadcast address will be FF
hexadecimal.
Upon reset SADDR (SFR address 0A9H) and SADEN(SFR address 0B9H) are leaded with 0s. This produces a given
address of all “don’t cares” as well as a Broadcast address of all “don’t cares”. This effectively disables the
Automatic Addressing mode and allows the microcontroller to use standard 80C51 type UART drivers which do not
make use of this feature.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
34
PRELIMINARY
MX10E8050I /
MX10E8050IA
SCON Address = 98H
Bit Addressable
SM0/FE
Reset Value = 0000 0000B
SM1
SM2
REN
TB8
RB8
Tl
Rl
Bit:
7
6
5
4
3
2
1
0
(SMOD0 = 0/1)*
Symbol
FE
Function
Framing Error bit. This bit is set by the receiver when an invalid stop bit is detected. The FE bit is not cleared by valid
frames but should be cleared by software. The SMOD0 bit must be set to enable access to the FE bit.
SM0
SM1
Serial Port Mode Bit 0, (SMOD0 must = 0 to access bit SM0)
Serial Port Mode Bit 1
SM0
SM1
Mode
Description
Baud Rate**
0
0
1
0
1
0
0
1
2
shift register
8-bit UART
9-bit UART
f
/6 (6-clock mode) or f
/12 (12-clock mode)
OSC
OSC
variable
f
f
/32 or f
/64 or f
/16 (6-clock mode) or
/32 (12-clock mode)
OSC
OSC
OSC
OSC
1
1
3
9-bit UART
variable
SM2
Enables the Automatic Address Recognition feature in Modes 2 or 3. If SM2 = 1 then Rl will not be set unless the
received 9th data bit (RB8) is 1, indicating an address, and the received byte is a Given or Broadcast Address.
In Mode 1, if SM2 = 1 then Rl will not be activated unless a valid stop bit was received, and the received byte is a
Given or Broadcast Address. In Mode 0, SM2 should be 0.
REN
TB8
RB8
Enables serial reception. Set by software to enable reception. Clear by software to disable reception.
The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software as desired.
In modes 2 and 3, the 9th data bit that was received. In Mode 1, if SM2 = 0, RB8 is the stop bit that was received.
In Mode 0, RB8 is not used.
Tl
Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at the beginning of the stop bit in the
other modes, in any serial transmission. Must be cleared by software.
Rl
Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or halfway through the stop bit time in
the other modes, in any serial reception (except see SM2). Must be cleared by software.
NOTE:
*SMOD0 is located at PCON6.
**f = oscillator frequency
OSC
Figure 10. SCON : Serial Port Control Register
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
35
PRELIMINARY
MX10E8050I /
MX10E8050IA
D0
D1
D2
D3
D4
D5
D6
D7
D8
START
BIT
DATA BYTE
ONLY IN
MODE 2, 3
STOP
BIT
SET FE BIT IF STOP BIT IS 0 (FRAMING ERROR)
SM0 TO UART MODE CONTROL
SCON
(98H)
SM0 / FE
SMOD1
SM1
SM2
REN
POF
TB8
LVF
RB8
GF0
TI
RI
PCON
(87H)
SMOD0
±
GF1
IDL
0 : SCON.7 = SM0
1 : SCON.7 = FE
Figure 11. UART Framing Error Detection
D0
D1
D2
D3
D4
D5
D6
D7
D8
SCON
(98H)
SM0
SM1
SM2
REN
1
TB8
X
RB8
TI
RI
1
1
1
0
1
RECEIVED ADDRESS D0 TO D7
PROGRAMMED ADDRESS
COMPARATOR
IN UART MODE 2 OR MODE 3 AND SM2 = 1:
INTERRUPT IF REN=1, RB8=1 AND ªRECEIVED ADDRESSº = ªPROGRAMMED ADDRESSº
± WHEN OWN ADDRESS RECEIVED, CLEAR SM2 TO RECEIVE DATA BYTES
± WHEN ALL DATA BYTES HAVE BEEN RECEIVED: SET SM2 TO WAIT FOR NEXT ADDRESS.
Figure 12. UART Multiprocessor Communication, Automatic Address Recognition
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
36
PRELIMINARY
MX10E8050I /
MX10E8050IA
Serial I/O
The MX10E8050I Serial is equipped with two independent serial ports : SIO0 and SIO1. SIO0 is a full duplex UART
port and is identical to the 80C51 serial port.
SIO0 : SIO0 is a full duplex serial I/O port identical to that on the 80C51. It's operation is the same, including the use
of timer 1 as a baud rate generator.
SIO1, I2C Serial I/O : The I2Cbususestwowires(SDAandSCL)totransferinformationbetweendevicesconnected
to the bus. The main features of the bus are :
- Bidirectional data transfer between masters and slaves
- Multimaster bus ( no central master )
- Arbitration between simultaneously transmitting masters without corruption of serial data on the bus
- Serial clock synchronization allows devices with different bit rates to communicate via one serial bus
- Serial clock synchronization can be used as a handshake mechanism to suspend and resume serial transfer
- The I2C bus may be used for test and diagnostic purposes
The output latches of P1.6 and P1.7 must be set to logic 1 in order to enable SIO1.
The MX10E8050I Serial on-chip I2C logic provides a serial interface that meets the I2C bus specification and supports
2
all transfer modes ( other than the low-speed mode ) from and to the I C bus. The SIO1 logic handles bytes transfer
autonomously. It also keeps track of serial transfers, and a status register ( S1STA) reflects the status of SIO1 and
the I2C bus.
The CPU interfaces to the I2C logic via the following four special function register : S1CON ( SIO1 control register ),
S1STA( SIO1 status register ), S1DAT ( SIO1 data register ), and S1ADR ( SIO1 slave address register ). The SIO1
logic interfaces to the external I2C bus via two port 1 pins : P1.6/SCL ( serial clock line ) and P1.7/SDA ( serial data
line ).
A typical I2C bus configuration is shown in Figure 13, and Figure 14 shows how a data transfer is accomplished on the
bus. Depending on the state of the direction bit ( R/W ), two types of data transfers are possible on the I2C bus:
1. Data transfer from a master transmitter to a slave receiver. The first byte transmitted by the master is the slave
address. Next follows a number of data bytes. The slave returns an acknowledge bit after each received byte.
2. Data transfer from a slave transmitter to a master receiver. The first byte ( the slave address ) is transmitted by the
master.Theslavethenreturnsanacknowledgebit.Nextfollowsthedata bytestransmittedbytheslavetothemaster.
The master returns an acknowledge bit after all received bytes other than the last byte. At the end of the last received
byte, a "not acknowledge" is returned.
The master device generates all of the serial clock pulses and the START and STOP conditions. A transfer is ended
with a STOP condition or with a repeated START condition. Since a repeated START condition is also the beginning
of the next serial transfer, the I2C bus will not be released.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
37
PRELIMINARY
MX10E8050I /
MX10E8050IA
Modes of Operation: The on-chip SIO1 logic may operate in the following four modes:
1. Master Transmitter Mode:
Serial data output through P1.7/SDAwhile P1.6/SCL outputs the serial clock. The first byte transmitted contains the
slave address of the receiving device (7 bits) and the data direction bit. In this case the data direction bit (R/W) will be
logic 0, and we say that a “W” is transmitted. Thus the first byte transmitted is SLA+W. Serial data is transmitted 8
bits at a time.After each byte is transmitted, an acknowledge bit is received. START and STOP conditions are output
to indicate the beginning and the end of a serial transfer.
2. Master Receiver Mode:
The first byte transmitted contains the slave address of the transmitting device (7 bits) and the data direction bit. In
this case the data direction bit (R/W) will be logic 1, and we say that an “R” is transmitted. Thus the first byte
transmitted is SLA+R. Serial data is received via P1.7/SDA while P1.6/SCL outputs the serial clock. Serial data is
received8bitsata time.Aftereachbyteisreceived, anacknowledgebitistransmitted. STARTandSTOPconditions
are output to indicate the beginning and end of a serial transfer.
3. Slave Receiver Mode:
Serial data and the serial clock are received through P1.7/SDA and P1.6/SCL. After each byte is received, an
acknowledge bit is transmitted. START and STOP conditions are recognized as the beginning and end of a serial
transfer. Address recognition is performed by hardware after reception of the slave address and direction bit.
4. Slave Transmitter Mode:
The first byte is received and handled as in the slave receiver mode. However, in this mode, the direction bit will
indicate that the transfer direction is reversed. Serial data is transmitted via P1.7/SDA while the serial clock is input
through P1.6/SCL. START and STOPconditions are recognized as the beginning and end of a serial transfer.
In a given application, SIO1 may operate as a master and as a slave. In the slave mode, the SIO1 hardware looks for
its own slave address and the general call address. If one of these addresses is detected, an interrupt is requested.
When the microcontroller wishes to become the bus master, the hardware waits until the bus is free before the master
mode is entered so that a possible slave action is not interrupted. If bus arbitration is lost in the master mode, SIO1
switches to the slave mode immediately and can detect its own slave address in the same serial transfer.
SIO1 Implementation and Operation: Figure 15 shows how the on-chip I2C bus interface is implemented, and the
following text describes the individual blocks.
INPUT FILTERSAND OUTPUT STAGES
The input filters have I2C compatible input levels. If the input voltage is less than 1.5V, the input logic level is
interpreted as 0; if the input voltage is greater than 3.0V, the input logic level is interpreted as 1. Input signals are
synchronized with the internal clock (fOSC/4), and spikes shorter than three oscillator periods are filtered out.
The output stages consist of open drain transistors that can sink 3mAatV OUT < 0.4V. These open drain outputs do not
have clamping diodes to VDD. Thus, if the device is connected to the I2CbusandVDD is switched off, the I2C bus is not
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
38
PRELIMINARY
MX10E8050I /
MX10E8050IA
affected.
ADDRESS REGISTER, S1ADR
This 8-bit special function register may be loaded with the 7-bit slave address (7 most significant bits) to which SIO1
will respond when programmed as a slave transmitter or receiver. The LSB (GC) is used to enable general call address
(00H) recognition.
COMPARATOR
The comparator compares the received 7-bit slave address with its own slave address (7 most significant bits in
S1ADR). It also compares the first received 8-bit byte with the general call address (00H). If an equality is found, the
appropriate status bits are set and an interrupt is requested.
SHIFT REGISTER, S1DAT
This 8-bit special function register contains a byte of serial data to be transmitted or a byte which has just been
received. Data in S1DAT is always shifted from right to left; the first bit to be transmitted is the MSB (bit 7) and, after
a byte has been received, the first bit of received data is located at the MSB of S1DAT. While data is being shifted out,
data on the bus is simultaneously being shifted in; S1DAT always contains the last byte present on the bus. Thus, in
the event of lost arbitration, the transition from master transmitter to slave receiver is made with the correct data in
S1DAT.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
39
PRELIMINARY
MX10E8050I /
MX10E8050IA
V
DD
R
R
P
P
SDA
SCL
2
I
C bus
P1.7/SDA
P1.6/SCL
Other Device with
2
Other Device with
2
MX10E8050I / IA
I
C Interface
I
C Interface
Figure 13. Typical I2C Bus Configuration
Stop
Condition
SDA
Repeated
Start
Condition
MSB
Slave Address
R/W
Direction
Bit
Acknowledgment
Signal from Receiver
Acknowledgment
Signal from Receiver
Clock Line Held Low While
Interrupts Are Serviced
SCL
1
2
7
8
9
1
2
3±8
9
ACK
ACK
S
P/S
Repeated if more bytes
are transferred
Start
Condition
Figure 14. Data Transfer on the I2C Bus
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
40
PRELIMINARY
MX10E8050I /
MX10E8050IA
8
S1ADR
Address Register
P1.7
Comparator
Input
Filter
P1.7/SDA
S1DAT
Output
Stage
Shift Register
ACK
8
Arbitration &
Sync Logic
Input
Filter
Timing
&
Control
Logic
f
/4
OSC
P1.6/SCL
Serial Clock
Generator
Output
Stage
Interrupt
Timer 1
Overflow
S1CON
Control Register
P1.6
8
Status Bits
Status
Decoder
S1STA
Status Register
8
Figure 15. I2C Bus Serial Interface Block Diagram
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
41
PRELIMINARY
MX10E8050I /
MX10E8050IA
(3)
(1)
(1)
(2)
SDA
SCL
2
3
4
8
9
1
ACK
1. Another device transmits identical serial data.
2. Another device overrules a logic 1 (dotted line) transmitted by SIO1 (master) by pulling the SDA line low. Arbitration is
lost, and SIO1 enters the slave receiver mode.
3. SIO1 is in the slave receiver mode but still generates clock pulses until the current byte has been transmitted. SIO1 will
not generate clock pulses for the next byte. Data on SDA originates from the new master once it has won arbitration.
Figure 16. Arbitration Procedure
SDA
(1)
(3)
(1)
SCL
(2)
Mark
Space Duration
Duration
1. Another service pulls the SCL line low before the SIO1"mark" duration is complete. The serial clock generator is immediately
reset and commences with the "space" duration by pulling SCL low.
2. Another device still pulls the SCL line low after SIO1 releases SCL. The serial clock generator is forced into the wait state
until the SCL line is released.
3. The SCL line is released, and the serial clock generator commences with the mark duration.
Figure 17. Serial Clock Synchronization
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
42
PRELIMINARY
MX10E8050I /
MX10E8050IA
ARBITRATIONAND SYNCHRONIZATION LOGIC
In the master transmitter mode, the arbitration logic checks that every transmitted logic 1 actually appears as a logic
1 on the I2C bus. If another device on the bus overrules a logic 1 and pulls the SDA line low, arbitration is lost, and
SIO1 immediately changes from master transmitter to slave receiver. SIO1 will continue to output clock pulses (on
SCL) until transmission of the current serial byte is complete.
Arbitration may also be lost in the master receiver mode. Loss of arbitration in this mode can only occur while SIO1
is returning a “not acknowledge: (logic 1) to the bus. Arbitration is lost when another device on the bus pulls this signal
LOW. Since this can occur only at the end of a serial byte, SIO1 generates no further clock pulses.
Figure 16 shows the arbitration procedure.
The synchronization logic will synchronize the serial clock generator with the clock pulses on the SCL line from
another device. If two or more master devices generate clock pulses, the “mark” duration is determined by the device
that generates the shortest “marks,” and the “space” duration is determined by the device that generates the longest
“spaces.”Figure17 shows the synchronization procedure.
A slave may stretch the space duration to slow down the bus master. The space duration may also be stretched for
handshaking purposes. This can be done after each bit or after a complete byte transfer. SIO1 will stretch the SCL
space duration after a byte has been transmitted or received and the acknowledge bit has been transferred. The serial
interrupt flag (SI) is set, and the stretching continues until the serial interrupt flag is cleared.
SERIAL CLOCKGENERATOR
This programmable clock pulse generator provides the SCL clock pulses when SIO1 is in the master transmitter or
master receiver mode. It is switched off when SIO1 is in a slave mode. The programmable output clock frequencies
are: fOSC/120, fOSC/9600, and the Timer 1 overflow rate divided by eight. The output clock pulses have a 50% duty
cycle unless the clock generator is synchronized with other SCL clock sources as described above.
TIMING AND CONTROL
Thetimingandcontrollogicgeneratesthetimingandcontrolsignalsforserialbytehandling.Thislogicblockprovides
the shift pulses for S1DAT, enables the comparator, generates and detects start and stop conditions, receives and
transmits acknowledge bits, controls the master and slave modes, contains interrupt request logic, and monitors the
I2C bus status.
CONTROL REGISTER, S1CON
This 7-bit special function register is used by the microcontroller to control the following SIO1 functions: start and
restart of a serial transfer, termination of a serial transfer, bit rate, address recognition, and acknowledgment.
STATUS DECODER AND STATUS REGISTER
The status decoder takes all of the internal status bits and compresses them into a 5-bit code. This code is unique for
each I2C bus status. The 5-bit code may be used to generate vector addresses for fast processing of the various
service routines. Each service routine processes a particular bus status. There are 26 possible bus states if all four
modes of SIO1 are used. The 5-bit status code is latched into the five most significant bits of the status register when
the serial interrupt flag is set (by hardware) and remains stable until the interrupt flag is cleared by software. The three
least significant bits of the status register are always zero. If the status code is used as a vector to service routines,
then the routines are displaced by eight address locations. Eight bytes of code is sufficient for most of the service
routines (see the software example in this section).
The Four SIO1 Special Function Registers: The microcontroller interfaces to SIO1 via four special function regis-
ters. These four SFRs (S1ADR, S1DAT, S1CON, and S1STA) are described individually in the following sections.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
43
PRELIMINARY
MX10E8050I /
MX10E8050IA
The Address Register, S1ADR: The CPU can read from and write to this 8-bit, directly addressable SFR. S1ADR is
not affected by the SIO1 hardware. The contents of this register are irrelevant when SIO1 is in a master mode. In the
slave modes, the seven most significant bits must be loaded with the microcontroller’s own slave address, and, if the
least significant bit is set, the general call address (00H) is recognized; otherwise it is ignored.
7
6
5
4
3
2
1
0
S1ADR (DBH)
X
X
X
X
X
X
X
GC
own slave address
2
The most significant bit corresponds to the first bit received from the I C bus after a start condition. A logic 1 in
S1ADR corresponds to a high level on the I2C bus, and a logic 0 corresponds to a low level on the bus.
The Data Register, S1DAT: S1DAT contains a byte of serial data to be transmitted or a byte which has just been
received. The CPU can read from and write to this 8-bit, directly addressable SFR while it is not in the process of
shifting a byte. This occurs when SIO1 is in a defined state and the serial interrupt flag is set. Data in S1DAT remains
stableaslongasSIisset.Data inS1DATisalwaysshifted fromrighttoleft:thefirstbittobetransmittedistheMSB
(bit 7), and, after a byte has been received, the first bit of received data is located at the MSB of S1DAT. While data
is being shifted out, data on the bus is simultaneously being shifted in; S1DAT always contains the last data byte
present on the bus. Thus, in the event of lost arbitration, the transition from master transmitter to slave receiver is
made with the correct data in S1DAT.
7
6
5
4
3
2
1
0
S1ADR (DAH)
SD7
SD6
SD5
SD4
SD3
SD2 SD1 SD0
shift direction
SD7 - SD0:
Eightbitstobetransmittedorjustreceived.Alogic1inS1DATcorrespondstoa highlevelontheI 2Cbus, anda logic
0 corresponds to a low level on the bus. Serial data shifts through S1DAT from right to left. Figure 18 shows how data
in S1DAT is serially transferred to and from the SDA line.
S1DAT and theACK flag form a 9-bit shift register which shifts in or shifts out an 8-bit byte, followed by an acknowl-
edge bit. TheACK flag is controlled by the SIO1 hardware and cannot be accessed by the CPU. Serial data is shifted
through the ACK flag into S1DAT on the rising edges of serial clock pulses on the SCL line. When a byte has been
shifted into S1DAT, the serial data is available in S1DAT, and the acknowledge bit is returned by the control logic
during the ninth clock pulse. Serial data is shifted out from S1DAT via a buffer (BSD7) on the falling edges of clock
pulses on the SCL line.
When the CPU writes to S1DAT, BSD7 is loaded with the content of S1DAT.7, which is the first bit to be transmitted to
the SDA line (see Figure 19). After nine serial clock pulses, the eight bits in S1DAT will have been transmitted to the
SDA line, and the acknowledge bit will be present in ACK. Note that the eight transmitted bits are shifted back into
S1DAT.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
44
PRELIMINARY
MX10E8050I /
MX10E8050IA
Internal Bus
SDA
8
BSD7
S1DAT
ACK
SCL
Shift Pulses
Figure 18. Serial Input/Output Configuration
The Control Register, S1CON: The CPU can read from and write to this 8-bit, directly addressable SFR. Two bits are
affected by the SIO1 hardware: the SI bit is set when a serial interrupt is requested, and the STO bit is cleared when
a STOP condition is present on the I2C bus. The STO bit is also cleared when ENS1 = “0”.
7
6
5
4
3
2
1
0
S1CON (D8H)
CR2
ENS1
STA
STO
SI
AA
CR1 CR0
ENS1, THE SIO1 ENABLE BIT
ENS1 = “0”: When ENS1 is “0”, the SDAandSCL outputs are in a high impedance state. SDAand SCLinput signals
are ignored, SIO1 is in the “not addressed” slave state, and the STO bit in S1CON is forced to “0”. No other bits are
affected. P1.6 and P1.7 may be used as open drain I/O ports.
ENS1 = “1”: When ENS1 is “1”, SIO1 is enabled. The P1.6 and P1.7 port latches must be set to logic 1.
ENS1 should not be used to temporarily release SIO1 from the I2C bus since, when ENS1 is reset, the I2C bus status
is lost. The AA flag should be used instead (see description of the AA flag in the following text).
In the following text, it is assumed that ENS1 = “1”.
STA, THE START FLAG
STA = “1”: When the STA bit is set to enter a master mode, the SIO1 hardware checks the status of the I2C bus and
generates a START condition if the bus is free. If the bus is not free, then SIO1 waits for a STOP condition (which will
free the bus) and generates a START condition after a delay of a half clock period of the internal serial clock
generator.
If STA is set while SIO1 is already in a master mode and one or more bytes are transmitted or received, SIO1
transmits a repeated START condition. STAmay be set at any time. STAmay also be set when SIO1 is an addressed
slave.
STA = “0”: When the STA bit is reset, no START condition or repeated START condition will be generated.
STO, THE STOP FLAG
STO = “1”: When the STO bit is set while SIO1 is in a master mode, a STOP condition is transmitted to the I2C bus.
When the STOP condition is detected on the bus, the SIO1 hardware clears the STO flag. In a slave mode, the STO
flag may be set to recover from an error condition. In this case, no STOP condition is transmitted to the I2C bus.
However, the SIO1 hardware behaves as if a STOP condition has been received and switches to the defined “not
addressed” slave receiver mode. The STO flag is automatically cleared by hardware.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
45
PRELIMINARY
MX10E8050I /
MX10E8050IA
If the STA and STO bits are both set, the a STOP condition is transmitted to the I2C bus if SIO1 is in a master mode
(ina slavemode, SIO1generatesaninternalSTOPconditionwhichisnottransmitted). SIO1thentransmitsa START
condition.
STO = “0”: When the STO bit is reset, no STOP condition will be generated.
SI, THE SERIAL INTERRUPT FLAG
SI = “1”: When the SI flag is set, then, if the EAand ES1 (interrupt enable register) bits are also set, a serial interrupt
is requested. SI is set by hardware when one of 25 of the 26 possible SIO1 states is entered. The only state that does
not cause SI to be set is state F8H, which indicates that no relevant state information is available.
While SI is set, the low period of the serial clock on the SCL line is stretched, and the serial transfer is suspended. A
high level on the SCL line is unaffected by the serial interrupt flag. SI must be reset by software.
SI = “0”: When the SI flag is reset, no serial interrupt is requested, and there is no stretching of the serial clock on the
SCL line.
AA, THEASSERTACKNOWLEDGE FLAG
AA= “1”: If theAAflagisset, anacknowledge(lowleveltoSDA)willbereturnedduringtheacknowledgeclockpulse
on the SCL line when:
- The “own slave address” has been received
- The general call address has been received while the general call bit (GC) in S1ADR is set
- A data byte has been received while SIO1 is in the master receiver mode
- A data byte has been received while SIO1 is in the addressed slave receiver mode
AA= “0”: if theAAflag is reset, a not acknowledge (high level to SDA) will be returned during the acknowledge clock
pulse on SCL when:
- A data has been received while SIO1 is in the master receiver mode
- A data byte has been received while SIO1 is in the addressed slave receiver mode
When SIO1 is in the addressed slave transmitter mode, state C8H will be entered after the last serial is transmitted
(see Figure 23). When SI is cleared, SIO1 leaves state C8H, enters the not addressed slave receiver mode, and the
SDA line remains at a high level. In state C8H, the AA flag can be set again for future address recognition.
When SIO1 is in the not addressed slave mode, its own slave address and the general call address are ignored.
Consequently, no acknowledge is returned, and a serial interrupt is not requested. Thus, SIO1 can be temporarily
releasedfromtheI2C bus while the bus status is monitored. While SIO1 is released from the bus, START and STOP
conditions are detected, and serial data is shifted in. Address recognition can be resumed at any time by setting the
AAflag. If theAA flag is set when the part’s own slave address or the general call address has been partly received,
the address will be recognized at the end of the byte transmission.
CR0, CR1, AND CR2, THE CLOCK RATE BITS
These three bits determine the serial clock frequency when SIO1 is in a master mode. The various serial rates are
shown inTable 19.
A12.5kHz bit rate may be used by devices that interface to the I2C bus via standard I/O port lines which are software
driven and slow. 100kHz is usually the maximum bit rate and can be derived from a 16MHz, 12MHz, or a 6MHz
oscillator. A variable bit rate (0.5kHz to 62.5kHz) may also be used if Timer 1 is not required for any other purpose
while SIO1 is in a master mode.
The frequencies shown in Table 19 are unimportant when SIO1 is in a slave mode. In the slave modes, SIO1 will
automatically synchronize with any clock frequency up to 100kHz.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
46
PRELIMINARY
MX10E8050I /
MX10E8050IA
The Status Register, S1STA:
S1STA is an 8-bit read-only special function register. The three least significant bits are always zero. The five most
significant bits contain the status code. There are 26 possible status codes. When S1STAcontains F8H, no relevant
state information is available and no serial interrupt is requested.All other S1STAvalues correspond to defined SIO1
states. When each of these states is entered, a serial interrupt is requested (SI = “1”). Avalid status code is present
in S1STAone machine cycle after SI is set by hardware and is still present one machine cycle after SI has been reset
by software.
More Information on SIO1 Operating Modes: The four operating modes are:
-MasterTransmitter
- Master Receiver
- Slave Receiver
- Slave Transmitter
Data transfers in each mode of operation are shown in Figures 20~28. These figures contain the following abbrevia-
tions:
Abbreviation Explanation
S
Start condition
SLA
R
W
A
A
Data
P
7-bit slave address
Read bit (high level at SDA)
Write bit (low level at SDA)
Acknowledge bit (low level at SDA)
Not acknowledge bit (high level at SDA)
8-bit data byte
Stop condition
In Figures 20~28, circles are used to indicate when the serial interrupt flag is set. The numbers in the circles show the
status code held in the S1STA register. At these points, a service routine must be executed to continue or complete
the serial transfer. These service routines are not critical since the serial transfer is suspended until the serial interrupt
flag is cleared by software.
When a serial interrupt routine is entered, the status code in S1STA is used to branch to the appropriate service
routine. For each status code, the required software action and details of the following serial transfer are given in Table
21~25.
Master Transmitter Mode:
In the master transmitter mode, a number of data bytes are transmitted to a slave receiver (see Figure 20). Before the
master transmitter mode can be entered, S1CON must be initialized as follows:
7
6
5
4
3
2
1
0
S1CON (D8H)
CR2
bit
ENS1
1
STA
0
STO
0
SI
AA
x
CR1 CR0
bit rate
0
rate
CR0, CR1, and CR2 define the serial bit rate. ENS1 must be set to logic 1 to enable SIO1. If the AA bit is reset, SIO1
will not acknowledge its own slave address or the general call address in the event of another device becoming
master of the bus. In other words, if AA is reset, SIO0 cannot enter a slave mode. STA, STO, and SI must be reset.
ThemastertransmittermodemaynowbeenteredbysettingtheSTAbitusingtheSETBinstruction.TheSIO1logic
will now test the I2C bus and generate a start condition as soon as the bus becomes free. When a START condition
is transmitted, the serial interrupt flag (SI) is set, and the status code in the status register (S1STA) will be 08H. This
status code must be used to vector to an interrupt service routine that loads S1DAT with the slave address and the
data direction bit (SLA+W). The SI bit in S1CON must then be reset before the serial transfer can continue.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
47
PRELIMINARY
MX10E8050I /
MX10E8050IA
When the slave address and the direction bit have been transmitted and an acknowledgment bit has been received,
the serial interrupt flag (SI) is set again, and a number of status codes in S1STAare possible. There are 18H, 20H, or
38H for the master mode and also 68H, 78H, or B0H if the slave mode was enabled (AA= logic 1). The appropriate
action to be taken for each of these status codes is detailed in Table 21. After a repeated start condition (state 10H).
SIO1 may switch to the master receiver mode by loading S1DAT with SLA+R).
SDA
SCL
D7
D6
D5
D4
D3
D2
D1
D0
A
Shift ACK & S1DAT
Shift In
ACK
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
A
S1DAT
(1)
(1)
Shift BSD7
Shift Out
BSD7
D7
D6
D5
D4
D3
D2
D1
D0
(3)
Loaded by the CPU
(1) Valid data in S1DAT
(2) Shifting data in S1DAT and ACK
(3) High level on SDA
Figure 19. Shift-in and Shift-out Timing
Table 20 : Serial Clock Rates
BIT FREQUENCY (kHz) AT fOSC
CR2
0
0
0
0
1
1
1
CR1
0
0
1
1
0
0
1
CR0
0
1
0
1
0
1
0
6MHz
23
27
31
37
6.25
50
100
12MHz
47
54
63
75
12.5
100
-
16MHz
63
71
83
100
17
-
-
fOSC DIVIDED BY
256
224
192
160
960
120
60
1
1
1
0.25<62.5 0.5<62.5
0.67<56
96x(256-reload valueTimer1)
(Reload value range:0-254 in mode2)
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
48
PRELIMINARY
MX10E8050I /
MX10E8050IA
MT
Successful Transmission to
a Slave Receiver
S
SLA
W
A
Data
A
P
28H
08H
18H
Next Transfer Started with a Repeated Start Condition
Not Acknowledge Received after the Slave Address
S
SLA
W
R
10H
A
P
20H
To MST/REC Mode
Entry = MR
Not Acknowledge Received after a Data Byte
A
P
30H
Arbitration Lost in Slave Address or Data Byte
Other MST
Continues
Other MST
Continues
A or A
38H
A or A
38H
Arbitration Lost and Addressed as Slave
Other MST
Continues
A
To Corresponding
States in Slave Mode
68H
78H
80H
From Master to Slave
From Slave to Master
Data
n
A
Any Number of Data Bytes and Their Associated Acknowledge Bits
2
This Number (Contained in S1STA) Corresponds to a Defined State of the I C Bus. See Table 21.
Figure 20. Format and States in the Master Transmitter Mode
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
49
PRELIMINARY
MX10E8050I /
MX10E8050IA
Data
MR
Successful Reception
from a Slave Transmitter
S
SLA
R
A
Data
A
Data
A
P
50H
58H
08H
40H
Next Transfer Started with a Repeated Start Condition
Not Acknowledge Received after the Slave Address
S
SLA
R
10H
A
P
W
48H
To MST/TRX Mode
Entry = MT
Arbitration Lost in Slave Address or Acknowledge Bit
Other MST
Continues
Other MST
Continues
A
A or A
38H
38H
Arbitration Lost and Addressed as Slave
Other MST
Continues
A
To Corresponding
States in Slave Mode
68H
78H
80H
From Master to Slave
From Slave to Master
Any Number of Data Bytes and Their Associated Acknowledge Bits
Data
n
A
2
This Number (Contained in S1STA) Corresponds to a Defined State of the I C Bus. See Table 22.
Figure 21. Format and States in the Master Receiver Mode
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
50
PRELIMINARY
MX10E8050I /
MX10E8050IA
Reception of the Own Slave Address
and One or More Data Bytes
All Are Acknowledged.
S
SLA
W
A
Data
A
Data
A
P or S
A0H
80H
80H
60H
Last Data Byte Received Is
Not Acknowledged
P or S
A
88H
Arbitration Lost as MST and
Addressed as Slave
A
68H
Reception of the General Call Address
and One or More Data Bytes
General
Call
Data
A
A
Data
A
P or S
A0H
90H
90H
70H
Last Data Byte Is Not Acknowledged
P or S
A
98H
Arbitration Lost as MST and Addressed as Slave by General Call
A
78H
From Master to Slave
From Slave to Master
Data
n
A
Any Number of Data Bytes and Their Associated Acknowledge Bits
2
This Number (Contained in S1STA) Corresponds to a Defined State of the I C Bus. See Table 23.
Figure 22. Format and States in the Slave Receiver Mode
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
51
PRELIMINARY
MX10E8050I /
MX10E8050IA
Reception of the Own
Slave Address and
Transmission of One or
More Data Bytes
S
SLA
R
A
Data
A
Data
A
P or S
B8H
C0H
A8H
Arbitration Loast as MST and
Addressed as Slave
A
From Master to Slave
From Slave to Master
B0H
Last Data Byte Transmitted.
Switched to Not Addressed Slave
(AA Bit in S1CON = "0"
P or S
A
All "1"s
C8H
Data
n
A
Any Number of Data Bytes and Their Associated Acknowledge Bits
2
This Number (Contained in S1STA) Corresponds to a Defined State of the I C Bus. See Table 24.
Figure 23. Format and States of the Slave Transmitter Mode
Master Receiver Mode:
In the master receiver mode, a number of data bytes are received from a slave transmitter (see Figure 21). The
transfer is initialized as in the master transmitter mode. When the start condition has been transmitted, the interrupt
service routine must load S1DAT with the 7-bit slave address and the data direction bit (SLA+R). The SI bit in S1CON
must then be cleared before the serial transfer can continue.
When the slave address and the data direction bit have been transmitted and an acknowledgment bit has been
received, the serial interrupt flag (SI) is set again, and a number of status codes in S1STA are possible. These are
40H, 48H, or 38H for the master mode and also 68H, 78H, or B0H if the slave mode was enabled (AA= logic 1). The
appropriate action to be taken for each of these status codes is detailed in Table 22. ENS1, CR1, and CR0 are not
affected by the serial transfer and are not referred to in Table 22. After a repeated start condition (state 10H), SIO1
may switch to the master transmitter mode by loading S1DAT with SLA+W.
Slave Receiver Mode:
In the slave receiver mode, a number of data bytes are received from a master transmitter (see Figure 22). To initiate
the slave receiver mode, S1ADR and S1CON must be loaded as follows:
7
6
5
4
3
2
1
0
S1ADR (DBH)
X
X
X
X
X
X
X
GC
own slave address
The upper 7 bits are the address to which SIO1 will respond when addressed by a master. If the LSB (GC) is set, SIO1
will respond to the general call address (00H); otherwise it ignores the general call address.
7
6
5
4
3
2
AA
1
1
0
S1CON (D8H)
CR2
X
ENS1
1
STA
0
STO
0
SI
0
CR1 CR0
X
X
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
52
PRELIMINARY
MX10E8050I /
MX10E8050IA
CR0, CR1, and CR2 do not affect SIO1 in the slave mode. ENS1 must be set to logic 1 to enable SIO1. TheAAbit
must be set to enable SIO1 to acknowledge its own slave address or the general call address. STA, STO, and SI must
be reset.
When S1ADR and S1CON have been initialized, SIO1 waits until it is addressed by its own slave address followed by
the data direction bit which must be “0” (W) for SIO1 to operate in the slave receiver mode. After its own slave
address and the W bit have been received, the serial interrupt flag (I) is set and a valid status code can be read from
S1STA. This status code is used to vector to an interrupt service routine, and the appropriate action to be taken for
each of these status codes is detailed in Table 23. The slave receiver mode may also be entered if arbitration is lost
while SIO1 is in the master mode (see status 68H and 78H).
If theAAbit is reset during a transfer, SIO1 will return a not acknowledge (logic 1) to SDAafter the next received data
byte. While AA is reset, SIO1 does not respond to its own slave address or a general call address. However, the I2C
bus is still monitored and address recognition may be resumed at any time by settingAA. This means that theAAbit
may be used to temporarily isolate SIO1 from the I2C bus.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
53
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 21 : Master Transmitter Mode
APPLICATION SOFTWARE RESPONSE
STATUS
CODE
(S1STA)
STATUS OF THE
I C BUS AND
SIO1 HARDWARE
2
TO S1CON
NEXT ACTION TAKEN BY SIO1 HARDWARE
TO/FROM S1DAT
STA STO
SI
AA
08H
10H
A START condition has
been transmitted
Load SLA+W
X
0
0
X
SLA+W will be transmitted;
ACK bit will be received
A repeated START
condition has been
transmitted
Load SLA+W or
Load SLA+R
X
X
0
0
0
0
X
X
As above
SLA+W will be transmitted;
SIO1 will be switched to MST/REC mode
18H
20H
28H
30H
38H
SLA+W has been
transmitted; ACK has
been received
Load data byte or
0
0
0
X
Data byte will be transmitted;
ACK bit will be received
Repeated START will be transmitted;
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
no S1DAT action or
no S1DAT action or
1
0
0
1
0
0
X
X
no S1DAT action
Load data byte or
1
0
1
0
0
0
X
X
SLA+W has been
transmitted; NOT ACK
has been received
Data byte will be transmitted;
ACK bit will be received
Repeated START will be transmitted;
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
no S1DAT action or
no S1DAT action or
1
0
0
1
0
0
X
X
no S1DAT action
1
0
1
0
0
0
X
X
Data byte in S1DAT has Load data byte or
been transmitted; ACK
has been received
Data byte will be transmitted;
ACK bit will be received
Repeated START will be transmitted;
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
no S1DAT action or
no S1DAT action or
1
0
0
1
0
0
X
X
no S1DAT action
1
0
1
0
0
0
X
X
Data byte in S1DAT has Load data byte or
been transmitted; NOT
ACK has been received
Data byte will be transmitted;
ACK bit will be received
Repeated START will be transmitted;
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
no S1DAT action or
no S1DAT action or
1
0
0
1
0
0
X
X
no S1DAT action
1
1
0
X
2
Arbitration lost in
SLA+R/W or
Data bytes
No S1DAT action or
No S1DAT action
0
1
0
0
0
0
X
X
I C bus will be released;
not addressed slave will be entered
A START condition will be transmitted when the
bus becomes free
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
54
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 22 : Master Receiver Mode
STATUS
CODE
(S1STA)
08H
STATUS OF THE
APPLICATION SOFTWARE RESPONSE
2
I C BUS AND
TO/FROM S1DAT
TO S1CON
NEXT ACTION TAKEN BY SIO1 HARDWARE
SIO1 HARDWARE
STA STO
SI
AA
A START condition has
been transmitted
Load SLA+R
X
0
0
X
SLA+R will be transmitted;
ACK bit will be received
10H
38H
A repeated START
condition has been
transmitted
Load SLA+R or
Load SLA+W
X
X
0
0
0
0
X
X
As above
SLA+W will be transmitted;
SIO1 will be switched to MST/TRX mode
2
Arbitration lost in
NOT ACK bit
No S1DAT action or
No S1DAT action
0
1
0
0
0
0
X
X
I C bus will be released;
SIO1 will enter a slave mode
A START condition will be transmitted when the
bus becomes free
40H
48H
SLA+R has been
transmitted; ACK has
been received
No S1DAT action or
no S1DAT action
0
0
0
0
0
0
0
1
Data byte will be received;
NOT ACK bit will be returned
Data byte will be received;
ACK bit will be returned
SLA+R has been
transmitted; NOT ACK
has been received
No S1DAT action or
no S1DAT action or
no S1DAT action
1
0
1
0
1
1
0
0
0
X
X
X
Repeated START condition will be transmitted
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
50H
58H
Data byte has been
received; ACK has been
returned
Read data byte or
read data byte
0
0
0
0
0
0
0
1
Data byte will be received;
NOT ACK bit will be returned
Data byte will be received;
ACK bit will be returned
Data byte has been
received; NOT ACK has
been returned
Read data byte or
read data byte or
read data byte
1
0
1
0
1
1
0
0
0
X
X
X
Repeated START condition will be transmitted
STOP condition will be transmitted;
STO flag will be reset
STOP condition followed by a
START condition will be transmitted;
STO flag will be reset
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
55
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 23 : Slave Receiver Mode
STATUS
CODE
(S1STA)
60H
STATUS OF THE
APPLICATION SOFTWARE RESPONSE
2
I C BUS AND
TO/FROM S1DAT
TO S1CON
NEXT ACTION TAKEN BY SIO1 HARDWARE
SIO1 HARDWARE
STA STO
SI
AA
Own SLA+W has
been received; ACK
has been returned
No S1DAT action or
X
0
0
0
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
no S1DAT action
X
X
0
0
0
0
1
0
68H
Arbitration lost in
SLA+R/W as master;
Own SLA+W has
been received, ACK
returned
No S1DAT action or
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
no S1DAT action
X
0
0
1
70H
78H
General call address
(00H) has been
received; ACK has
been returned
No S1DAT action or
no S1DAT action
X
X
0
0
0
0
0
1
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
Arbitration lost in
SLA+R/W as master;
General call address
has been received,
ACK has been
No S1DAT action or
no S1DAT action
X
X
0
0
0
0
0
1
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
returned
80H
88H
Previously addressed Read data byte or
with own SLV
X
X
0
0
0
0
0
1
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
address; DATA has
been received; ACK
has been returned
read data byte
Previously addressed Read data byte or
with own SLA; DATA
0
0
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1
byte has been
read data byte or
received; NOT ACK
has been returned
read data byte or
1
1
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address. A
START condition will be transmitted when the bus
becomes free
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1. A START condition
will be transmitted when the bus becomes free.
read data byte
90H
98H
Previously addressed Read data byte or
with General Call;
X
X
0
0
0
0
0
1
Data byte will be received and NOT ACK will be
returned
Data byte will be received and ACK will be returned
DATA byte has been
received; ACK has
been returned
read data byte
Previously addressed Read data byte or
with General Call;
0
0
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1
DATA byte has been
received; NOT ACK
has been returned
read data byte or
read data byte or
1
1
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address. A
START condition will be transmitted when the bus
becomes free
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1. A START condition
will be transmitted when the bus becomes free.
read data byte
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
56
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 23 : Slave Receiver Mode (Continued)
STATUS
CODE
(S1STA)
A0H
STATUS OF THE
APPLICATION SOFTWARE RESPONSE
2
I C BUS AND
TO/FROM S1DAT
TO S1CON
NEXT ACTION TAKEN BY SIO1 HARDWARE
SIO1 HARDWARE
STA STO
SI
AA
A STOP condition or
repeated START
condition has been
received while still
addressed as
No STDAT action or
No STDAT action or
0
0
0
0
0
0
Switched to not addressed SLV mode; no
recognition of own SLA or General call address
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1
0
1
SLV/REC or SLV/TRX No STDAT action or
1
1
0
0
0
0
Switched to not addressed SLV mode; no
recognition of own SLA or General call address. A
START condition will be transmitted when the bus
becomes free
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1. A START condition
will be transmitted when the bus becomes free.
No STDAT action
0
1
Table 24 : Slave Transmitter Mode
STATUS
CODE
(S1STA)
A8H
STATUS OF THE
APPLICATION SOFTWARE RESPONSE
TO/FROM S1DAT TO S1CON
2
I C BUS AND
NEXT ACTION TAKEN BY SIO1 HARDWARE
SIO1 HARDWARE
STA STO
SI
AA
Own SLA+R has been Load data byte or
received; ACK has
X
0
0
0
Last data byte will be transmitted and
ACK bit will be received
been returned
load data byte
X
X
0
0
0
0
1
0
Data byte will be transmitted; ACK will be received
B0H
Arbitration lost in
SLA+R/W as master;
Load data byte or
Last data byte will be transmitted and ACK bit will
be received
Own SLA+R has been load data byte
received, ACK has
X
0
0
1
Data byte will be transmitted; ACK bit will be
received
been returned
B8H
C0H
Data byte in S1DAT
has been transmitted;
ACK has been
Load data byte or
load data byte
X
X
0
0
0
0
0
1
Last data byte will be transmitted and
ACK bit will be received
Data byte will be transmitted; ACK bit will be
received
received
Data byte in S1DAT
has been transmitted;
NOT ACK has been
received
No S1DAT action or
no S1DAT action or
0
0
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1
no S1DAT action or
no S1DAT action
1
1
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address. A
START condition will be transmitted when the bus
becomes free
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1. A START condition
will be transmitted when the bus becomes free.
C8H
Last data byte in
S1DAT has been
transmitted (AA = 0);
ACK has been
received
No S1DAT action or
no S1DAT action or
0
0
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1
no S1DAT action or
no S1DAT action
1
1
0
0
0
0
0
1
Switched to not addressed SLV mode; no
recognition of own SLA or General call address. A
START condition will be transmitted when the bus
becomes free
Switched to not addressed SLV mode; Own SLA will
be recognized; General call address will be
recognized if S1ADR.0 = logic 1. A START condition
will be transmitted when the bus becomes free.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
57
PRELIMINARY
MX10E8050I /
MX10E8050IA
Slave Transmitter Mode:
In the slave transmitter mode, a number of data bytes are transmitted to a master receiver (see Figure 23). Data
transfer is initialized as in the slave receiver mode. When S1ADR and S1CON have been initialized, SIO1 waits until
it is addressed by its own slave address followed by the data direction bit which must be “1” (R) for SIO1 to operate
in the slave transmitter mode. After its own slave address and the R bit have been received, the serial interrupt flag
(SI) is set and a valid status code can be read from S1STA. This status code is used to vector to an interrupt service
routine, and the appropriate action to be taken for each of these status codes is detailed in Table 24. The slave
transmitter mode may also be entered if arbitration is lost while SIO1 is in the master mode (see state B0H).
IftheAAbitisresetduringa transfer, SIO1willtransmitthelastbyteofthetransferandenterstateC0HorC8H. SIO1
is switched to the not addressed slave mode and will ignore the master receiver if it continues the transfer. Thus the
master receiver receives all 1s as serial data. WhileAAis reset, SIO1 does not respond to its own slave address or
a general call address. However, the I2C bus is still monitored, and addressrecognition may be resumed at anytime
2
by setting AA. This means that the AA bit may be used to temporarily isolate SIO1 from the I C bus.
Miscellaneous States:
There are two S1STA codes that do not correspond to a defined SIO1 hardware state (see Table 25). These are
discussed below.
S1STA = F8H:
This status code indicates that no relevant information is available because the serial interrupt flag, SI, is not yet set.
This occurs between other states and when SIO1 is not involved in a serial transfer.
S1STA = 00H:
This status code indicates that a bus error has occurred during an SIO1 serial transfer. Abus error is caused when a
START or STOP condition occurs at an illegal position in the format frame. Examples of such illegal positions are
during the serial transfer of an address byte, a data byte, or an acknowledge bit. A bus error may also be caused when
external interference disturbs the internal SIO1 signals. When a bus error occurs, SI is set. To recover from a bus
error, the STO flag must be set and SI must be cleared. This causes SIO1 to enter the “not addressed” slave mode
(a defined state) and to clear the STO flag (no other bits in S1CONare affected). The SDAand SCL lines are released
(a STOP condition is not transmitted).
Some Special Cases:
The SIO1 hardware has facilities to handle the following special cases that may occur during a serial transfer:
Simultaneous Repeated START Conditions from Two MastersArepeated START condition may be generated in the
master transmitter or master receiver modes. A special case occurs if another master simultaneously generates a
repeated START condition (see Figure 24). Until this occurs, arbitration is not lost by either master since they were
both transmitting the same data.
If the SIO1 hardware detects a repeated START condition on the I2C bus before generating a repeated START
condition itself, it will release the bus, and no interrupt request is generated. If another master frees the bus by
generating a STOP condition, SIO1 will transmit a normal START condition (state 08H), and a retry of the total serial
data transfer can commence.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
58
PRELIMINARY
MX10E8050I /
MX10E8050IA
DATA TRANSFERAFTER LOSS OF ARBITRATION
Arbitration may be lost in the master transmitter and master receiver modes (see Figure 16). Loss of arbitration is
indicated by the following states in S1STA; 38H, 68H, 78H, and B0H (see Figures 20 and 21).
If the STA flag in S1CON is set by the routines which service these states, then, if the bus is free again, a START
condition (state 08H) is transmitted without intervention by the CPU, and a retry of the total serial transfer can
commence.
FORCEDACCESS TO THE I2C BUS
In some applications, it may be possible for an uncontrolled source to cause a bus hang-up. In such situations, the
problem may be caused by interference, temporary interruption of the bus or a temporary short-circuit between SDA
and SCL.
2
If an uncontrolled source generates a superfluous START or masks a STOP condition, then the I C bus stays busy
indefinitely. If the STA flag is set and bus access is not obtained within a reasonable amount of time, then a forced
access to the I2C bus is possible. This is achieved by setting the STO flag while the STA flag is still set. No STOP
condition is transmitted. The SIO1 hardware behaves as if a STOP condition was received and is able to transmit a
START condition. The STO flag is cleared by hardware.
I2C BUS OBSTRUCTED BY A LOW LEVEL ON SCL OR SDA
An I2C bus hang-up occurs if SDA or SCL is pulled LOW by an uncontrolled source. If the SCL line is obstructed
(pulled LOW) by a device on the bus, no further serial transfer is possible, and the SIO1 hardware cannot resolve this
type of problem. When this occurs, the problem must be resolved by the device that is pulling the SCL bus line LOW.
If the SDA line is obstructed by another device on the bus (e.g., a slave device out of bit synchronization), the
problem can be solved by transmitting additional clock pulses on the SCL line(see figure 26). The SIO1 hardware
transmits additional clock pulses when the STA flag is set, but no START condition can be generated because the
SDA line is pulled LOW while the I2C bus is considered free. The SIO1 hardware attempts to generate a START
condition after every two additional clock pulses on the SCL line. When the SDAline is eventually released, a normal
START condition is transmitted, state 08H is entered, and the serial transfer continues.
If a forced bus access occurs or a repeated START condition is transmitted while SDA is obstructed (pulled LOW),
the SIO1 hardware performs the same action as described above. In each case, state 08H is entered after a success-
ful STARTcondition is transmitted and normal serial transfer continues.Note that the CPU is not involved in solving
these bus hang-up problems.
BUS ERROR
Abus error occurs when a STARTor STOP condition is present at an illegal position in the format frame. Examples
of illegal positions are during the serial transfer of an address byte, a data or an acknowledge bit.
The SIO1 hardware only reacts to a bus error when it is involved in a serial transfer either as a master or an addressed
slave. When a bus error is detected, SIO1 immediately switches to the not addressed slave mode, releases the SDA
and SCL lines, sets the interrupt flag, and loads the status register with 00H. This status code may be used to vector
to a service routine which either attempts the aborted serial transfer again or simply recovers from the error condition
asshowninTable25.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
59
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 25 : Miscellaneous States
STATUS
CODE
(S1STA)
F8H
STATUS OF THE
APPLICATION SOFTWARE RESPONSE
2
I C BUS AND
TO/FROM S1DAT
TO S1CON
NEXT ACTION TAKEN BY SIO1 HARDWARE
SIO1 HARDWARE
STA STO
SI
AA
No relevant state
information available;
SI = 0
No S1DAT action
No S1CON action
Wait or proceed current transfer
00H
Bus error during MST or No S1DAT action
selected slave modes,
due to an illegal START
or STOP condition. State
00H can also occur
0
1
0
X
Only the internal hardware is affected in the
MST or addressed SLV modes. In all cases,
the bus is released and SIO1 is switched to the
not addressed SLV mode. STO is reset.
when interference
causes SIO1 to enter an
undefined state.
S
SLA
W
A
Data
A
S
Other MST Continues
P
S
SLA
08H
18H
28H
08H
Other Master Sends Repeated
START Condition Earlier
Retry
Figure 24. Simultaneous Repeated START Conditions from 2 Masters
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
60
PRELIMINARY
MX10E8050I /
MX10E8050IA
Time Limit
STA flag
STO flag
SDA line
SCL line
Start Condition
Figure 25. Forced Access to a Busy I2C Bus
STA flag
(2)
(3)
(1)
(1)
SDA line
SCL line
Start Condition
(1) Unsuccessful attempt to send a Start condition
(2) SDA line released
(3) Successful attempt to send a Start condition; state 08H is entered
Figure 26. Recovering from a Bus Obstruction Caused by a Low Level on SDA
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
61
PRELIMINARY
MX10E8050I /
MX10E8050IA
FLASH EPROM MEMORY
GENERAL DESCRIPTION
The MX10E8050I Serial Flash memory augments EPROM functionality with in-circuit electrical erasure and program-
ming. ( MX10E8050I ) The Flash can be read and written as bytes. The Chip Erase operation will erase the entire
programmemory.TheBlockErasefunctioncaneraseanyFlashblock. In-systemprogrammingandstandardparallel
programming are both available for MX10E8050I. Standard parallel programming is available for MX10E8050I. On-
chip erase and write timing generation contribute to a user-friendly programming interface.
The MX10E8050I Flash reliably stores memory contents even after 100 erase and program cycles. The cell is
designed to optimize the erase and programming mechanisms. In addition, the combination of advanced tunnel oxide
processing and low internal electric fields for erase and programming operations produces reliable cycling. The
MX10E8050I uses a +3.3 V Vcc supply to perform the Program/Erase algorithms.
FEATURES
- Flash EPROM internal program memory with Block Erase.
- Internal 2 k byte fixed boot ROM, containing low-level in-system programming routines and a default serial loader.
UserprogramcancalltheseroutinestoperformIn-ApplicationProgramming(IAP).TheBootROMcanbeturnedoff
to provide access to the full 64 k byte Flash memory. ( MX10E8050I/IA )
- Boot vector allows user provided Flash loader code to reside anywhere in the Flash memory space. This
configuration provides flexibility to the user. ( MX10E8050I/IA )
- Default loader in Boot ROM allows programming via the serial port without the need for a user provided loader.
( MX10E8050I/IA )
- Up to 64 kB external program memory if the internal program memory is disabled ( EA = 0 ).
- Programming and erase voltage +3.3V
- Read/Programming/Erase:
- Byte read ( 90 ns access time ).
- Byte Programming ( 50 us typically ).
- Typical erase times:
Block Erase (16 k bytes ) in 1 second.
Full Erase ( 64 k bytes ) in 4 seconds.
- Parallel programming with JEDEC compatible hardware interface to programmer.
- In-system programming.
- Programmable security for the code in the Flash.
- 100 minimum erase/program cycles for each byte.
- 10-year minimum data retention.
CAPABILITIES OF THE MX10E8050I FLASH-BASED MICROCONTROLLERS
Flash organization
The MX10E8050I Serial contains 64Kbytes of Flash program memory. This memory is organized as 4 separate
blocks. Each of the blocks is 16k bytes.
Figure 28 depicts the Flash memory configurations.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
62
PRELIMINARY
MX10E8050I /
MX10E8050IA
Flash Programming and Erasure
MX10E8050I has three methods of erasing or programming of the Flash memory that may be used. First, the Flash
may be programmed or erased in the end-user application by calling low-level routines through a common entry point
intheBootROM.Theend-userapplication,though,mustbeexecutingcodefroma differentblockthantheblockthat
is being erased or programmed. Second, the on-chip ISP boot loader may be invoked. This ISP boot loader will, in
turn, call low-level routines through the same common entry point in the Boot ROM that can be used by the end-user
application. Third, the Flash may be programmed or erased using the parallel method by using a commercially
available EPROM programmer. The parallel programming method used by these devices is similar to that used by
EPROM 87C51, but it is not identical, and the commercially available programmer will need to have support for these
devices. MX10E8050I/IAhas parallel programming method of erasing or programming of the Flash memory.
Boot ROM ( MX10E8050I )
When the microcontroller programs its own Flash memory, all of the low level details are handled by code that is
permanently contained in a 2k byte Boot ROM that is separate from the Flash memory. A user program simply calls
the common entry point with appropriate parameters in the Boot ROM to accomplish the desired operation. Boot ROM
operations include things like: erase block, program byte, verify byte, program security lock bit, etc. The Boot ROM
overlaystheprogrammemoryspaceatthetopoftheaddressspacefromF800toFFFFhex, whenitisenabled.The
Boot ROM may be turned off so that the upper 2k bytes of Flash program memory are accessible for execution.
FFFF
C000
FFFF
FC00
BOOT ROM
BLOCK 3
F800
16k BYTES
2k BYTES
MX10E8050I/IA
BLOCK 2
16k BYTES
PROGRAM
ADDRESS
8000
4000
0000
BLOCK 1
16k BYTES
BLOCK 0
16k BYTES
Fig 28. Flash Memory Configurations
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
63
PRELIMINARY
MX10E8050I /
MX10E8050IA
Power-On Reset Code Execution
The MX10E8050I contains two special Flash registers: the BOOT VECTOR and the STATUS BYTE. At the falling
edge of reset, the MX10E8050I examines the contents of the Status Byte. If the Status Byte is set to zero, power-up
execution starts at location 0000H, which is the normal start address of the user's application code. When the Status
Byte is set to a value other than zero, the contents of the Boot Vector is used as the high byte of the execution
address and the low byte is set to 00H. The factory default setting is 0FCH, corresponds to the address 0FC00H for
thefactorymasked-ROMISPbootloader.AcustombootloadercanbewrittenwiththeBootVectorsettothecustom
boot loader.
NOTE: When erasing the Status Byte or Boot Vector, both bytes are erased at the same time. It is necessary to
reprogram the Boot Vector after erasing and updating the Status Byte.
Hardware Activation of the Boot Loader ( MX10E8050I )
The boot loader can also be executed by holding PSENLOW, EAgreater thanV (suchas+3.3V),andALEHIGH
IH
( or not connected ) at the falling edge of RESET. This is the same effect as having a non-zero status byte. This allows
an application to be built that will normally execute the end user’s code but can be manually forced into ISP opera-
tion.
If the factory default setting for the Boot Vector ( 0FCH ) is changed, it will no longer point to the ISP masked-ROM
boot loader code. If this happens, the only way it is possible to change the contents of the Boot Vector is through the
parallel programming method, provided that the end user application does not contain a customized loader that
provides for erasing and reprogramming of the BootVector and Status Byte.
AfterprogrammingtheFlash,thestatusbyteshouldbeprogrammedtozeroinordertoallowexe cution of the user’s
application code beginning at address 0000H.
V
CC
EA
+ 3.3V
RST
V
+3.3V
TxD
CC
TxD
RxD
RxD
XTAL2
V
SS
MX10E8050I / IA
PSEN
ALE
3.3V
XTAL1
V
SS
Fig 29. In-System Programming with a Minimum of Pins
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
64
PRELIMINARY
MX10E8050I /
MX10E8050IA
In-System Programming ( ISP )
* MX10E8050I : UART
The In-System Programming (ISP) is performed without removing the microcontroller from the system.The In-Sys-
tem Programming (ISP) facility consists of a series of internal hardware resources coupled with internal firmware to
facilitate remote programming of the MX10E8050I Serial through the serial port. This firmware is provided by MXIC
and embedded within each MX10E8050I Serial device.
The MXIC In-System Programming (ISP) facility has made in-circuit programming in an embedded application pos-
sible with a minimum of additional expense in components and circuit board area.
The ISP function uses five pins: TxD, RxD, V , V , and EA. Only a small connector needs to be available to
SS
CC
interface your application to an external circuit in order to use this feature. The EA supply should be adequately
decoupled and EA not allowed to exceed datasheet limits.
Using the In-System Programming ( ISP ) ( MX10E8050I )
The ISP feature allows for a wide range of baud rates to be used in your application, independent of the oscillator
frequency. It is also adaptable to a wide range of oscillator frequencies. This is accomplished by measuring the bit-
time of a single bit in a received character. This information is then used to program the baud rate in terms of timer
counts based on the oscillator frequency. The ISP feature requires that an initial character (an uppercase U) be sent
to the MX10E8050I to establish the baud rate. The ISP firmware provides auto-echo of received characters.
Once baud rate initialization has been performed, ISP firmware accepts two types record, Intel Hex Record or Binary
Record. Intel Hex Record : Intel Hex records consist of ASCII characters used to represent hexadecimal values and
are summarized below:
:NNAAAARRDD..DDCC<crlf>
In the Intel Hex record, the “NN” represents the number of data bytes in the record. The MX10E8050I will accept up
to 16 (10H) data bytes. The “AAAA” string represents the address of the first byte in the record. If there are zero bytes
in the record, this field is often set to 0000. The “RR” string indicates the record type. Arecord type of “00” is a data
record. A record type of “01” indicates the end-of-file mark. In this application, additional record types will be added
to indicate either commands or data for the ISP facility. The maximum number of data bytes in a record is limited to
16 (decimal). ISP commands are summarized in Table 26.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
65
PRELIMINARY
MX10E8050I /
MX10E8050IA
Binary Record :
Binary Record type same with Intel Hex Record, but need to convert hexadecimal value represented by the ASCII
character to binary value. A pair of hexadecimal values converts to one binary value. Special characters don’t be
changed, eg “:”, “.”,“U”.
In the Intel Hex Record, the “NN” represents the number of data bytes in the record. The 1st “N” will be converted
to the High Nibble and the 2nd “N” will be converted to the Low Nibble in the Binary Record. Eg “07”, binary value
in Binary Record = [07H](1-byte); “07F5”, binary value in Binary Record = [07H][F5H] (2-bytes).
Example:
:0100000307F5 (13-bytes) full chip erase
Display of binary value in Binary Record:
:
01
00
00
03
07
F5
[3AH] [01H] [00H] [00H] [03H] [07H] [F5H]
(7-bytes)
Display of binary value of ASCII characters in Intel Hex Record:
:
0
1
0
0
0
0
0
3
0
7
F
5
[3AH] [30H] [31H] [30H] [30H] [30H] [30H] [30H] [33H] [30H] [37H] [46H] [35H] (13-bytes)
Where (binary value of ASCII characters):
“:” = 3AH
“0” = 30H
“1” = 31H
“3” = 33H
“5” = 35H
“7” = 37H
“F” = 46H
As a record is received by the MX10E8050I, the information in the record is stored internally and a checksum
calculation is performed. The operation indicated by the record type is not performed until the entire record has been
received. Should an error occur in the checksum, the MX10E8050I will send an “X” out the serial port indicating a
checksum error. If the checksum calculation is found to match the checksum in the record, then the command will be
executed. In most cases, successful reception of the record will be indicated by transm itting a “.” character out the
serial port (displaying the contents of the internal program memory is an exception).
In the case of a Data Record (record type 00), an additional check is made. A “.” character will NOT be sent unless
the record checksum matched the calculated checksum and all of the bytes in the record were successfully pro-
grammed. For a data record, an “X” indicates that the checksum failed to match, and an “R” character indicates that
one of the bytes did not properly program.
WinISP, a software utility to implement ISP programming with a PC, is available from MXIC. Commercial serial ISP
programmers are available from third parties.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
66
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 26 : Command Records Used by In-System Programming
RECORDTYPE
00
COMMAND/DATAFUNCTION
Program Data
:nnaaaa00dd....ddcc
Where:
Nn = number of bytes (hex) in record
Aaaa = memory address of first byte in record
dd....dd = data bytes
cc = checksum
Example:
:10008000AF5F67F0602703E0322CFA92007780C3FD
01
02
End of File (EOF), no operation
:xxxxxx01cc
Where:
xxxxxx = required field, but value is a “don’t care”
cc = checksum
Example:
:00000001FF
Specify Oscillator Frequency
:01xxxx02ddcc
Where:
xxxx = required field, but value is a “don’t care”
dd = integer oscillator frequency rounded down to nearest MHz
cc = checksum
Example:
:0100000210ED (dd = 10h = 16, used for 16.0–16.9 MHz)
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
67
PRELIMINARY
MX10E8050I /
MX10E8050IA
RECORDTYPE
03
COMMAND/DATAFUNCTION
MiscellaneousWriteFunctions
:nnxxxx03ffssddcc
Where:
nn = number of bytes (hex) in record
xxxx = required field, but value is a “don’t care”
03 = Write Function
ff = subfunction code
ss = selection code
dd = data input (as needed)
cc = checksum
Subfunction Code = 01 (Erase Blocks)
ff = 01
ss = block code as shown below:
block 0, 0k to 16k, 00H
block 1, 16k to 32k, 40H
block 2, 32k to 48k, 80H
block 3, 48k to 64k, C0H
Example:
:0200000301C03A erase block 3
Subfunction Code = 04 (Erase BootVector and Status Byte)
ff = 04
ss = don’t care
Example:
:020000030400F7 erase boot vector and status byte
Subfunction Code = 05 (Program security bits or config bit)
ff = 05
ss = 00 program security bit 1 (inhibit writing to Flash)
01 program security bit 2 (inhibit Flash verify)
02 programsecurity bit 3 (disable external memory)
03 program config bit (6x / 12x clock mode)
Example:
:020000030501F5 program security bit 2
Subfunction Code = 06 (Program Status Byte or BootVector)
ff = 06
ss = 00 program status byte
01 program boot vector
Example:
:030000030601FCF7 program boot vector with 0FCH
Subfunction Code = 07 (Full Chip Erase)
Erases all blocks, security bits, and sets status and boot vector to default values
ff = 07
ss = don’t care
dd = don’t care
Example:
:0100000307F5 full chip erase
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
68
PRELIMINARY
MX10E8050I /
MX10E8050IA
RECORDTYPE
04
COMMAND/DATAFUNCTION
Display Device Data or Blank Check – Record type 04 causes the contents of the entire
Flash array to be sent out the serial port in a formatted display. This display consists of an
address and the contents of 16 bytes starting with that address. No display of the device
contents will occur if security bit 2 has been programmed.Data to the serial port is initiated
by the reception of any character and terminated by the reception of any character.
General Format of Function 04
:05xxxx04sssseeeeffcc
Where:
05 = number of bytes (hex) in record
xxxx = required field, but value is a “don’t care”
04 = “Display Device Data or Blank Check” function code
ssss = starting address
eeee = ending address
ff = subfunction
00 = display data
01 = blank check
cc = checksum
Example:
:0500000440004FFF0069 display 4000–4FFF
Miscellaneous Read Functions
General Format of Function 05
:02xxxx05ffsscc
05
Where:
02 = number of bytes (hex) in record
xxxx = required field, but value is a “don’t care”
05 = “Miscellaneous Read” function code
ffss = subfunction and selection code
0700 = read security bits and config bit
0701 = read status byte
0702 = read boot vector
cc = checksum
Example:
:020000050701F1 read status byte
Direct Load of Baud Rate
06
General Format of Function 06
:02xxxx06hhllcc
Where:
02 = number of bytes (hex) in record
xxxx = required field, but value is a “don’t care”
06 = ”Direct Load of Baud Rate” function code
hh = high byte of Timer 2
ll = low byte of Timer 2
cc = checksum
Example:
:02000006F500F3
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
69
PRELIMINARY
MX10E8050I /
MX10E8050IA
* MX10E8050IA : I2C
The In-System Programming ( ISP ) is performed without removing the microcontroller from the system. The In-
System Programming (ISP) facility consists of a series of internal hardware resources coupled with internal firmware
to facilitate remote programming of the MX10E8050IA Serial through the serial port. This firmware is provided by
MXIC and embedded within each MX10E8050IA Serial device.
The MXIC In-System Programming ( ISP ) facility has made in-circuit programming in an embedded application
possible with a minimum of additional expense in components and circuit board area. The ISP function uses five pins:
SDA, SCL, VSS, VCC, and EA. The EA supply should be adequately decoupled and EA not allowed to exceed
datasheet limits.
WinISP, a software utility to implement ISP programming with a PC, is available from MXIC. Commercial serial ISP
programmers are available from third parties. WinISP is the master and the MX10E8050IAis the slave in ISP through
I2C. The default device address word of MX10E8050IA is 0x26 and the slave address performs on initialization. The
slave address can be changed using programmer or calling IAP.
Awrite sequence requires some command words, summarized inTable 27, following the device address word and
acknowledgment. Upon receipt of this address, the MX10E8050IA will respond with a zero and then clock in the first
8-bit data word. Following receipt of the 8-bit data word, the MX10E8050IAwill output a zero. The MX10E8050IA, such
as WinISP, then must terminate the write sequence with a stop condition. At this time the MX10E8050IA interprets
thereceivedcommandwords.TheMX10E8050IAwillnotrespondacknowledgmentuntilprogrammingorerasing
FlashROM is complete.
OncetheprogrammingorerasinghasstartedandtheMX10E8050IAinputsaredisabled,acknowledgepollingcanbe
initiated. This involves sending a start condition followed by the device address word. The read/write bit is representative
of the operation desired. Only if the programming or erasing has completed will the MX10E8050IA respond with
a zero, allowing the read or write sequence to continue.
A read sequence are initiated the same way as write sequence with the exception that the read/write select bit in the
device address word is set to one. A command read requires a "dummy" byte write sequence to load in the
command words. Once the device address word and command words are clocked in and acknowledged by
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
70
PRELIMINARY
MX10E8050I /
MX10E8050IA
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
71
PRELIMINARY
MX10E8050I /
MX10E8050IA
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
72
PRELIMINARY
MX10E8050I /
MX10E8050IA
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
73
PRELIMINARY
MX10E8050I /
MX10E8050IA
In Application Programming Method ( IAP ) ( MX10E8050I )
Several In Application Programming (IAP) calls are available for use by an application program to permit selective
erasing and programming of Flash sectors.All calls are made throguh a common interface, PGM_MTP. the
programming functions are selected by setting up the microcontroller's registers before making a call to
PGM_MTP at FFF0H. The IAP calls are shown in Table 28.
Notes : Interrupts and theWatchdogTimer must be disabled while IAPsubroutines are executing.
ROM enable security code Register/PDCON (F8H)
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
To execute IAP or to enter ISP by software setting, this ROM enable security code register must be written to 5Ah.
Only when the value of this register is 5Ah, user can set ENBOOT bit in AUXR1 register. In conclusion, to software
enable ROM user must write 5Ah to PDCONand then set ENBOOT bit inAUXR1.
Example : MOV PDCON,#0x5AH
ORL AUXR1, #0x20H
Remember to turn off ROM after executing IAP commands.
Example :ANL AUXR1, #0xDFH
ANL PDCON, #0x00H
AUXR1 (A2H)
0
DPS
ENBOOT
ENBOOT:This bit determines the BOOTROM is enabled or disabled.
This bit will automatically be set if the status bytes is not zero during reset or entering ISP pin setting
mode. Note this bit is cleared by s/w only.
Bit2 : Bit2 is not writable and alleyways read as a zero.
DPS : Switch between DPTR0 and DPRT1.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
74
PRELIMINARY
MX10E8050I /
MX10E8050IA
Table 28 : IAP Calls
IAP CALL
PARAMETER
ISP MODE CHECK
Input Parameters:
R1 = 00h
Return Parameter:
ACC = 5Ah if pass, but ACC != 5Ah if fail
Input Parameters:
R1 = 02h
DPTR = address of byte to program
ACC = byte data to program
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
Input Parameters:
PROGRAMDATABYTE
ERASE BLOCK
R1 = 01h
DPH = block code as shown below:
Block 0, 0k to 16K, 00h
Block 1, 16k to 32k, 40h
Block 2, 32k to 48k, 80h
Block 3, 48k to 64k, C0h
DPL = 00h
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
Input Parameters:
R1 = 04h
ERASE BOOT VECTOR
andSTATUS BYTE
DPH = 00h
DPL = don’t care
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
PROGRAM SECURITY BIT
and CONFIG BIT
Input Parameters:
R1 = 05h
DPH = 00h
DPL = 00h – security bit # 1 (inhibit writing to Flash)
01h – security bit # 2 (inhibit Flash verify)
02h – security bit # 3 (inhibit external memory)
03h – config bit (6/12 clock mode)
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
Input Parameters:
PROGRAM STATUS BYTE
R1 = 06h
DPH = 00h
DPL = 00h – program status byte
ACC = data of status byte
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
75
PRELIMINARY
MX10E8050I /
MX10E8050IA
PROGRAM BOOTVECTOR Input Parameters:
R1 = 06h
DPH = 00h
DPL = 01h – program boot vector
ACC = data of boot vector
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
PROGRAM I2C SLAVE
ADDRESS
Input Parameters:
R1 = 06h
DPH = 00h
DPL = 02h – program i2c slave address
ACC = data of boot vector
Return Parameter:
ACC = 00 if pass, but ACC != 00 if fail
Input Parameters:
READDEVICEDATA
R1 = 03h
DPTR = address of byte to read
Return Parameter:
ACC = value of byte read
READ SECURITY BITS and
CONFIG BIT
Input Parameters:
R1 = 07h
DPH= 00h
DPL = 00h (security bits)
Return Parameter:
ACC = value of byte read
Input Parameters:
R1 = 07h
READSTATUS BYTE
READBOOTVECTOR
DPH= 00h
DPL = 01h (status byte)
Return Parameter:
ACC = value of byte read
Input Parameters:
R1 = 07h
DPH= 00h
DPL = 02h (boot vector)
Return Parameter:
ACC = value of byte read
READ I2C SLAVE
ADDRESS
Input Parameters:
R1 = 07h
DPH= 00h
DPL = 03h (i2c slave address)
Return Parameter:
ACC = value of byte read
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
76
PRELIMINARY
MX10E8050I /
MX10E8050IA
Security
The security feature protects against software piracy and prevents the contents of the Flash from being read. The
Security Lock bits are located in Flash. The MX10E8050I Serial has 3 programmable security lock bits that will
provide different levels of protection for the on-chip code and data ( see Table 29 ).
Table 29
SECURITY LOCK BITS1
Level
1
LB1
1
LB2
0
LB3
0
PROTECTIONDESCRIPTION
Program and block erase is disabled. Erase or programming of
the status byte or boot vector is disabled.
2
3
1
1
1
1
0
1
MOVC instructions executed from external program memory are
disabled from fetching code bytes from internal memory.
External execution is disabled.
NOTE :
1. Security bits are independent of each other. Full-chip erase may be performed regardless of the state of the
security bits.
2. Any other combination of lock bits is undefined.
CONFIG :
12-clock or 6-clock mode configuration bit is saved in flash special cell CONFIG. The address of CONFIG bit is the
same as security bits, so do their program or erase algorithm. CONFIG bit can be normally programmed but can be
erasedbychiperasedonly.DefaultlyCONFIGbitisclearforMX10E8050Iserial,thatmeans12clockmode.IfCONFIG
bitisprogrammedtoHIGH,6-clockmodeisenabledwhenRESETgoeslow.NotethatwhenprogrammingCONFIGto
6-clock mode by ISP, the chip would not immediately change to 6-clock mode until another RESET going low. MX10E8050I
serial is defaultly 6-clock mode.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
77
PRELIMINARY
MX10E8050I /
MX10E8050IA
LOCK function table
The security bits LOCK 1~3 could prevent form illegal writing or reading at ISP mode or external programming mode.
The detail security function table is shown as below:
Parallel Programming
LOCK1
LOCK2
X
LOCK 3
Read Array
Read Special Cell
Read ID
Program Array
Program Special Cell
X
LOCK
I2C Address
SBYTE
BVEC
X
X
X
X
Erase Array
Erase Special Cell
LOCK
X
X
I2C Address
SBYTE
BVEC
X
X
Chip Erase
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
78
PRELIMINARY
MX10E8050I /
MX10E8050IA
ABSOLUTE MAXIMUM RATINGS
PARAMETER
RATING
0 to +70
- 65 to +150
VDD+0.5
15
UNIT
OC
Operation temperature
Storage temperature range
OC
Voltage on Xtal1, Xtal2 pin to VSS
V
Maximum IOL per I/O pin
mA
W
Powerdissipation(basedonpackageheattransfer, notdevicepowerconsumption)
1.5
Notes:
1. Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the device.
This is a stress rating only and functional operation of the device at these or any conditions other than those
described in the AC and DC Electrical Characteristics section of this specification are not implied.
2. This product includes circuitry specifically designed for the protection of its internal devices from the damaging
effects of excessive static charge. Nonetheless, it is suggested that conventional precautions be taken to avoid
applying greater than the rated maximum.
3. Parameters are valid over operating temperature range unless otherwise specified.All voltages are with respect
to VSS unless otherwise noted.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
79
PRELIMINARY
MX10E8050I /
MX10E8050IA
DC ELECTRICAL CHARACTERISTICS
VDD = 3.0 V to 3.6 V unless otherwise specified;
Tamb = 0OC to +70OC for commercial for industrial unless otherwise specified.
SYMBOL PARAMETER
TEST CONDITIONS
LIMITS
UNIT
MIN
TYP1 MAX
IDD
IID
Power supply current, operating
3.6 V, 40 MHz11
3.6 V, 40 MHz11
3.0 V 11
-
-
-
15
10
10
30
20
mA
mA
uA
Power supply current, Idle mode
Power supply current,
IPD1
Total Power-down mode
Vdd rise time
VDDR
VDDF
VRAM
VIL
-
-
-
-
-
2
mV/us
mV/us
V
Vdd fall time
-
50
-
RAM keep-alive voltage
Input low voltage (TTL input)
Input high voltage (TTL input)
Output low voltage all ports 5, 9
1.5
-0.5
2.4 V < VDD < 3.6 V
0.22VDD-0.1 V
VIH
0.7VDD+0.1 -
5.5
1.0
0.3
-
V
VOL
IOL = 20mA; VDD = 2.4 V
IOL = 3.2mA; VDD = 2.4 V
IOH =- 20uA; VDD = 2.4 V
-
-
-
-
V
V
VOH
CIO
IIH
Output high voltage, all ports 3
Input/Output pin capacitance 10
Logical 1 input current, all ports 8
Input leakage current, all ports 7
Logical 1-to-0 transition current,
all ports 3, 6
VDD-0.2 -
V
-
-
-
-
-
15
pF
uA
uA
uA
VIN = 3.3 V
-
-50
30
ILI
VIN = VIL or VIH
-
ITL
VIN = 1.5 V at VDD = 3.6 V
-30
-250
RRST
Internal reset pull-up resistor
40
-
225
k ohm
Notes:
1. Typical ratings are not guaranteed. The values listed are at room temperature, 3.3 V.
2.
Active mode: ICC(MAX) = 30mA
Idle mode: ICC(MAX) = 20mA
3. Ports in quasi-bidirectional mode with weak pull-up (applies to all port pins with pull-ups).Does not apply to open
drain pins.
4. Ports in PUSH-PULLmode.Does not apply to open drain pins.
5. In all output modes except high impedance mode.
6. Port pins source a transition current when used in quasi-bidirectional mode and externally driven from 1 to 0. This
current is highest when VIN is approximately 2 V.
7. Measuredwithportinhighimpedancemode.
8. Measuredwithportinquasi-bidirectionalmode.
9. Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum IOL per port pin: 15 mA
Maximum total IOL for all outputs: 26 mA
Maximum total IOH for all outputs: 71 mA
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink
current greater than the listed test conditions.
10.Pin capacitance is characterized but not tested.
11.The IDD and IID specifications are measured using an external clock. This is 12 clock mode.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
80
PRELIMINARY
MX10E8050I /
MX10E8050IA
ICC_VS freq
( mA )
Icc
27
MAX ACTIVE
24
21
18
15
12
9
TYP ACTIVE
MAX IDLE
TYP IDLE
6
3
40MHz
4MHz
12MHz
20MHz
28MHz
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
81
PRELIMINARY
MX10E8050I /
MX10E8050IA
Low Voltage Detector ( MX10E8050I / IA )
This low voltage detector will reset the chip when detecting a VDD lower than a designed level. The reset status
remains till VDD rise to normal operating voltage. Since the reset shall keeps at lease two machine cycle, the VDD low
to VDD high shall not transit sooner than two machine cycle.
Detecting level
VDD falling
Min
Max
2.40 V
2.43 V
2.60 V
2.65 V
VDD rising
VDD
VDD
Vrh
Vrl
Vfh
Vfl
reset
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
82
PRELIMINARY
MX10E8050I /
MX10E8050IA
AC CHARACTERISTICS
(Over Operating Conditions, Load Capacitance for Port 0,ALE/PROGand PSEN= 100 pF, Load Capacitance forAll
Other Outputs = 80 pF)
tCK min. = 1/f max. (maximum operating frequency); tCK=clock period
SYMBOL PARAMETER
40 MHz, x12 mode
UNIT
MIN
MAX
EXTERNALPROGRAM MEMORY
TLHLL
TAVLL
TLLAX
TLLIV
TLLPL
TPLPH
TPLIV
TPXIX
TPXIZ
TAVIV
TPLAZ
ALE PULSEDURATION
20
17
10
-
-
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
ADDRESS SET-UP TIME TOALE
-
ADDRESS HOLD TIME AFTER ALE
-
TIME FROMALE TO VALIDINSTRUCTIONINPUT
TIME FROM ALE TO CONTROL PULSE PSEN
CONTROLPULSEDURATIONPSEN
55
-
17
70
-
-
TIME FROM PSENTO VALIDINSTRUCTIONINPUT
INPUT INSTRUCTIONHOLDTIMEAFTER PSEN
INPUT INSTRUCTIONFLOATDELAYAFTER PSEN
ADDRESS TO VALIDINSTRUCTIONINPUT
PSEN LOW TO ADDRESS FLOAT TIME
12
-
0
-
20
95
10
-
-
EXTERNALDATAMEMORY
TLHLL
ALE PULSEDURATION
20
17
10
80
80
-
-
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
NS
TAVLL
ADDRESS SET-UP TIME TOALE
ADDRESS HOLD TIME AFTER ALE
RD PULSEDURATION
-
TLLAX
TRLRH
TWLWH
TRLDV
TRHDX
TRHDZ
TLLDV
TAVDV
TLLWL
TAVWL
TWHLH
TQVWX
TQVWH
TWHQX
TRLAZ
-
-
WR PULSEDURATION
-
RDTO VALIDDATAINPUT
60
-
DATA HOLDTIMEAFTER RD
0
DATA FLOATDELAYAFTER RD
TIME FROMALE TO VALIDDATA INPUT
ADDRESS TO VALIDINPUT
32
-
-
90
105
140
-
-
TIME FROM ALE TO RD OR WR
TIME FROM ADDRESS TO RD OR WR
TIME FROM RD OR WR HIGH TO ALE HIGH
DATAVALIDTO WR TRANSITION
DATASET-UP TIME BEFORE WR
DATAHOLDTIMEAFTER WR
40
45
10
10
125
10
-
55
-
-
-
ADDRESS FLOAT DELAYAFTER RD
0
NOTE:
1. The maximun operating frequency is limited to 40 MHz and the minimum to 3.5 MHz.
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
83
PRELIMINARY
MX10E8050I /
MX10E8050IA
PLCC44
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
84
PRELIMINARY
MX10E8050I /
MX10E8050IA
LQFP44
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
85
PRELIMINARY
MX10E8050I /
MX10E8050IA
PDIP40
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
86
PRELIMINARY
MX10E8050I /
MX10E8050IA
REVISION HISTORY
REVISION
1.1
DESCRIPTION
- Addition I2C pin release
Page
DATE
JAN / 29 / 2003
- Pin Description release
- Addition internal Data memory Sample code release
- Explain Special function registers
- Boot ROM release
- ISP release
1.2
1.3
- Addition Programming spec.
- Addition I2C / UART description
- Update I2C, UART function
- Update page 10 symbol IE / IP / IPH volume
- Addition MX10E8050I ( ISP + I2C ) function
- Addition Oscillator Characteristics / Reset / Idle Mode
PowerDown Mode /Design Considerations
- Update Reset Timing
JUN / 24 / 2003
AUG / 20 / 2003
SEP / 26 / 2003
MAR / 11 / 2004
1.4
-Addition (1:Turn off , 0:Turn on)
- Addition (Fig 29) PSEN & ALE
- ISP UART part enhance
12
64
65
67
77
81
62
64
65
77
- Intel Hex --> Command (Table 26)
- Table 29 (Level 1) LB1&LB2 0 --> 1
- Addition (mA)
- Modify Flash EPROM Memory
- Modify Fig 29
MAR / 22 / 2004
JUL / 29 / 2004
- Modify Vpp --> EA
- Modify Table 29 Level 3
1.5
1.6
- Closed MX10E8050IX-IA
- Add MX10E8050IA Function
- Modify Table 15 , Table 16
DEC / 03 / 2004
DEC / 21 / 2004
MAR / 10 / 2005
- Modify Symbol TPLAZ
83
31
1.6
- Modify PWM address
P/N:PM0887
REV. 1.6, MAR. 28, 2005
Specifications subject to change without notice, contact your sales representatives for the most update information.
87
PRELIMINARY
MX10E8050I /
MX10E8050IA
MACRONIX INTERNATIONALCO., LTD.
Headquarters:
TEL:+886-3-578-6688
FAX:+886-3-563-2888
Europe Office :
TEL:+32-2-456-8020
FAX:+32-2-456-8021
Hong Kong Office :
TEL:+86-755-834-335-79
FAX:+86-755-834-380-78
Japan Office :
Kawasaki Office :
TEL:+81-44-246-9100
FAX:+81-44-246-9105
Osaka Office :
TEL:+81-6-4807-5460
FAX:+81-6-4807-5461
Singapore Office :
TEL:+65-6346-5505
FAX:+65-6348-8096
Taipei Office :
TEL:+886-2-2509-3300
FAX:+886-2-2509-2200
MACRONIX AMERICA, INC.
TEL:+1-408-262-8887
FAX:+1-408-262-8810
http : //www.macronix.com
MACRONIX INTERNATIONAL CO., LTD. reserves the right to change product and specifications without notice.
相关型号:
SI9130DB
5- and 3.3-V Step-Down Synchronous ConvertersWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9135LG-T1
SMBus Multi-Output Power-Supply ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9135LG-T1-E3
SMBus Multi-Output Power-Supply ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9135_11
SMBus Multi-Output Power-Supply ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9136_11
Multi-Output Power-Supply ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9130CG-T1-E3
Pin-Programmable Dual Controller - Portable PCsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9130LG-T1-E3
Pin-Programmable Dual Controller - Portable PCsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9130_11
Pin-Programmable Dual Controller - Portable PCsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9137
Multi-Output, Sequence Selectable Power-Supply Controller for Mobile ApplicationsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9137DB
Multi-Output, Sequence Selectable Power-Supply Controller for Mobile ApplicationsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9137LG
Multi-Output, Sequence Selectable Power-Supply Controller for Mobile ApplicationsWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
SI9122E
500-kHz Half-Bridge DC/DC Controller with Integrated Secondary Synchronous Rectification DriversWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY
©2020 ICPDF网 联系我们和版权申明