SM5964B
8-Bit Micro-controller
64KB with ISP Flash
& 1KB RAM embedded
13. Two-Wire Series Interface (TWSI)
Two Wire Serial Interface, is a serial interface in SM5964B, that is function compatible with IIC 400kps specification
and is capable to communicate with standard IIC devices via configuring SM5964B as one of IIC device types -
master transmitter, master receiver, slave transmitter or slave receiver device.
Mnemonic
Description
Dir.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RST
TWSI
P1 Control
Register
TWSI Status
Register
TWSI Address
Register
TWSIC Control
Register 1
TWSIC Control
Register 2
TWSI TX Data
Register
TWSI RX Data
Register
Interrupt Flag
Register
PWM1
E
PWM0
E
P1CON
TWSIS
9BH
C0H
C1H
SDAE
RXIF
SCLE
TXIF
ADR.5
-
-
-
-
-
00H
00H
A0H
01H
00H
FFH
00H
00H
TFAIL
NAKIF
-
RXACK
ADR.1
MST
ADR.0
TXACK
ADR
MK
TWSIA
ADR.6
ADR.4
ADR.3
ADR.2
Bus
Busy
RESTA
RT
TWSIF TWSIF TWSIF
S2
TWSIC1
TWSIC2
TWSITXD
TWSIRXD
IFR
C2H TWSIE
-
-
S1
S0
MATC
C3H
H
SRW
TXD.6
RXD.6
-
-
-
-
-
MRW
C4H
C5H
AAH
TXD.7
RXD.7
-
TXD.5
RXD.5
-
TXD.4
RXD.4
-
TXD.3
RXD.3
-
TXD.2
RXD.2
-
TXD.1
RXD.1
TWSIIF
TXD.0
RXD.0
-
Mnemonic: P1CON
Address: 9Bh
7
6
5
-
4
-
3
2
1
-
0
-
Reset
00h
SDAE
SCLE
PWM1E PWM0E
SDAE: Set 1 to configure P1[7] as SDA pin of TWSI.
SCLE: Set 1 to configure P1[6] as SCL pin of TWSI.
Mnemonic: TWSIS
Address: C0h
7
6
TXIF
5
4
3
-
2
1
MST
0
Reset
00h
RXIF
TFAIL
NAKIF
RXACK
TXACK
RXIF: TWSI interrupt flag for data receiving. It is set after the TWSI RXD (Receive
Data Buffer) is loaded with new received data.
TXIF: TWSI interrupt flag for data transmitting. It is set when the data of TWSITXD
(Transmit Data Buffer) is downloaded onto the shift register or the TWSIA is
downloaded onto the shift register at Master Transmit mode.
TFAIL: This flag is set when the data transmit is failed. (Master mode only)
NAKIF: Non-acknowledge interrupt flag. It is only set in the master mode when there is
no acknowledge bit detected after one byte data or calling address is
transferred.
RXACK: The acknowledge status indicator. When clear, it means an acknowledge
Specifications subject to change without notice contact your sales representatives for the most recent information.
ISSFD-M081 Ver A SM5964B 3/7/2014
- 46 -