CH554 Manual English
CH554 Manual English
CH554, CH553
Manual
Version: 1E
http://wch.cn
Translated to the English by Blinkinlabs
1. Overview
The CH554 chip is an enhanced E8051 core microcontroller compatible with the MCS51 instruction
set. Its 79% instruction is a single-byte single-cycle instruction, and the average instruction speed is 8
to 15 times faster than the standard MCS51.
CH554 supports up to 24MHz system main frequency, built-in 16K program memory ROM and 256
bytes internal iRAM and 1K bytes of on-chip xRAM, xRAM supports DMA direct memory access.
CH554 has built-in ADC analog-to-digital conversion, touch button capacitance detection, 3 groups of
timers and signal capture and PWM, dual asynchronous serial port, SPI and other functional modules,
support USB-Host host mode and USB-Device device mode.
CH553 is a simplified version of CH554, program memory ROM is 10K, on-chip xRAM is 512 bytes,
asynchronous serial port is only UART0, package form is only SOP16, touch button is only 4 channels,
other is the same as CH554, can refer to CH554 manual and data directly.
Model ROM RAM Data USB USB Timer PWM UART SPI ADC Touch
Flash Host device inputs
CH554 16KB 1280 128 Full/low Full/low 3 2 2 master 4 6
CH553 10KB 768 speed speed 1 /slave 4
2. Features
• Core: Enhanced E8051 core compatible with MCS51 instruction set, 79% of its instructions are
single-byte single-cycle instructions, the average instruction speed 8-15 times faster than the
standard MCS51, unique XRAM data fast copy instructions, dual DPTR pointer.
• ROM: 16KB of multiprogrammable non-volatile memory ROM, can be used for program
storage space; or can be divided into 14KB program memory and 2KB boot code BootLoader /
ISP program area.
• DataFlash: 128 bytes of non-volatile data memory that can be erased many times, and support
overwriting data in bytes.
• RAM: 256 bytes internal iRAM for fast data staging and stacking; 1KB on-chip xRAM for
large amounts of data staging and DMA direct memory access.
• USB: embedded USB controller and USB transceiver, support USB-Host host mode and USB-
Device device mode, support USB type-C master-slave detection, support USB 2.0 full speed
12Mbps or low speed 1.5Mbps. Support up to 64 bytes of data packets, built-in FIFO, support
for DMA.
• Timer: 3 timers, T0 / T1 / T2 are standard MCS51 timers.
• Capture: Timer T2 extended to support 2-way signal capture.
• PWM: 2 sets of PWM output, PWM1 / PWM2 2 8-bit PWM output.
• UART: 2 asynchronous serial ports, both support higher communication baud rate, UART0 is a
standard MCS51 serial port.
• SPI: SPI controller built-in FIFO, the clock frequency up to half the system clock frequency
Fsys, serial data input and output to support simplex multiplexing, support Master / Slave
master-slave mode.
• ADC: 4-channel 8-bit A / D analog-to-digital converter that supports voltage comparison.
• Touch-Key: 6-channel capacitance detection, supports up to 15 touch buttons, support for
independent timer interrupt.
• GPIO: Supports up to 17 GPIO pins (including XI / XO and RST and USB signal pins).
• Interrupt: Support 14 groups of interrupt sources, including 6 groups of interrupts compatible
with standard MCS51 (INT0, T0, INT1, T1, UART0, T2), and an extended group of 8 interrupts
(SPI0, TKEY, USB, ADC, UART1, PWMX, GPIO, WDOG). GPIO interrupts can be selected
from seven pins.
• Watch-Dog: 8-bit watchdog timer WDOG can be preset to support the timer interrupt.
• Reset: Supports 4 kinds of reset signal source, built-in power-on reset, software reset and
watchdog overflow reset, optional pin external input reset.
• Clock: Built-in 24MHz clock source, can support external crystal through multiplexing GPIO
pin.
• Power: Built-in 5V to 3.3V low dropout voltage regulator, supporting 5V or 3.3V or even 2.8V
supply voltage. Support low-power sleep, support USB, UART0, UART1, SPI0 and some GPIO
external wake-up.
• Chip built-in unique ID number.
3. Package
4. Pins
Package Pin Other function Other function description
TSSOP SOP MSOP name names
20 16 10 (Left function is
preferred)
19 15 9 VCC VDD Power input, need external 0.1uF power
decoupling capacitor.
20 16 10 V33 Internal USB Power Regulator Output and
Internal USB Power Input,
When the power supply voltage is less than
3.6V connect VCC input external power
supply,
When the supply voltage is greater than 3.6V
external 0.1uF power decoupling capacitor
18 14 8 GND VSS Common ground.
6 6 5 RST RST/T2EX_/CAP2_ Underlined suffix pin is the same name
7 - - P1.0 T2/CAP1/TIN0 without underscores pin mapping.
RST pin built-in pull-down resistor; other
8 9 - P1.1 T2EX/CAP2/TIN1 GPIO default pull-up resistor.
/VBUS2/AIN0 RST: External reset input.
17 - - P1.2 XI/RXD_ T2: Timer / Counter 2 external count input /
clock output.
16 - - P1.3 XO/TXD_ T2EX: Timer / Counter 2 Overload / Capture
2 2 1 P1.4 T2_/CAP1_/SCS Input.
/TIN2/UCC1/AIN1 CAP1, CAP2: Timer / Counter 2 capture
3 3 2 P1.5 MOSI/PWM1/TIN3 / inputs 1,2.
UCC2/AIN2 TIN0 ~ TIN5: 0 # ~ 5 # channel touch button
capacitance detection input.
4 4 3 P1.6 MISO/RXD1/TIN4 AIN0 ~ AIN3: 0 # ~ 3 # channel ADC analog
5 5 4 P1.7 SCK/TXD1/TIN5 signal input.
UCC1, UCC2: USB type-C bidirectional
10 8 - P3.0 PWM1_/RXD configuration channel.
9 7 - P3.1 PWM2_/TXD VBUS1, VBUS2: USB type-C bus voltage
1 1 - P3.2 TXD1_/INT0 detection input.
/VBUS1/AIN3 XI, XO: external crystal oscillator input,
inverting output.
11 10 - P3.3 INT1 RXD, TXD: UART0 serial data input, serial
12 11 - P3.4 PWM2/RXD1_/T0 data output.
SCS, MOSI, MISO, SCK: SPI0 interface,
13 - - P3.5 T1 SCS is the chip select input, MOSI is the host
14 12 6 P3.6 UDP output / slave input, MISO is the host input /
slave output, SCK is the serial clock.
15 13 7 P3.7 UDM
PWM1, PWM2: PWM1 output, PWM2
output.
RXD1, TXD1: UART1 serial data input,
serial data output.
INT0, INT1: External interrupt 0, External
interrupt 1 input.
T0, T1: Timer 0, Timer 1 external input.
UDM, UDP: D-, D + signal terminal of a
USB host or USB device.
Note: P3.6 and P3.7 internal use V33 as I / O
power supply, so the high level of its input
and output only to V33 voltage does not
support 5V
5. Special Function Registers (SFR)
The following abbreviations may be used in describing the registers in this manual:
Abbreviation Description
RO Indicates the type of access: read only
WO Indicates the type of access: write only
RW Indicates the type of access: read and write
H Indicates a hexadecimal number
B Indicates a binary number
SFR 0, 8 1, 9 2, A 3, B 4, C 5, D 6, E 7, F
0xF8 SPI0_STAT SPI0_DATA SPI0_CTRL SPI0_CK_SE SPI0_SETUP RESET_KEEP WDOG_COU
SPI0_S_PRT NT
0xF0 B
0xB8 IP CLOCK_CFG
0xB0 P3 GLOBAL_CF
G
0xA8 IE WAKE_CTRL
B register (B):
Table 5.1.3 operation of the flag (X indicates that the flag is related to the operation result)
Opcode CY OV AC Opcode CY OV AC
ADD X X X SETB C 1
ADDC X X X CLR C 0
SUBB X X X CPL C X
MUL 0 X MOV C, bit X
DIV 0 X ANL C, bit X
DA A X ANL C, /bit X
RRC A X ORL C, bit X
RLC A X ORL C, /bit X
CJNE X
Some SFRs write data only in safe mode and always read-only in non-secure mode. Step into safe
mode:
1. Write 55h to this register;
2. Then write AAh to this register;
3. After that, about 13 to 23 system clock cycles are in safe mode, and one or more safety SFRs or
normal SFRs can be overwritten during the valid period.
4. Beyond the validity of the automatic termination of safe mode;
5. Additionally, writing any further value to this register can terminate Safe Mode early.
6. Memory Structure
6.1 memory space
CH554 addressing space is divided into program storage space, internal data storage space, external
data storage space.
The ID data can be obtained by reading Code Flash. ID number can be used with the download tool for
the target program to be encrypted, the general application, just use the first 32-bit ID number, you can
ignore 3FFAH address 8-bit data.
External supply voltage VCC pin voltage: external V33 pin voltage: 3.3V internal
voltage 3V ~ 5V voltage
3.3V or 3V Input an external 3.3V voltage to 3.3V external input as the
Including less than 3.6V the voltage regulator must be internal work of the power
connected to ground not less supply must be connected to not
than 0.1uF decoupling capacitor less than 0.1uF decoupling
capacitor
5V Input external 5V voltage to the 3.3V internal voltage regulator
Including more than 3.6V voltage regulator, must be output and 3.3V internal power
connected to ground not less supply input, must be connected
than 0.1uF decoupling capacitor to ground not less than 0.1uF
decoupling capacitor
After power on or system reset, CH554 is running by default. In the premise of the performance to
meet the requirements, properly reduce the system frequency can reduce power consumption during
operation. When the CH554 does not need to run at all, you can set the PD in PCON to sleep state, and
you can choose external wake-up through USB, UART0, UART1, SPI0 and some GPIOs in sleep
mode.
Table 7.2.2 Description of the most recent reset flag of the chip
8 System Clock
8.1 Clock Block Diagram
Figure 8.1.1 Clock System and Structure
After the internal clock or the external clock is selected as the original clock Fosc, the Fpll high-
frequency clock is generated after multiplying the 4xPLL frequency. Finally, the system clock Fsys and
the clock Fusb4x of the USB module are obtained through two sets of frequency divider respectively.
The system clock Fsys is provided directly to the various modules of the CH554.
9. Interrupts
The CH554 chip supports 14 interrupt sources including 6 groups of interrupts compatible with
standard MCS51: INT0, T0, INT1, T1, UART0, T2 and extended 8 groups of interrupts: SPI0, TKEY,
USB, ADC, UART1, PWMX, GPIO, WDOG, among them GPIO interrupts can choose from 7 I / O
pins.
The IP and IP_EX registers are used to set the interrupt priority. If a bit is set, the corresponding
interrupt source is set to high priority. If a bit is clear, the corresponding interrupt source is set to low
priority . For peer interrupt sources, the system has the default priority order. The default priority order
is shown in Table 9.1.1. The combination of PH_FLAG and PL_FLAG indicates the priority of the
current interrupt.
Table 9.1.3 Current Interrupt Priority Status Indication
PH_FLAG PL_FLAG Current interrupt priority status
0 0 No interruption at this time
0 1 Low priority interrupt is currently executing
1 0 High priority interrupt is currently executing
1 1 Unexpected status, unknown error
The Pn port configuration is implemented by a combination of Pn_MOD_OC [x] and Pn_DIR_PU [x]
as follows.
Table 10.2.2 Port Configuration Register Combination
P1 and P3 ports support pure input or push-pull output and quasi-bidirectional modes. Each pin has an
internal pull-up resistor that is freely controllable, as well as a protection diode connected to VCC and
GND.
Figure 10.2.1 is an equivalent schematic of the P1 pin's P1.x pin. After removing AIN, it can be applied
to P3 port. The figure after VCC changed to V33 for P3.6 and P3.7, that is, P3.6 and P3.7 pull-up or
input or output high only to V33 voltage.
P3.6 and P3.7 Select a standard pull-up resistor (up to V33), a 15KΩ pull-down resistor or a 1.5KΩ
strong pull-up resistor (to V33) for one of the pins. The standard pull-up resistor is only active in
bIOB_IO_EN = 0 ie GPIO mode and is controlled by bit 7, bit 6 of P3_DIR_PU; the pull-down resistor
is controlled by bUD_PD_DIS or bUH_PD_DIS at bUC_RESET_SIE = 0 regardless of bUSB_IO_EN;
the 1.5KΩ pull- Resistor, controlled by bUC_DEV_PU_EN when bUC_RESET_SIE = 0, is
independent of bUSB_IO_EN.
The left-to-right prioritization described in the table above refers to the order in which multiple
functional modules compete for use of the GPIO. For example, P3.0 can still be used for the higher
priority PWM1 output when P3.1 is used for TXD serial transmission.
12.2 Timer 2
Timer2 is a 16-bit auto-reload timer configured by the T2CON and T2MOD registers. The upper byte
counter of Timer 2 is TH2 and the lower byte is TL2. Timer2 can be used as UART0 baud rate
generator, but also has 2 signal level capture function, the capture count is stored in the RCAP2 and
T2CAP1 registers.
Table 12.2.1 Timer2 Related Registers List
[7:0] RCAP2L RW The low byte of the reload value in timer/counter 00h
mode; the low byte of the timer captured by CAP2 in
capture mode
Mode 3: Timer0 is split into two independent 8-bit Timer / Counters and borrows the TR1 control bit of
Timer1. Timer1 stops running by entering Start Mode 3 in place of the borrowed TR1 control bit.
Figure 12.4.1.4 Timer0 Mode 3
12.4.2 Timer2
Timer2 16-bit reload timer / counter mode:
1. Set bits RCLK and TCLK in T2CON to 0 to select non-serial port baud rate generator mode.
2. To set bit T2 in C_T2 to 0 to use internal clock, go to step (3); set to 1 to select the falling edge
of T2 pin
As the count clock, skip step (3).
3. Set T2MOD to select the internal clock frequency of Timer. If bT2_CLK is 0, then the clock of
Timer2 is Fsys / 12.
If bT2_CLK is 1, then bsMR_CLK = 0 or 1 selects Fsys / 4 or Fsys as the clock.
4. Set the bit CP_RL2 of T2CON to 0 to select the Timer2 16-bit reload timer function.
5. Set RCAP2L and RCAP2H as reload value after timer overflow, set TL2 and TH2 as initial
value of timer (Generally the same as RCAP2L and RCAP2H), set TR2 to 1 and turn on
Timer2.
6. The current timer / counter status can be retrieved by interrogating TF2 or Timer 2 interrupts.
Figure 12.4.2.1 Timer2 16-Bit Reload Timer / Counter
Under modes 1 and 3, UART0 baud rate is generated by timer T1 when RCLK = 0 and TCLK = 0. T1
should be mode 2 automatic reload 8-bit timer mode, bT1_CT and bT1_GATE must be 0, divided into
the following types of clock conditions.
Table 13.2.1.2 Calculating the UART0 baud rate from T1
In modes 1 and 3, UART0 baud rate is generated by Timer T2 when RCLK = 1 or TCLK = 1. T2
should be set to 16-bit auto-reload baud rate generator mode, C_T2 and CP_RL2 must be 0, divided
into the following types of clock conditions.
Table 13.2.1.3 Calculating the UART0 Baud Rate from T2
Mode 3: bSn_MST_CLK = 1
Figure 14.3.2 SPI Mode 3 Timing Diagram
The voltage comparator positive-phase input and ADC channel are selected by ADC_CHAN1 and
ADC_CHAN0.
ADC_CHAN1 ADC_CHAN0 Select the voltage comparator positive input and ADC input
channel
0 0 AIN0(P1.1)
0 1 AIN1(P1.4)
1 0 AIN2(P1.5)
1 1 AIN3(P3.2)
The pull-up resistor internal to the UCCn pin is selected by bUCCn_PU1_EN and bUCCn_PU0_EN.
bUCCn_PU1_EN bUCCn_PU0_EN Select the internal pull-up resistor on the UCCn pin
0 0 Internal pull-up resistor is disabled
0 1 Enable internal 56KΩ pull-up resistor to provide default
USB current
1 0 Enable internal 22KΩ pull-up resistor, said it can provide
1.5A current
1 1 Enable internal 10KΩ pull-up resistor, which can provide
3A current
The above USB type-C pull-up and pull-down resistors are independent of the port pull-up resistors
controlled by the Pn_DIR_PU port direction control and pull-up enable register. When a pin is used for
USB type-C, the pin corresponding to this pin should be disabled As a port pull-up resistor, it is
recommended to enable high-impedance input mode for this pin (to prevent this pin from outputting a
low level or high level).
For detailed control and input detection of USB type-C configuration channels, refer to USB type-C
Application Notes and Routines
USB Device Physical Port Control Register (UDEV_CTRL), controlled by bUC_RESET_SIE Reset:
USB host physical port control register (UHOST_CTRL), reset control by bUC_RESET_SIE:
Bit Name Access Description Reset Value
7 bUH_PD_DIS RW USB Host Port UDP / UDM Pin Internal Pull- 1
down Resistor Disable bit. This bit disables
the internal pull-down resistor. Setting this bit
to 0 enables the internal pull-down resistor.
This bit is not controlled by bUSB_IO_EN
and can also be used to provide pull-down
resistors in GPIO mode
6 Reserved RO Reserved 0
5 bUH_DP_PIN RO Current UDP pin state, 0 means low; 1 means x
high
4 bUH_DM_PIN RO Current UDM pin state, 0 for low; 1 for high x
3 Reserved RO Reserved 0
2 bUH_LOW_SPEED RW USB host physical port low speed mode 0
enable bit, this bit is 1 to select 1.5Mbps low
speed mode; this bit is 0 to select 12Mbps full
speed mode
1 bUH_BUS_RESET RW USB host port bus reset control bit, this bit is 0
1 to force the host port to output USB bus
reset; this bit is 0 to end output
0 bUH_PORT_EN RW USB Host Port Enable bit, this bit disables the 0
host port by 0; this bit enables the host port by
1. This bit is automatically cleared when the
USB device is disconnected
17. Touch-Key
17.1 Introduction to Touch-Key
CH554 chip provides capacitance detection module and related timers, with 6 input channels,
supporting capacitance range 5pF ~ 150pF. Self capacitance mode can support up to 6 touch keys,
mutual capacitance mode can support up to 15 touch keys.
By bTKC_CHAN2 ~ bTKC_CHAN0 select the touch button capacitance detection input channel.
bTKC_CHAN2 bTKC_CHAN1 bTKC_CHAN0 Select the touch button capacitance detection
input channel
0 0 0 Turn off the power of the capacitance detection
module and only serve as a separate timer
interrupt with a period of 1mS or 2mS
0 0 1 TIN0(P1.0)
0 1 0 TIN1(P1.1)
0 1 1 TIN2(P1.4)
1 0 0 TIN3(P1.5)
1 0 1 TIN4(P1.6)
1 1 0 TIN5(P1.7)
1 1 1 Turn on the power detection module but do not
connect any channels
18. Parameters
18.1 ABSOLUTE MAXIMUM (Critical or Exceeds Absolute
Maximum will probably cause the chip to malfunction or even be
damaged)
Name Parameter Description Min Max Unit
TA System frequency Fsys less than 28MHz ambient -40 85 ℃
temperature when working
TA32M System frequency Fsys greater than 28MHz ambient -20 70 ℃
temperature when working
TS Ambient temperature when stored -55 125 ℃
VCC Power supply voltage (VCC power supply, GND ground) -0.4 5.8 V
VIO Voltage on other input or output pins other than P3.6 / -0.4 VCC+0.4 V
P3.7
VIOU P3.6 / P3.7 Input or output pin voltage -0.4 V33+0.4 V