Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
БЭМЗ полищук доки / Склад / Datasheet_LM3S6965.pdf
Скачиваний:
10
Добавлен:
21.12.2020
Размер:
6.13 Mб
Скачать

LM3S6965 Microcontroller

If the application doesn't require the use of interrupts, the raw interrupt status is always visible via the I2C Master Raw Interrupt Status (I2CMRIS) register.

15.2.3.2 I2C Slave Interrupts

Theslavemodulecangenerateaninterruptwhendatahasbeenreceivedorrequested. Thisinterrupt is enabled by writing a 1 to the DATAIM bit in the I2C Slave Interrupt Mask (I2CSIMR) register. Software determines whether the module should write (transmit) or read (receive) data from the I2C Slave Data (I2CSDR) register,bycheckingthe RREQ and TREQ bitsofthe I2C Slave Control/Status (I2CSCSR) register. Iftheslavemoduleisinreceivemodeandthefirstbyteofatransferisreceived, the FBR bit is set along with the RREQ bit. The interrupt is cleared by writing a 1 to the DATAIC bit in the I2C Slave Interrupt Clear (I2CSICR) register.

If the application doesn't require the use of interrupts, the raw interrupt status is always visible via the I2C Slave Raw Interrupt Status (I2CSRIS) register.

15.2.4Loopback Operation

The I2C modules can be placed into an internal loopback mode for diagnostic or debug work. This is accomplished by setting the LPBK bit in the I2C Master Configuration (I2CMCR) register. In loopback mode, the SDA and SCL signals from the master and slave modules are tied together.

15.2.5Command Sequence Flow Charts

This section details the steps required to perform the various I2C transfer types in both master and slave mode.

15.2.5.1 I2C Master Command Sequences

The figures that follow show the command sequences available for the I2C master.

November 16, 2008

397

Preliminary

Inter-Integrated Circuit (I2C) Interface

Figure 15-7. Master Single SEND

 

 

Idle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write Slave

 

 

 

Address to

Sequence

 

 

I2CMSA

may be

 

 

 

 

omitted in a

 

 

 

 

 

 

 

 

Single Master

 

 

 

 

 

 

 

 

system

 

 

Write data to

 

 

 

 

 

I2CMDR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

NO

 

 

 

BUSBSY bit=0?

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---0-111 to

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

NO

 

 

 

 

 

 

 

BUSY bit=0?

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

Error Service

NO ERROR bit=0?

YES

Idle

398

November 16, 2008

Preliminary

Figure 15-8. Master Single RECEIVE

Idle

Write Slave

Address to

I2CMSA

Read I2CMCS

NO BUSBSY bit=0?

YES

Write ---00111 to

I2CMCS

Read I2CMCS

LM3S6965 Microcontroller

Sequence may be omitted in a Single Master system

Error Service

NO

BUSY bit=0?

YES

NO ERROR bit=0?

YES

Read data from

I2CMDR

Idle

November 16, 2008

399

Preliminary

Inter-Integrated Circuit (I2C) Interface

Figure 15-9. Master Burst SEND

 

 

Idle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write Slave

Sequence

 

 

Address to

 

 

may be

 

 

I2CMSA

 

 

omitted in a

 

 

 

 

Single Master

 

 

 

 

 

 

 

 

system

 

 

Write data to

 

 

 

 

 

I2CMDR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

NO

 

 

 

BUSBSY bit=0?

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---0-011 to

 

 

 

I2CMCS

 

 

 

 

 

 

Read I2CMCS

NO

BUSY bit=0?

YES

 

 

 

 

ERROR bit=0?

NO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NO

 

 

 

 

 

 

 

Write data to

 

 

ARBLST bit=1?

 

 

 

 

I2CMDR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---0-001 to

 

NO

Index=n?

 

Write ---0-100 to

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

Error Service

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---0-101 to

 

 

 

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

Idle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NO

BUSY bit=0?

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

NO

 

 

 

 

 

 

Error Service

 

 

ERROR bit=0?

 

 

 

 

 

 

 

 

 

YES

Idle

400

November 16, 2008

Preliminary

LM3S6965 Microcontroller

Figure 15-10. Master Burst RECEIVE

 

 

Idle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Sequence

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

may be

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write Slave

omitted in a

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

Address to

Single Master

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2CMSA

system

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BUSY bit=0?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NO

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NO

BUSBSY bit=0?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ERROR bit=0?

NO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

NO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ARBLST bit=1?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---01011 to

 

 

 

 

 

 

 

Read data from

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

I2CMDR

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---0-100 to

 

 

 

 

 

 

 

 

Write ---01001

NO

Index=m-1?

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

 

 

 

 

 

 

 

 

Error Service

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Write ---00101 to

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2CMCS

 

 

 

 

 

 

 

 

Idle

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read I2CMCS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BUSY bit=0?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

YES

NO ERROR bit=0?

YES

Error Service

Read data from

I2CMDR

Idle

November 16, 2008

401

Preliminary

Inter-Integrated Circuit (I2C) Interface

Figure 15-11. Master Burst RECEIVE after Burst SEND

Idle

Master operates in

Master Transmit mode

STOP condition is not generated

Write Slave

Address to

I2CMSA

Write ---01011 to

I2CMCS

Repeated START condition is generated

with changing data Master operates in direction Master Receive mode

Idle

402

November 16, 2008

Preliminary

Соседние файлы в папке Склад