HT46R221 Holtek Semiconductor Inc, HT46R221 Datasheet - Page 20

no-image

HT46R221

Manufacturer Part Number
HT46R221
Description
8-Bit A/D Type MCU
Manufacturer
Holtek Semiconductor Inc
Datasheet
I
I
bidirectional 2-wire lines. The data line and clock line
are implement in SDA pin and SCL pin. The SDA and
SCL are NMOS open drain output pin. They must con-
nect a pull-high resistor respectively.
Using the I
data. One is in slave transmit mode, the other is in slave
receive mode. There are four registers related to I
BUS; HADR([20H]), HCR([21H]), HSR([22H]),
HDR([23H]). The HADR register is the slave address
setting of the device, if the master sends the calling ad-
dress which match, it means that this device is selected.
The HCR is I
device enable or disable the I
as a receiver. The HSR is I
sponds with the I
put data register, data to transmit or receive must be via
the HDR register.
The I
HEN bit define the enable or disable the I
data wants transfer via I
The HTX bit defines whether the I
or receive mode. If the device is as a transmitter, this bit
must be set to 1 . The TXAK defines the transmit ac-
knowledge signal, when the device received 8-bit data,
the device sends this bit to I
the receiver wants to continue to receive the next data,
this bit must be reset to 0 before receiving data.
The I
is reset to 0 when one data byte is being transferred. If
one data transfer is completed, this bit is set to 1 . The
HASS bit is set 1 when the address is match, and the
I
rupt is enabled and the stack is not full, a subroutine call
to location 10H will occur. Writing data to the I
control register clears HAAS bit. If the address is not
match, this bit is reset to 0 . The HBB bit is set to re-
spond the I
is detected. This bit is reset to 0 when the I
not busy. It means that a STOP signal is detected and
the I
command bit, if the calling address is match. When
HAAS is set to 1 , the device check SRW bit to deter-
mine whether the device is working in transmit or re-
ceive mode. When SRW bit is set 1 , it means that the
master wants to read data from I
vice must write data to I
working in transmit mode. When SRW is reset to 0 , it
means that the master wants to write data to I
the slave device must read data from the bus, so the
slave device is working in receive mode. The RXAK bit
is reset 0 indicates an acknowledges signal has been
received. In the transmit mode, the transmitter checks
Rev. 1.10
2
2
2
C BUS Serial Interface
C BUS is implemented in the device. The I
C BUS interrupt request flag is set to 1 . If the inter-
2
2
C BUS is free. The SRW bit defines the read/write
2
C BUS status register contains 5 bits. The HCF bit
C BUS control register contains three bits. The
2
2
C BUS, the device has two ways to transfer
C BUS is busy. It mean that a START signal
2
C BUS control register which defines the
2
C BUS status. The HDR is input/out-
2
2
C BUS, so the slave device is
C BUS, this bit must be set.
2
C BUS status register, it re-
2
2
C BUS at the 9th clock. If
C BUS as a transmitter or
2
2
C BUS, the slave de-
C BUS is in transmit
2
C BUS. If the
2
C BUS is a
2
C BUS is
2
2
C BUS,
C BUS
2
C
20
RXAK bit to know the receiver which wants to receive
the next data byte, so the transmitter continue to write
data to the I
the transmitter releases the SDA line, so that the master
can send the STOP signal to release the bus.
The HADR bit7-bit1 define the device slave address. At
the beginning of transfer, the master must select a de-
vice by sending the address of the slave device. The bit
0 is unused and is not defined. If the I
start signal, all slave device notice the continuity of the
8-bit data. The front of 7 bits is slave address and the
first bit is MSB. If the address is match, the HAAS status
bit is set and generate an I
the slave device must check the HAAS bit to know the
I
has match or completed one 8-bit data transfer. The last
bit of the 8-bit data is read/write command bit, it re-
sponds in SRW bit. The slave will check the SRW bit to
know if the master wants to transmit or receive data. The
device check SRW bit to know it is as a transmitter or re-
ceiver.
Note:
The HDR register is the I
ter. Before transmitting data, the HDR must write the
data which we want to transmit. Before receiving data,
the device must dummy read data from HDR. Transmit
or Receive data from I
ister. At the beginning of the transfer of the I
device must initial the bus, the following are the notes for
initialing the I
1: Write the I
its own slave address.
2: Set HEN bit of I
enable the I
2
(HCR)
Label
HEN
HTX
TXAK 3
C BUS interrupt comes from the slave address that
Slave Address
Bit7~Bit1
Bits
0~2 Unused bit, read as 0
7
6 Unused bit, read as 0
5 Unused bit, read as 0
4
means undefined
2
2
2
To enable or disable I
(0= disable; 1= enable)
To define the transmit or receive mode
(0= receive mode; 1= transmit)
To enable or disable transmit acknowl-
edge (0= acknowledge; 1= don t acknowl-
edge)
C BUS.
C BUS until the RXAK bit is set to 1 and
2
C BUS address register (HADR) to define
C BUS:
2
C BUS control register (HCR) bit 0 to
HADR register
HCR register
2
C BUS must be via the HDR reg-
2
C BUS input/output data regis-
HT46R22/HT46C22
2
C BUS interrupt. In the ISR,
Function
2
C BUS function
2
Bit0
C BUS receives a
October 2, 2002
2
C BUS, the

Related parts for HT46R221