Detailed introduction to the internal structure and functions of STC12C5A60S2 microcontroller

Publisher:PeacefulSoulLatest update time:2023-09-12 Source: elecfansKeywords:STC12C5A60S2 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The STC12C5A60S2 microcontroller is a relatively powerful microcontroller. Among the many 51 series microcontrollers, the 1T enhanced series of the domestic STC company is more competitive because it is not only fully compatible with 8051 instructions and pins, but also has on-chip It has a large-capacity program memory and is made of FLASH technology. For example, the STC12C5A60S2 microcontroller has up to 60K FLASH ROM inside. Users of this kind of technology memory can instantly erase and rewrite using electricity. Moreover, STC series microcontrollers support serial port program programming.


1. Introduction to STC12C5A60S2

The STC12C5A60S2/AD/PWM series microcontroller is a single clock/machine cycle (1T) microcontroller produced by Hongjing Technology. It is a new generation of 8051 microcontroller with high speed/low power consumption/super anti-interference. The instruction code is fully compatible with the traditional 8051, but the speed 8-12 times faster. Internally integrated MAX810 dedicated reset circuit, 2 channels of PWM, 8 channels of high-speed 10-bit A/D conversion (250K/S), designed for motor control and strong interference situations.

1. Enhanced 8051 CPU, 1T, single clock/machine cycle, instruction code fully compatible with traditional 8051;

2. Working voltage: STC12C5A60S2 series working voltage: 5.5V-3.3V (5V microcontroller) STC12LE5A60S2 series working voltage: 3.6V-2.2V (3V microcontroller);

3. Working frequency range: 0-35MHz, equivalent to 0~420MHz of ordinary 8051;

4. User application space 8K/16K/20K/32K/40K/48K/52K/60K/62K bytes;

5. On-chip integrated 1280 bytes of RAM;

6. General-purpose I/O ports (36/40/44), after reset: quasi-bidirectional port/weak pull-up (ordinary 8051 traditional I/O port), can be set to four modes: quasi-bidirectional port/weak pull-up Pull, push-pull/strong pull-up, input only/high impedance, open drain, each I/O port driving capability can reach 20mA, but the maximum of the entire chip should not exceed 120ma;

7. ISP (In-System Programmable)/IAP (In-Application Programmable), no special programmer or special emulator is required. The user program can be downloaded directly through the serial port (P3.0/P3.1), and a piece can be completed in a few seconds;

8. Has EEPROM function (STC12C5A62S2/AD/PWM does not have internal EEPROM);

9. Internally integrated MAX810 dedicated reset circuit (when the external crystal is less than 12M, the reset pin can be directly connected to the ground with a 1K resistor);

10. External power-down detection circuit: There is a low-voltage threshold comparator at port P4.6. The 5V microcontroller is 1.32V with an error of +/-5%. The 3.3V microcontroller is 1.30V with an error of +/-3%;

11. Clock source: external high-precision crystal/clock, internal R/C oscillator (temperature drift is within +/-5% to +/-10%) 1 When downloading the user program, the user can choose to use the internal R/C oscillator C oscillator or external crystal/clock. The internal R/C oscillator frequency at normal temperature is: 11MHz~15.5MHz for 5.0V microcontroller, 8MHz~12MHz for 3.3V microcontroller. When the accuracy requirements are not high, you can choose to use the internal clock , but due to manufacturing errors and temperature drift, the actual test shall prevail;

12. A total of 4 16-bit timers and two timers/counters compatible with traditional 8051, 16-bit timers T0 and T1. There is no timer 2, but there is an independent baud rate generator for serial communication baud rate The generator plus 2 PCA modules can realize two 16-bit timers;

13.2 clock output ports, the clock can be output on P3.4/T0 due to the overflow of T0, and the clock can be output on P3.5/T1 due to the overflow of T1;

14. 7 external interrupt I/O ports, traditional falling edge interrupt or low level triggered interrupt, and a new PCA module that supports rising edge interrupt. PowerDown mode can be awakened by external interrupt, INT0/P3.2, INT1/P3 .3, T0/P3.4, T1/P3.5, RxD/P3.0, CCP0/P1.3 (can also be set to P4.2 via register), CCP1/P1.4 (can also be set to P4.2 via register) P4.3);

15.PWM (2 channels)/PCA (programmable counter array, 2 channels):

——Can also be used as a 2-way D/A

——Can also be used to implement 2 more timers

——It can also be used to implement 2 external interrupts (both rising edge interrupts and falling edge interrupts can be supported separately or at the same time);

16. A/D conversion, 10-bit precision ADC, 8 channels in total, conversion speed up to 250K/S (250,000 times per second), universal full-duplex asynchronous serial port (UART), because the STC12 series is high-speed 8051, timer or PCA software can be used to implement multiple serial ports;

17. The STC12C5A60S2 series has dual serial ports. Only those with the S2 logo suffix have dual serial ports, RxD2/P1.2 (can be set to P4.2 through the register), TxD2/P1.3 (can be set to P4.3 through the register);

