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

RM0016

 

 

 

 

 

Inter-integrated circuit (I2C) interface

Table 50.

I2C_CCR values for SCL frequency table (fMASTER = 10 MHz or 16 MHz(1))

 

 

I2C

 

 

 

 

 

 

 

 

 

frequency

 

fMASTER = 10 MHz

 

 

fMASTER= 16 MHz

 

I2C

(fSCL)

 

 

 

 

 

 

 

 

Speed

 

Actual

% Error

I2C_CCR

Duty

Actual

% Error

I2C_CCR

Duty cycle

 

 

 

in Hz

cycle

 

(Hz)

(%)

(h)

(Hz)

(%)

(h)

bit

 

 

bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

400000

400000

0

1

1

410256.41

2.56

D

0

 

 

 

 

 

 

 

 

 

 

 

370000

370370.37

0.10

9

0

380952.38

2.96

E

0

 

 

 

 

 

 

 

 

 

 

 

350000

370370.37

5.82

9

0

355555.56

1.59

F

0

 

 

 

 

 

 

 

 

 

 

 

320000

333333.33

4.17

A

0

320000

0

2

1

 

 

 

 

 

 

 

 

 

 

 

300000

303030.30

1.01

B

0

313725.49

4.57

11

0

 

 

 

 

 

 

 

 

 

 

Fast

270000

277777.78

2.88

C

0

280701.75

3.96

13

0

 

 

 

 

 

 

 

 

 

speed

250000

256410.26

2.56

D

0

253968.25

1.59

15

0

 

 

 

 

 

 

 

 

 

 

 

 

220000

222222.22

1.01

F

0

222222.22

1.01

18

0

 

 

 

 

 

 

 

 

 

 

 

200000

200000

0

2

1

205128.20

2.56

1A

0

 

 

 

 

 

 

 

 

 

 

 

170000

175438.60

3.20

13

0

172043.01

1.20

1F

0

 

 

 

 

 

 

 

 

 

 

 

150000

151515.15

1.01

16

0

152380.95

1.59

23

0

 

 

 

 

 

 

 

 

 

 

 

120000

123456.79

2.88

1B

0

121212.12

1.01

2C

0

 

 

 

 

 

 

 

 

 

 

 

100000

100000

0

32

 

100000

0

50

 

 

 

 

 

 

 

 

 

 

 

Standard

50000

50000

0

64

No impact

50000

0

A0

No impact

 

 

 

 

 

 

 

speed

30000

30120.48

0.40

A6

30075.19

0.25

10A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

20000

20000

0

FA

 

20000

0

190

 

 

 

 

 

 

 

 

 

 

 

1. The following table gives the values to be written in the I2C_CCR register to obtain the required I²C SCL line frequency

21.7.13TRISE register (I2C_TRISER)

Address offset: 0x0D

Reset value: 0x02

7

6

5

4

3

2

1

0

TRISE[5:0]

Reserved

rw

Bits 7:6 Reserved

Doc ID 14587 Rev 9

305/454

Inter-integrated circuit (I2C) interface

RM0016

Bits 5:0 TRISE[5:0] Maximum rise time in Fast/Standard mode (Master mode)

These bits must be programmed with the maximum SCL rise time given in the I2C bus specification, incremented by 1.

For instance: in standard mode, the maximum allowed SCL rise time is 1000 ns.

If the value in the I2C_FREQR register = 08h, then tMASTER = 125 ns therefore the TRISE[5:0] bits must be programmed with 0x09.

(1000 ns / 125 ns = 8 + 1)

The filter value can also be added to TRISE[5:0].

If the result is not an integer, TRISE[5:0] must be programmed with the integer part, in order to respect the tHIGH parameter.

Note: TRISE[5:0] must be configured only when the I2C is disabled (PE = 0).

21.7.14I2C register map and reset values

Table 51.

I2C register map

 

 

 

 

 

 

 

 

 

 

 

Address

Register

7

6

5

 

4

 

3

 

2

 

1

0

offset

name

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x00

I2C_CR1

NO STRETCH

ENGC

-

 

-

 

-

 

-

 

-

PE

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x01

I2C_CR2

SWRST

-

-

 

-

 

POS

 

ACK

 

STOP

START

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x02

I2C_FREQR

-

-

FREQ5

 

FREQ4

 

FREQ3

 

FREQ2

 

FREQ1

FREQ0

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x03

I2C_OARL

 

 

 

ADD[7:1]

 

 

 

 

 

ADD0

Reset value

 

 

 

0

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x04

I2C_OARH

ADDMODE

ADDCONF

-

 

-

 

-

 

ADD[9:8]

-

Reset value

0

0

0

 

0

 

0

 

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x05

 

 

 

 

Reserved

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x06

I2C_DR

 

 

 

 

DR[7:0]

 

 

 

 

 

 

Reset value

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x07

I2C_SR1

TXE

RXNE

-

 

STOPF

 

ADD10

 

BTF

 

ADDR

SB

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x08

I2C_SR2

-

-

WUFH

 

-

 

OVR

 

AF

 

ARLO

BERR

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x09

I2C_SR3

-

-

-

 

GENCALL

 

-

 

TRA

 

BUSY

MSL

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x0A

I2C_ITR

-

-

-

 

--

 

--

 

ITBUFEN

 

ITEVTEN

ITERREN

Reset value

0

0

0

 

0

 

0

 

0

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x0B

I2C_CCRL

 

 

 

 

CCR[7:0]

 

 

 

 

 

 

Reset value

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x0C

I2C_CCRH

FS

DUTY

-

 

-

 

 

 

CCR[11:8]

 

Reset value

0

0

0

 

0

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0x0D

I2C_TRISER

-

-

 

 

 

 

TRISE[5:0]

 

 

 

Reset value

0

0

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

306/454

Doc ID 14587 Rev 9

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