ht82a851r Holtek Semiconductor Inc., ht82a851r Datasheet - Page 23

no-image

ht82a851r

Manufacturer Part Number
ht82a851r
Description
Ht82a851r -- Usb Audio Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
SPI
The serial interface function is similar to the Motorola SPI, where four basic signals are included. These are the SDI
(Serial Data Input), SDO (Serial Data Output), SCK (serial clock) and SCS (slave select pin).
Note: U unchanged
Two registers, SBCR and SBDR, are provided for serial interface control, status and data storage.
Rev. 1.20
SBCR
Default
SBDR
Default
SBCR: Serial bus control register
Label
Bit7 (CKS): clock source selection: f
Bit6 (M1), Bit5 (M0): master/slave mode and baud rate selection
Bit4 (SBEN): Serial bus enable/disable (1/0)
Bit3 (MLS): MSB or LSB (1/0) shift first control bit
Bit2 (CSEN): serial bus selection signal enable/disable (SCS), when CSEN=0, SCS is floating
Bit1 (WCOL): this bit is set to 1 if data is written to SBDR (TXRX buffer) when the data is transferring
Bit 0 (TRF): data transferred or data received
Note: data reception is still operational when the MCU enters the Power-down mode
00: Master mode, baud rate = f
01: Master mode, baud rate = f
10: Master mode, baud rate = f
11: Slave mode
Disable
Master mode: write data to SBDR (TXRX buffer)
Master mode: when data has been transferred
Slave mode: when a SCK (and SCS dependent on CSEN) is received, data in the TXRX buffer is shifted-out and
data on SDI is shifted-in.
Note: 1. If SBEN= 1 , the pull-high resistors on PC4~PC7 will be disabled. When this happens external pull-high
resistors should be added to the SPI related pins if necessary (EX: pin SCS).
M1, M0=
Enable: (SCS dependent on CSEN bit)
Disable: SCK (SCK), SDI, SDO, SCS floating and related pins are IO ports.
writing will be ignored if data is written to SBDR (TXRX buffer) when the data is transferring
WCOL will be set by hardware and cleared by software.
SBEN=1
SBEN=0
Serial Bus
Control Register
Serial Bus
Data Register
Label
2. If CSEN= 0 , the SCS pin will enter a floating state.
Functions
enable: SCK, SDI, SDO, SCS =0 (SCK= 0 ) and wait to write data to SBDR (TXRX buffer)
PC4~PC7 are SPI function pins (pin SCS will go low if CSEN=1).
PC4~PC7 are general purpose I/O Port pins - default
CKS
D7
D7
U
0
SIO
SIO
SIO
/4
/16
SIO
= f
M1
D6
D6
U
1
SYS
/2, select as 0; f
SPI Timing
used to generate an interrupt
M0
D5
D5
U
1
set TRF
23
start transmission/reception automatically
SBEN
Functions
SIO
D4
D4
U
0
= f
SYS
, select as 1
MLS
D3
D3
U
0
CSEN
D2
D2
U
0
WCOL
HT82A851R
D1
D1
U
0
June 15, 2007
TRF
D0
D0
U
0

Related parts for ht82a851r