18. Working temperature range: -40-+85℃ (industrial grade)/0-75℃ (commercial grade) 21. Package: PDIP-40, LQFP-44, LQFP-48 When the I/O port is not enough, 2 to 3 can be used An ordinary I/O port line can be externally connected to 74HC164/165/595 (all can be cascaded) to expand the I/O port. A/D can also be used for key scanning to save I/O ports, or dual CPUs and three-wire communication can be used. More serial ports.

STC12C5A60S2 pin function description

VCC: supply voltage;

GND: ground;

Port P0: Port P0 is an 8-bit open-drain bidirectional I/O port. Each pin can absorb 8TTL gate current. When "1" is written to the pin of port P0, it is defined as a high-impedance input. P0 can be used in external program data memory and can be defined as the eighth bit of data/address. During FLASH programming, the P0 port serves as the original code input port. When FLASH performs verification, P0 outputs the original code. At this time, the external potential of P0 must be pulled high;

P1 port: P1 port is an 8-bit bidirectional I/O port with an internal pull-up resistor. The P1 port buffer can receive and output 4TTL gate current. After writing "1" to the P1 port pin, the potential is internally pulled high and can be used as an input. When P1 port is externally pulled down to low level, current will be output. This is due to the internal pull-up. During FLASH programming and verification, the P1 port is used as the eighth address to receive;

P2 port: P2 port is an 8-bit bidirectional I/O port with an internal pull-up resistor. The P2 port buffer can receive and output 4 TTL gate currents. When "1" is written to the P2 port, its pin potential is internally The pull-up resistor is pulled high and serves as an input. When used as an input, the potential of the P2 port pin is externally pulled low and the current is output. This is due to the internal pull-up. When Port P2 is used to access external program memory or 16-bit address external data memory, Port P2 outputs the high eight bits of the address. When the address "1" is given, it takes advantage of the internal pull-up. When reading and writing the external eight-bit address data memory, the P2 port outputs the contents of its special function register. Port P2 receives the high eight-bit address signal and control signal during FLASH programming and verification;

P3 port: The P3 port pins are 8 bidirectional I/O ports with internal pull-up resistors, which can receive and output 4 TTL gate currents. When "1" is written to P3 port, they are internally pulled up to high level and used as input. When used as an input, since the external pull-down is low, port P3 will output current (ILL), also due to the pull-up. Port P3 can also be used as some special function ports of AT89C51:

P3.0RXD (serial input port)

P3.1TXD (serial output port)

P3.2INT0 (external interrupt 0)

P3.3INT1 (external interrupt 1)

P3.4T0 (timer 0 external input)

P3.5T1 (timer 1 external input)

P3.6WR (external data memory write strobe)

P3.7RD (external data memory read strobe)

At the same time, the P3 port receives some control signals for flash programming and programming verification;

RST: reset input. When the oscillator resets the device, the RST pin must be kept high for two machine cycles;

ALE/PROG: When accessing external memory, the address latch allows the output level to be used to latch the low-order byte of the address. During FLASH programming, this pin is used to input programming pulses. In normal times, the ALE terminal outputs a positive pulse signal with a constant frequency period, and this frequency is 1/6 of the oscillator frequency. Therefore it can be used as a pulse to an external output or for timing purposes. However, be aware that an ALE pulse will be skipped whenever used as external data memory. If you want to disable the output of ALE, set 0 on the SFR8EH address. At this time, ALE only works when executing MOVX and MOVC instructions. Additionally, this pin is pulled slightly high. If the microprocessor is in the external execution state ALE is disabled, setting this bit has no effect;

PSEN: Strobe signal for external program memory. PSEN is asserted twice per machine cycle during fetches from external program memory. But when accessing the internal data memory, these two valid PSEN signals will not appear;

EA/VPP: When EA remains low, access the external ROM; note that when encryption mode 1 is used, EA will internally lock RESET; when the EA terminal remains high, access the internal ROM. During FLASH programming, this pin is also used to apply the 12V programming power (VPP);

XTAL1: Input of the reverse oscillation amplifier and input of the internal clock working circuit;

XTAL2: Output from the inverting oscillator;

3. Internal structure of STC12C5A60S2 series microcontroller

The internal structure block diagram of the STC12C5A60S2 series microcontroller is shown in the figure below. The STC12C5A60S2 microcontroller contains a central processing unit (CPU), program memory (Flash), data memory (SRAM), timer/counter, UART serial port, serial port 2, I/O interface, high-speed A/D conversion, SPI interface, PCA, see Modules such as watchdog, on-chip R/C oscillator and external crystal oscillator circuit. The STC12C5A60S2 series microcontroller contains almost all unit modules required for data acquisition and control, and can be called a system on a chip.

[1] [2]
Keywords:STC12C5A60S2 Reference address:Detailed introduction to the internal structure and functions of STC12C5A60S2 microcontroller

Previous article:Research on automobile anti-fatigue driving system based on STC12C5A60S2
Next article:External structure of microcontroller and basic explanation of C language programming

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号