48.5.5 I2C Master
I2C master mode can be supported using two Timers, two Shifters and two Pins. One
timer is used to generate the SCL output and one timer is used to control the shifters. The
two shifters are used to transmit and receive for every word, when receiving the
transmitter must transmit 0xFF to tristate the output. FlexIO inserts a stop bit after every
word to generate/verify the ACK/NACK. FlexIO waits for the first write to the transmit
data buffer before enabling SCL generation. Data transfers can be supported using the
DMA controller and the shifter error flag will set on transmit underrun or receive
overflow.
The first timer generates the bit clock for the entire packet (START to Repeated START/
STOP), so the compare register needs to be programmed with the total number of clock
edges in the packet (minus one). The timer supports clock stretching using the reset
counter when pin equal to output (although this increases both the clock high and clock
low periods by at least 1 FlexIO clock cycle each). The second timer uses the SCL input
pin to control the transmit/receive shift registers, this enforces an SDA data hold time by
an extra 2 FlexIO clock cycles.
Both the transmit and receive shifters need to be serviced for each word in the transfer,
the transmit shifter must transmit 0xFF when receiving and the receive shifter returns the
data actually present on the SDA pin. The transmit shifter will load 1 additional word on
the last falling edge of SCL pin, this word should be 0x00 if generating a STOP condition
or 0xFF if generating a repeated START condition. During the last word of a master-
receiver transfer, the transmit SSTOP bit should be set by software to generate a NACK.
The receive shift register will assert an error interrupt if a NACK is detected, but software
is responsible for generating the STOP or repeated START condition. If a NACK is
detected during master-transmit, the interrupt routine should immediately write the
transmit shifter register with 0x00 (if generating STOP) or 0xFF (if generating repeated
START). Software should then wait for the next rising edge on SCL and then disable
both timers. The transmit shifter should then be disabled after waiting the setup delay for
a repeated START or STOP condition.
Due to synchronization delays, the data valid time for the transmit output is 2 FlexIO
clock cycles, so the maximum baud rate is divide by 6 of the FlexIO clock frequency.
The I2C master data valid is delayed 2 cycles because the clock output is passed through
a synchronizer before clocking the transmit/receive shifter (to guarantee some SDA hold
time). Since the SCL output is synchronous with FlexIO clock, the synchronization delay
is 1 cycle and then 1 cycle to generate the output.
Application Information
MWCT101xS Series Reference Manual, Rev. 3, 07/2019
1558
NXP Semiconductors
Содержание MWCT101 S Series
Страница 2: ...MWCT101xS Series Reference Manual Rev 3 07 2019 2 NXP Semiconductors...
Страница 42: ...MWCT101xS Series Reference Manual Rev 3 07 2019 42 NXP Semiconductors...
Страница 50: ...Conventions MWCT101xS Series Reference Manual Rev 3 07 2019 50 NXP Semiconductors...
Страница 70: ...Aliased bit band regions MWCT101xS Series Reference Manual Rev 3 07 2019 70 NXP Semiconductors...
Страница 78: ...Pinout diagrams MWCT101xS Series Reference Manual Rev 3 07 2019 78 NXP Semiconductors...
Страница 96: ...WCT101xS safety concept MWCT101xS Series Reference Manual Rev 3 07 2019 96 NXP Semiconductors...
Страница 130: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 130 NXP Semiconductors...
Страница 200: ...Initialization application information MWCT101xS Series Reference Manual Rev 3 07 2019 200 NXP Semiconductors...
Страница 284: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 284 NXP Semiconductors...
Страница 430: ...Functional Description MWCT101xS Series Reference Manual Rev 3 07 2019 430 NXP Semiconductors...
Страница 472: ...Application Information MWCT101xS Series Reference Manual Rev 3 07 2019 472 NXP Semiconductors...
Страница 508: ...Reset memory map and register descriptions MWCT101xS Series Reference Manual Rev 3 07 2019 508 NXP Semiconductors...
Страница 528: ...Module clocks MWCT101xS Series Reference Manual Rev 3 07 2019 528 NXP Semiconductors...
Страница 634: ...SRAM configuration MWCT101xS Series Reference Manual Rev 3 07 2019 634 NXP Semiconductors...
Страница 696: ...Initialization and application information MWCT101xS Series Reference Manual Rev 3 07 2019 696 NXP Semiconductors...
Страница 818: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 818 NXP Semiconductors...
Страница 960: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 960 NXP Semiconductors...
Страница 970: ...Memory Map and Register Definition MWCT101xS Series Reference Manual Rev 3 07 2019 970 NXP Semiconductors...
Страница 992: ...ADC calibration scheme MWCT101xS Series Reference Manual Rev 3 07 2019 992 NXP Semiconductors...
Страница 1118: ...Application information MWCT101xS Series Reference Manual Rev 3 07 2019 1118 NXP Semiconductors...
Страница 1294: ...Initialization Procedure MWCT101xS Series Reference Manual Rev 3 07 2019 1294 NXP Semiconductors...
Страница 1348: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 1348 NXP Semiconductors...
Страница 1366: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 1366 NXP Semiconductors...
Страница 1514: ...Functional description MWCT101xS Series Reference Manual Rev 3 07 2019 1514 NXP Semiconductors...
Страница 1726: ...Debug and security MWCT101xS Series Reference Manual Rev 3 07 2019 1726 NXP Semiconductors...
Страница 1740: ...Initialization application information MWCT101xS Series Reference Manual Rev 3 07 2019 1740 NXP Semiconductors...
Страница 1760: ...MWCT101xS Series Reference Manual Rev 3 07 2019 1760 NXP Semiconductors...