The DataSheet of CH376 (the first)
1
File manage and control chip CH376
English DataSheet
Version: 1
http://wch.cn
http://wch-ic.com
1. Introduction
CH376 is used as file manage control chip, used to MCU system read/write file in USB Flash Drive or
SD card.
CH376 supports USB-Device Mode and USB-HOST Mode. Set the basic firmware of USB
communication protocol in the inner. It is also set firmware of special communication protocol to deal with
Mass-Storage devices, communication interface firmware of SD card, FAT16, FAT32 and FAT12 file system
manage firmware in the inner. It supports common USB storage devices (contains USB Flash Drive/USB
hard disk/USB Flash memory/USB read card) and SD cards (contain SD card with standard capacity and
HC-SD card with high capacity, MMC card and TF card compatible with protocol).
CH376 supports three communication interfaces: 8-bit parallel, SPI interface or asynchronism serial
interface. DSP/MCU/MPU etc. controller via the any interface of them to control CH376 chip, storage and
get file in USB Flash Drive or SD card, or communication with computer.
The USB-DEVICE Mode of CH376 is totally compatible with CH372, the USB-HOST Mode of
CH375 is basically compatible with CH375.
The following is the application image of CH376.
D0-D7
A0
RD#
WR#
PCS#
Parallel bus
SCS
SCK
MOSI => SDI
MISO <= SDO
SPI bus
TXD => RXD
RXD <= TXD
UART
INT#
8-bit
passive
parallel
USB-Phy I/O
USB-Device
USB-Host
File system
Manage firmware
SPI
Device
interface
USB firmware
ROM
RAM
SD card and
protocol compatible
card:
MMC
Mini-SD
TF card
D+
D-
USB Bus
PC or USB device:
USB flash memory
USB Flash Drive
/USB reader USB
printer
USB keyboard
USB mice
Local
Controller
DSP
MCU
MPU
Etc.
High-speed MCU
asynchronism
serial
SD card port
SPI Host
SDCS
SDCK
SDDO
SDDI
SPI
port
CH376 chip
2. Features
●
Supports 1.5Mbps low-speed and 12Mbps full-speed, compatible with USB V2.0, only needs crystal and
The DataSheet of CH376 (the first)
2
capacitance external.
●
USB-HOST Mode and USB-DEVICE Mode, automatically switch Host Mode and Device Mode.
●
Supports USB device control transfer, bulk transfer and interrupt transfer.
●
Detects USB device plug and unplug automatically and sends message to USB host.
●
Supply SPI host interface with 6MHz, supports SD card, MMC card and TF card which compatible with
protocol.
●
set protocol manager of USB control transfer in the inner to simplify common control transfer.
●
Set up firmware of special communication protocol to do with Mass-storage. Supports Bulk-Only transfer
protocol and USB storage device of SCSI, UFI, RBC and other equivalent storage device which
accommodates the minimum set of command including USB Flash Drive, USB HD, USB flash memory and
USB reader.
●
Set file system manage firmware of FAT16, FAT32 and FAT12, support the capacity up to 32GB USB
Flash Drive and SD Card.
●
Supply file manage function: open, create or delete file, enumerate and search file, create the sub-catalog,
and support the long file name.
●
Supply file read/write function: read/write file in the much long sub-catalog take byte as unit or fan as unit.
●
Supply disk manage function: initialize disk, query physical capacity, query spare space, physical sectors
read/write.
●
Supply 8-bit passive parallel interface with 2MB speed, support parallel data bus connect to MCU.
●
Supply SPI device interface with 2MB/24MHz speed, support SPI serial bus connect to MCU.
●
Supply asynchronism serial interface up to 3Mbps speed, support serial interface connect to MCU, support
automatically adjust communication baud-rate.
●
Source power is 5V or 3.3V, and low-power mode is supported.
●
USB-DEVICE Mode is totally compatible with CH372 chip, USB-HOST Mode is basically compatible
with CH375 chip.
●Adoption
SOP-28 and SSOP20 lead-free package, compatible with RoHS, supplies diversion board from
SOP28 to DIP28, the pins of SOP28 are compatible with CH375.
3. Package
Package shape Width of plastic
SOP-28
SSOP-20
Pitch of pin
Instruction of package
Small outline package of 28-pin
Shrink small outline package of 20-pin
Ordering type
CH376S
CH376T
7.62mm 300mil 1.27mm 50mil
5.30mm 209mil 0.65mm 25mil
The DataSheet of CH376 (the first)
3
4. Pins
CH376S
pin No.
28
12
9
CH376T
pin No.
20
10
7
Pin Name
Pin Type
Pin Description
Positive power input port, requires an
external 0.1uF power decoupling
capacitance
Public ground, ground connection for USB
Attachment of VCC input external power
while 3.3V;connects of 0.01uF decoupling
capacitance outside while 5V
Input of crystal oscillator, attachment of
12MHz crystal outside
Opposite output of crystal oscillator,
attachment of 12MHz crystal outside
USB Data Signal plus
USB Data Signal minus
SPI interface chip select output of SD,
active with low-level, with pull-up resister
SPI interface serial clock output of SD
SPI interface serial data input of SD, with
pull-up resister
SPI interface serial data output of SD
Power on reset and external reset before
enter into SD mode, active with high-level
Parallel 8-bit bi-directional data bus, with
pull-up resistor
Chip select input of SPI interface, active
with low-level, with pull-up resistor
Serial clock input of SPI, with pull-up
resistor
Serial data input of SPI interface, with
pull-up resistor
Serial data output of SPI interface
Busy state output of SPI interface, active
with high-level
Address input of parallel, distinguish of
command port with data port, with pull-up
resistor,
A0=1, write command or read status; A0=0
read/write data
Chip select input, active with low-level,
with pull-up resistor
VCC
GND
V3
POWER
POWER
POWER
13
14
10
11
23
26
7
25
25
22½15
18
20
21
22
19
11
12
8
9
17
19
6
18
18
No
13
14
15
16
No
XI
XO
UD+
UD-
SD_CS
SD_CK
SD_DI
SD_DO
RST
D7½D0
SCS
SCK
SDI
SD0
BZ
IN
OUT
USB signal
USB signal
Drain open OUT
OUT
IN
OUT
OUT
Bi-directional
tri-state
IN
IN
IN
tri-state
OUT
8
No
A0
IN
27
No
PCS#
IN
The DataSheet of CH376 (the first)
4
3
No
No
No
3
RD#
WR#
SPI#
IN
IN
IN
4
Read strobe input of parallel, active with
low-level. With pull-up resistor
Write strobe input of parallel, active with
low-level. With pull-up resistor
Interface configure input during internal
reset, with pull-up reset
Interface configure input during internal
reset, with pull-up reset
Serial data output of Asynchronism serial
interface after resetting
Serial data input of Asynchronism serial
interface, with pull-up resistor
Interrupt query output, active with
low-level, with pull-up resistor
Status output, active with low-level, with
pull-up resistor. Inside USB-DEVICE
mode, active with low-level under
USB-DEVICE;
In SD card Mode, SPI communication
success status output;
USB device connection state output under
USB-HOST, active with low-level
Reset input external, active with high level,
with pull-down resistor
5
4
TXD
IN
OUT
6
1
5
1
RXD
INT#
IN
OUT
24
No
ACT#
Drain open OUT
2
2
RSTI
IN
5. Command
The data in this manual has three types. Binary numbers are followed by a
“B”.
Hexadecimal numbers
are followed by an
“H”.
Numbers without annotations are decimals.
The double word data (32-bit) with Litter-Endian means: the first is the lowest byte (bit-7 to bit-0), the
following is lower byte (bit-15 to bit-8), the higher byte (bit-23 to bit-16), the end is the highest byte (bit-31
to bit-24).
Data stream means data block constituent by sequence bytes, the min long of data block is 0, and the
max is 255.
The data in bracket of the input data and output data with the following table is the byte number of
parameter, without bracket means one byte.
The MCU referred in this manual are basically applied to DSP or MCU/MPU/SCM and so on.
The USB Flash Drive referred in this manual contains USB Flash Drive, USB HD, USB Flash Memory,
USB reader and so on.
The SD card referred in this manual contains SD, MMC card, HC-SD card (with high capacity), TF
card and so on.
The manual mainly supplies commands of file manage control, uses to USB Flash Drive and SD card.
Commands of assistant, executing basic affair and controlling transfer can refer to the second manual, please
consult CH376DS2.PDF.
The function of CH372 is totally contained by CH376 chip, in this DataSheet, there is no description
The DataSheet of CH376 (the first)
5
about USB-DEVICE, the CH372DS1.PDF is the reference data.
Code
01H
Command name
GET_IC_VER
Detach freq coef
02H
SET_BAUDRATE
Detach freq const
Input data
Output data
Version number
Functions
Obtain chip and
firmware version
number
Set serial
communication baud
rate
Go to low-power and
suspending
(Wait for 35mS)
Any data
Data 16H
Interrupt Mode
Data 68H
Mode code
File length (4)
(Wait for 10uS)
Operation status
Interruption
status
Data length
27H
RD_USB_DATA0
Data stream (n)
2CH
WR_USB_DATA
Data length
Data stream (n)
Data length
2DH
WR_REQ_DATA
Data stream (n)
Excursion address
2EH
WR_OFS_DATA
Data length
Data stream (n)
2FH
30H
31H
SET_FILE_NAME
DISK_CONNECT
DISK_MOUNT
Character string (n)
Produce
interruption
Produce
interruption
Produce
interruption
Complementary
operation
accord bit
Execute hardware reset
Test communication
interface and working
status
Set interrupt Mode of
SD0 in SPI
Get the current file
length
Configure the work
mode of USB
Get interruption status
and cancel requirement
Read data from current
interrupt port buffer of
USB or receive buffer of
host port
Write data to transfer
buffer of USB host
Write requested data
block to internal
appointed buffer
Write data block to
internal buffer with
appointed excursion
address
Set the file name which
will be operated
Check the disk
connection status
Initialize disk and test
disk ready
Open file or catalog,
enumerate file and
catalog
(Wait for 1mS)
Operation status
03H
05H
06H
ENTER_SLEEP
RESET_ALL
CHECK_EXIST
0BH
0CH
15H
22H
SET_SD0_INT
GET_FILE_SIZE
SET_USB_MODE
GET_STATUS
32H
FILE_OPEN