
. . . . .
I 2 C M A S T E R / S L A V E I N T E R F A C E
I2C command interface
www.digiembedded.com
449
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I
2
C c o m m a n d i n t e r f a c e
The I
2
C module converts parallel (8-bit) data to serial data and serial data to
parallel data between the processor and the I
2
C bus, using a set of interface
registers.
•
The primary interface register for transmitting data is the
CMD_TX_DATA_REG
(write-only).
•
The primary interface register for receiving data is the
STATUS_RX_DATA_REG
(read-only).
Locked interrupt
driven mode
I
2
C operates in a locked interrupt driven mode, which means that each command
issued must wait for an interrupt response before the next command can be issued
(illustrated in "Flow charts," beginning on page 457).
The first bit of the command — 0 or 1 — indicates to which module — master or
slave, respectively — the command in the CMD field (of the
CMD_TX_DATA_REG
) is
sent. The master module can be sent a master command only; the slave module can
be sent a slave command only (see "Master module and slave module commands,"
beginning on page 449, for a list of commands). If a command is sent to the master
module, that module is locked until a command acknowledgement is given.
Similarly, if a command is sent to the slave module, the slave module is locked until
it receives a command acknowledgement. With either module, the
acknowledgement can be any interrupt associated with that module. When a
module is locked, another command must not be sent to that module.
The command lock status can be checked in the
STATUS_RX_DATA_REG
.
Master module
and slave module
commands
The I
2
C master recognizes four high-level commands, which are used in the CMD
field of the Command register; the I
2
C slave recognizes two high-level commands:
Bus arbitration
Any
M_READ
or
M_WRITE
command causes the I
2
C module to participate in the bus
arbitration process when the I
2
C bus is free (idle). If the module becomes the new
Command
Name
Description
0x0
M_NOP
No operation.
0x4
M_READ
Start reading bytes from slave.
0x5
M_WRITE
Start writing bytes to slave.
0x6
M_STOP
Stop this transaction (give up the I
2
C bus).
0x10
S_NOP
No operation. This command is necessary for 16-bit
mode, providing data in
TX_DATA_REG
without a
command.
0x16
S_STOP
Stop transaction by not acknowledging the byte
received.
Summary of Contents for NS9215
Page 1: ...NS9215 Hardware Reference 90000847_C Release date 10 April 2008...
Page 3: ......
Page 4: ......
Page 26: ...26 Hardware Reference NS9215...
Page 44: ...P I N O U T 26 5 System clock 44 Hardware Reference NS9215 System clock drawing...
Page 52: ...P I N O U T 26 5 Power and ground 52 Hardware Reference NS9215...
Page 80: ...I O C O N T ROL M O D U L E Memory Bus Configuration register 80 Hardware Reference NS9215...
Page 136: ...WOR KI N G W I TH T H E C P U Noncachable instruction fetches 136 Hardware Reference NS9215...
Page 202: ...S Y S T E M C O N T RO L M OD U L E RTC Module Control register 202 Hardware Reference NS9215...
Page 354: ...E X T E R N A L D M A DMA Peripheral Chip Select register 354 Hardware Reference NS9215...
Page 472: ...R E A L TI M E C L O C K M O D U L E General Status register 472 Hardware Reference NS9215...
Page 512: ...TI M I NG Clock timing 512 Hardware Reference NS9215...
Page 515: ...PA CKA GING Processor Dimensions www digiembedded com 515...
Page 516: ...PA CKA GING Processor Dimensions 516 Hardware Reference NS9215...