Closing the communicationMethod 1: วิธีนี้สำหรับกรณีเมื่อ the I2C ถูกใช้พร้อมด้วย interrupts ที่มี the highest priority ใน the application
The master ส่ง a NACK สำหรับ the last byte ที่รับจาก the slave. หลังจากการรับ NACK นี้, the slave ปลดปล่อย the control of the SCL and SDA lines. จากนั้น the master สามารถส่ง a Stop/Restart condition
1. เพื่อสร้าง the nonacknowledge pulse หลังจาก the last received data byte, the ACK bit ต้องถูกเคลียร์เพียงแค่หลังจาก
การอ่าน the second last data byte (หลังจากที่สองก่อนสุดท้าย RxNE
event).
2. เพื่อสร้าง the Stop/Restart condition, software ต้องเซ็ต the STOP/START bit เพียงแค่หลังจากการอ่าน the second last
data byte (after the second last RxNE event).
3. ในกรณี a single byte ต้องถูกรับ, the Acknowledge ปิดการใช้งานและ the Stop condition generation ถูกทำเพียงแค่หลัง
จาก EV6 (ใน EV6_1, เพียงแค่หลังจาก ADDR ถูก cleared).
หลังจาก the Stop condition generation, the interface กลับไปยัง slave mode โดยอัตโนมัติ (MSL bit cleared).

1. ถ้า a single byte ถูกรับ, มันคือ NA.
2. The EV5, EV6 and EV9 events ขึง SCL low จนกระทั่ง the end of the corresponding software sequence.
3. The EV7 software sequence ต้องเสร็จสมบูรณ์ก่อน the end of the current byte transfer. ในกรณี EV7 software
sequence ไม่สามารถถูกจัดการก่อน the current byte end of transfer, ขอแนะนำให้ใช้ BTF แทน RXNE ที่มีข้อเสียของการช้า
ลง the communication.
4. The EV6_1 or EV7_1 software sequence ต้องเสร็จสมบูรณ์ก่อน the ACK pulse of the current byte transfer.