Texas Instruments CC2650DK Benutzerhandbuch

Seite von 1570
Functional Description
21.3.1.5 Arbitration
A master may start a transfer only if the bus is idle. Two or more masters can generate a Start condition
within minimum hold time of the Start condition. In these situations, an arbitration scheme occurs on the
SDA line, while SCL is high. During arbitration, the first of the competing master devices to place 1 (high)
on SDA while another master transmits 0 (low) switches off its data output stage, and retires until the bus
is idle again.
Arbitration can occur over several bits. The first stage of arbitration is a comparison of address bits; if both
masters are trying to address the same device, arbitration continues to the comparison of data bits.
21.3.2 Available Speed Modes
The I
2
C bus can run in either standard mode (100 kbps) or fast mode (400 kbps). The selected mode
should match the speed of the other I
2
C devices on the bus.
21.3.2.1 Standard and Fast Modes
Standard and fast modes are selected using a value in the I
2
C Master Timer Period [I2C_MTPR] register
that results in an SCL frequency of 100 kbps for standard mode, or 400 kbps for fast mode.
The I
2
C clock rate is determined by the parameters CLK_PRD, TIMER_PRD, SCL_LP, and SCL_HP
where:
CLK_PRD is the system clock period.
TIMER_PRD is the programmed value in the [I2C_MTPR] register.
SCL_LP is the low phase of SCL (fixed at 6).
SCL_HP is the high phase of SCL (fixed at 4).
The I
2
C clock period is calculated as follows:
SCL_PERIOD = 2 x (1 + TIMER_PRD) x (SCL_LP + SCL_HP) x CLK_PRD
For example:
CLK_PRD = 50ns
TIMER_PRD = 2
SCL_LP = 6
SCL_HP = 4
yields a SCL frequency of:
1/SCL_PERIOD = 333 kHz
lists examples of the timer periods used to generate both standard and fast-mode SCL
frequencies, based on various system clock frequencies.
Table 21-1. Examples of I
2
C Master Timer Period versus Speed Mode
System Clock (MHz)
Timer Period
Standard Mode (kpbs)
Timer Period
Fast Mode (kbps)
4
0x01
100
8
0x03
100
0x01
16
0x07
100
0x01
400
21.3.3 Interrupts
The I
2
C can generate interrupts when the following conditions are observed:
Master transaction completed
Master arbitration lost
Master transaction error
1382
SWCU117A – February 2015 – Revised March 2015
Inter-Integrated Circuit (I
2
C) Interface
Copyright © 2015, Texas Instruments Incorporated