www.STCMCU.com
Mobile:(86)13922805190
Tel:86-755-82948412
Fax:86-755-82944243
STC15F204EA series MCU
STC15L204EA series
e
MCU
td
i
im
L
Data Sheet
TC
S
STC MCU Limited
www.STCMCU.com
CU
M
Update date: 2010/10/24
STC MCU Limited
website:www.STCMCU.com
1
CONTENTS
Chapter 1 Introduction .................................................................... 5
1.1 Features ..................................................................................................5
1.2 Block diagram ........................................................................................6
1.3 PINS Definition ......................................................................................7
1.3.1 STC15F204EA series Pin Definition .....................................................................7
1.3.2 STC15F101E series Pin Definition .......................................................................8
1.3.3 STC15S204EA series Pin Definition .....................................................................9
1.4
1.5
1.6
1.7
1.8
Chapter 2 Clock, Power Management, Reset ............................... 22
1.8.1 STC15F204EA series MCU naming rules...........................................................20
1.8.2 STC15F101E series MCU naming rules .............................................................21
STC15F204EA series Minimum Application System ..........................10
STC15F204EA series Typical Application Circuit (for ISP)................11
PINS Descriptions of STC15F204EA series ........................................12
Package Drawings ................................................................................14
STC15Fxx series MCU naming rules ..................................................20
2.1 Clock ....................................................................................................22
2.2 Power Management ...............................................................................23
2.2.1 Idle Mode ..............................................................................................................23
2.2.2 Slow Down Mode .................................................................................................24
2.2.3 Power Down (PD) Mode (Stop Mode) .................................................................26
2.3.1
2.3.2
2.3.3
2.3.4
2.3.5
2.3.6
Reset pin .............................................................................................................32
Software RESET .................................................................................................32
Power-On Reset (POR) .......................................................................................32
MAX810 power-on-reset delay ...........................................................................33
Low Voltage Detection ........................................................................................33
Watch-Dog-Timer ................................................................................................37
2.3 Reset ......................................................................................................32
Chapter 3 Memory Organization .................................................. 42
3.1 Program Memory ..................................................................................42
3.2 SRAM ....................................................................................................43
Chapter 4 Configurable I/O Ports ................................................. 45
4.1 I/O Port Configurations .........................................................................45
4.1.1 Quasi-bidirectional I/O .........................................................................................45
4.1.2 Push-pull Output ...................................................................................................46
4.1.3 Input-only Mode ...................................................................................................46
4.1.4 Open-drain Output ................................................................................................46
4.2 I/O Port Registers ................................................................................47
4.3 I/O port application notes .....................................................................49
4.4 I/O port application ..............................................................................49
4.4.1
4.4.2
4.4.3
4.4.4
4.4.5
4.4.6
4.4.7
Typical transistor control circuit ..........................................................................49
Typical diode control circuit ................................................................................49
3V/5V hybrid system ...........................................................................................50
How to make I/O port low after MCU reset ........................................................50
I/O drive LED application circuit ........................................................................51
I/O immediately drive LCD application circuit ...................................................52
Using A/D Conversion to scan key application circuit........................................53
Chapter 5 Instruction System ........................................................ 54
5.1
5.2
5.3
5.4
5.5
6.1
6.2
6.3
6.4
6.5
7.1
7.2
7.3
7.4
Chapter 6 Interrupts ................................................................... 102
Special Function Registers ...................................................................54
Notes on Compatibility to Standard 80C51 MCU ...............................58
Addressing Modes ................................................................................59
Instruction Set Summary ......................................................................60
Instruction Definitions for Standard 8051 MCU ..................................65
Interrupt Structure ..............................................................................103
Interrupt Register ................................................................................105
Interrupt Priorities ..............................................................................108
How Interrupts Are Handled ..............................................................109
External Interrupts ............................................................................. 111
Chapter 7 Timer/Counter 0 and 1................................................ 121
Timer/Counter 0 Mode of Operation ..................................................124
Timer/Counter 1 Mode of Operation ..................................................131
Generic Programmable Clock Output ...............................................136
Changes of STC15F204E Timers compared with standard 8051 .....143
Chapter 8 Simulate Serial Port Program .................................... 145
Chapter 9 Analog to Digital Converter ...................................... 163
9.1
9.2
9.3
9.4
8.1 Programs using Timer 0 to realize Simulate Serial Port ....................145
8.2 Programs using Timer 1 to realize Simulate Serial Port ....................154
A/D Converter Structure .....................................................................163
Register for ADC ................................................................................165
Program using interrupts to demostrate ADC ....................................167
Program using polling to demostrate ADC .......................................177
IAP / ISP Control Register ...............................................................188
IAP/EEPROM Assembly Language Program Introduction .............191
EEPROM Demo Programs written in Assembly Language .............193
EEPROM Demo Program written in C Language ...........................204
Chapter 10 IAP / EEPROM ........................................................ 188
10.1
10.2
10.3
10.4
11.1
11.2
11.3
11.4
11.5
Chapter 11 STC15Fxx series programming tools usage ............. 215
Appendix A: Assembly Language Programming ........................ 222
Appendix B: 8051 C Programming ............................................. 244
Appendix C: STC15F204EA series Electrical Characteristics .... 254
Appendix D: STC15Fxx series to replace standard 8051 Notes.. 255
Appendix E: STC15F204EA series Selection Table .................... 257
In-System-Programming (ISP) principle ..........................................215
STC15F204EA series application circuit for ISP .............................216
PC side application usage .................................................................217
Compiler / Assembler Programmer and Emulator ...........................219
Self-Defined ISP download Demo ..................................................219
www.STCMCU.com
Mobile:(86)13922805190
Tel:86-755-82948412
Fax:86-755-82944243
Chapter 1 Introduction
CPU, which is produced by STC MCU Limited. With the enhanced kernel, STC15F204EA series execute
instructions in 1~6 clock cycles (about 6~7 times the rate of a standard 8051 device), and has a fully compatible
instruction set with industrial-standard 80C51 series microcontroller. In-System-Programming (ISP) and In-
Application- Programming (IAP) support the users to upgrade the program and data in system. ISP allows the
user to download new code without removing the microcontroller from the actual end product; IAP means that the
device can write non-valatile data in Flash memory while the application program is running. the STC15F204EA
series has 9 interrupt sources, 10-bit ADC, on-chip high-precision RC oscillator and a one-time enabled Watch-
Dog Timer.
S
TC15F204EA series is a single-chip microcontroller based on a high performance 1T architecture 80C51
1.1 Features
• Enhanced 80C51 Central Processing Unit, faster 6~7 times than the rate of a standard 8051
• Operating voltage range: 3.8 ~ 5.5V or 2.4V ~ 3.6V (STC15L204EA series)
• Operating frequency range: 5MHz ~ 35MHz, is equivalent to standard 8051: 60MHz ~ 420MHz
• A high-precision internal RC oscillator with temperature drifting ±1% (-40
0
C~+85
0
C)
• internal RC oscillator with adjustable frequency to 5.5296MHz/11.0592MHz/22.1184MHz/33.1776MHz
• On-chip 256 bytes RAM and 1K~6K bytes code flash with flexible ISP/IAP capability
• EEPROM function
• Code protection for flash memory access
• Two 16-bit timers/counters — Timer 0 / Timer 1 with mode 0 (16-bit auto-reload mode), mode 1 (16-bit
timer mode) and mode 2 (8-bit auto-reload mode)
• simulate UART can be realized by P3.0,P3.1 and Timers
• 8-channel, 10-bit ADC associated interrupt, speed up to 300 thousands times every second
• 9 interrupt sources
• One 15 bits Watch-Dog-Timer with 8-bit pre-scalar (one-time-enabled)
• Three power management modes: idle mode, slow down mode and power-down mode
Power down mode can be woken-up by external INTx pin (INT0/P3.2, INT1/P3.3, INT2, INT3, INT4 )
• Excellent noise immunity, very low power consumption
• Support 2-wire serial flash programming interface.(GND/P3.0/P3.1/VCC)
• Programmable clock output Function. T0 output the clock on P3.5, T1 output clock on P3.4.
• 26 configurable I/O ports are available and default to quasi-bidirectional after reset. All ports may be
independently configured to one of four modes : quasi-bidirectional, push-pull output, input-only or open-
drain output. The drive capability of each port is up to 20 mA. But recommend the whole chip's should be
less than 90 mA.
• Package type: SOP-28,SKDIP-28
TC
S
CU
M
L
ted
i
im
STC MCU Limited
website:www.STCMCU.com
5
评论