![NXP Semiconductors MPC5605BK Скачать руководство пользователя страница 415](http://html.mh-extra.com/html/nxp-semiconductors/mpc5605bk/mpc5605bk_reference-manual_1721852415.webp)
Chapter 22 Inter-Integrated Circuit Bus Controller Module (I
2
C)
MPC5606BK Microcontroller Reference Manual, Rev. 2
Freescale Semiconductor
415
22.5.2.2
Interrupt description
There are five types of internal interrupts in the I
2
C. The interrupt service routine can determine the
interrupt type by reading the Status Register.
The I
2
C interrupt can be generated on
•
Arbitration Lost condition (IBAL bit set)
•
Byte Transfer condition (TCF bit set and DMAEN bit not set)
•
Address Detect condition (IAAS bit set)
•
No Acknowledge from slave received when expected
•
Bus Going Idle (IBB bit not set)
The I
2
C interrupt is enabled by the IBIE bit in the I
2
C Control Register. It must be cleared by writing 1 to
the IBIF bit in the interrupt service routine. The Bus Going Idle interrupt needs to be additionally enabled
by the BIIE bit in the IBIC register.
22.6
Initialization/application information
22.6.1
I
2
C programming examples
22.6.1.1
Initialization sequence
Reset will put the I
2
C Bus Control Register to its default state. Before the interface can be used to transfer
serial data, an initialization procedure must be carried out, as follows:
1. Update the Frequency Divider Register (IBFD) and select the required division ratio to obtain SCL
frequency from system clock.
2. Update the I
2
C Bus Address Register (IBAD) to define its slave address.
3. Clear the IBCR[MDIS] field to enable the I
2
C interface system.
4. Modify the bits of the I
2
C Bus Control Register (IBCR) to select Master/Slave mode,
Transmit/Receive mode and interrupt enable or not. Optionally also modify the bits of the I
2
C Bus
Interrupt Configuration Register (IBIC) to further refine the interrupt behavior.
22.6.1.2
Generation of START
After completion of the initialization procedure, serial data can be transmitted by selecting the 'master
transmitter' mode. If the device is connected to a multi-master bus system, the state of the I
2
C Bus Busy
bit (IBB) must be tested to check whether the serial bus is free.
If the bus is free (IBB=0), the start condition and the first byte (the slave address) can be sent. The data
written to the data register comprises the slave calling address and the LSB, which is set to indicate the
direction of transfer required from the slave.
The bus free time (i.e., the time between a STOP condition and the following START condition) is built
into the hardware that generates the START cycle. Depending on the relative frequencies of the system
Содержание MPC5605BK
Страница 2: ...This page is intentionally left blank...
Страница 20: ...MPC5606BK Microcontroller Reference Manual Rev 2 20 Freescale Semiconductor...
Страница 103: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 103 Clocks and power...
Страница 104: ...MPC5606BK Microcontroller Reference Manual Rev 2 104 Freescale Semiconductor This page is intentionally left blank...
Страница 243: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 243 Core platform modules...
Страница 244: ...MPC5606BK Microcontroller Reference Manual Rev 2 244 Freescale Semiconductor This page is intentionally left blank...
Страница 395: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 395 Communication modules...
Страница 396: ...MPC5606BK Microcontroller Reference Manual Rev 2 396 Freescale Semiconductor This page is intentionally left blank...
Страница 548: ...Chapter 24 LIN Controller LINFlexD MPC5606BK Microcontroller Reference Manual Rev 2 548 Freescale Semiconductor...
Страница 645: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 643 Timers...
Страница 646: ...MPC5606BK Microcontroller Reference Manual Rev 2 644 Freescale Semiconductor This page is intentionally left blank...
Страница 715: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 713 ADC system...
Страница 716: ...MPC5606BK Microcontroller Reference Manual Rev 2 714 Freescale Semiconductor This page is intentionally left blank...
Страница 787: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 787 Memory...
Страница 788: ...MPC5606BK Microcontroller Reference Manual Rev 2 788 Freescale Semiconductor This page is intentionally left blank...
Страница 893: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 893 Integrity...
Страница 894: ...MPC5606BK Microcontroller Reference Manual Rev 2 894 Freescale Semiconductor This page is intentionally left blank...
Страница 943: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 943 Debug...
Страница 944: ...MPC5606BK Microcontroller Reference Manual Rev 2 944 Freescale Semiconductor This page is intentionally left blank...