Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
87
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

Inter-integrated circuit (I2C) interface

RM0016

21.7.10Interrupt register (I2C_ITR)

Address offset: 0x0A

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

Reserved

 

 

ITBUFEN

ITEVTEN

ITERREN

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

 

 

 

 

 

 

 

 

 

 

 

 

 

Bits 7:3

Reserved

 

 

 

 

 

 

Bit 2

ITBUFEN: Buffer interrupt enable

 

 

 

 

 

0: TXE = 1 or RXNE = 1 does not generate any interrupt. 1:TXE = 1 or RXNE = 1 generates Event interrupt.

Bit 1 ITEVTEN: Event interrupt enable

0:Event interrupt disabled

1:Event interrupt enabled

This interrupt is generated when:

SB = 1 (Master)

ADDR = 1 (Master/Slave)

ADD10= 1 (Master)

STOPF = 1 (Slave)

BTF = 1 with no TXE or RXNE event

TXE event to 1 if ITBUFEN = 1

RXNE event to 1if ITBUFEN = 1

WUFH = 1 (asynchronous interrupt to wakeup from Halt)

Bit 0 ITERREN: Error interrupt enable

0:Error interrupt disabled

1:Error interrupt enabled

This interrupt is generated when:

BERR = 1

ARLO = 1

AF = 1

OVR = 1

302/454

Doc ID 14587 Rev 9

RM0016

Inter-integrated circuit (I2C) interface

21.7.11Clock control register low (I2C_CCRL)

Address offset: 0x02

Reset value: 0x0B

7

6

5

4

3

2

1

0

CCR[7:0]

rw

Bits 7:0 CCR[7:0] Clock control register (Master mode)

Controls the SCLH clock in Master mode.

Standard mode:

Period(I2C) = 2 * CCR * tMASTER thigh = CCR * tMASTER

tlow = CCR * tMASTER

Fast mode: If DUTY = 0:

Period(I2C) = 3* CCR * tMASTER thigh = CCR * tMASTER

tlow = 2 * CCR * tMASTER

If DUTY = 1: (to reach 400 kHz)

Period(I2C) = 25 * CCR * tMASTER thigh = 9 * CCR * tMASTER

tlow = 16 * CCR * tMASTER

Note: tCK = 1/ fMASTER. fMASTER is the input clock to the peripheral configured using clock control register.

The minimum allowed value is 04h, except in FAST DUTY mode where the minimum allowed value is 0x01.

thigh = tr(SCL) + tw(SCLH). See device datasheet for the definitions of parameters. tlow = tf(SCL) + tw(SCLL). See device datasheet for the definitions of parameters. I2C communication speed, fSCL = 1/(thigh + tlow)

These timings are without filters.

Doc ID 14587 Rev 9

303/454

Соседние файлы в папке Минимум документации STM8