27.3.8 LIN (local interconnection network) modeThe LIN mode ถูกเลือกโดยการเซ็ต the LINEN bit in the USART_CR2 register. In LIN mode, บิตต่อไปนี้ต้องถูกเก็บที่เคลียร์:
• STOP[1:0], CLKEN in the USART_CR2 register
• SCEN, HDSEL and IREN in the USART_CR3 register.
LIN transmissionขั้นตอนเดียวกันที่อธิบายไว้ใน Section 27.3.2 ต้องถูกประยุกต์ใช้สำหรับ LIN Master transmission มากกว่าสำหรับ normal USART transmission มีข้อแตกต่างดังนี้:
• เคลียร์ the M bit เพื่อกำหนดค่า 8-bit word length.
• เซ็ต the LINEN bit เพื่อเข้าสู่ LIN mode. ในกรณีนี้, เซ็ต the SBK bit ส่ง 13 ‘0’ bits เป็น a break character. หลังจากนั้น a
bit ของค่า ‘1’ ถูกส่งเพื่อยอมให้ the next start detection.
LIN receptionA break detection circuit มีให้ใช้ใน the USART. The detection เป็นอิสระโดยสิ้นเชิงจาก the normal USART receiver. A break สามารถถูกตรวจพบเมื่อไหร่ก็ตามที่มันเกิดขึ้น, ในระหว่าง idle state หรือในระหว่าง a frame.
เมื่อ the receiver ถูกเปิดการใช้งาน (RE=1 in USART_CR1), the circuit มองไปที่ the RX input สำหรับ a start signal. วิธีสำหรับการตรวจพบ start bits คือวิธีเดียวกันเมื่อค้นหา break characters หรือ data. หลังจาก a start bit ถูกตรวจพบแล้ว, the circuit จะสุ่ม the next bits เหมือนกันเป๊ะสำหรับ the data (on the 8th, 9th and 10th samples). ถ้า 10 (เมื่อ the LBDL = 0 in
USART_CR2) หรือ 11 (เมื่อ LBDL=1 in USART_CR2) บิตซึ่งตามกันมาถูกตรวจพบว่าเป็น ‘0’, และถูกตามด้วย a delimiter character, the LBD flag ถูก set in USART_SR. ถ้า the LBDIE bit=1, an interrupt ถูกสร้างขึ้น. ก่อนที่จะตรวจสอบความถูกต้อง the break, the delimiter ถูกเช็คสำหรับดังมันบ่งชี้ว่า the RX line กลับคืนสู่ a high level.
ถ้า a ‘1’ ถูกสุ่มก่อน the 10 or 11 เกิดขึ้น, the break detection circuit ยกเลิก the current detection และค้นหาสำหรับ a start bit อีกครั้ง.
ถ้า the LIN mode ถูก disabled (LINEN=0), the receiver ทำงานต่อไปดั่ง normal USART, โดยปราศจากการคำนึงถึง the break detection.
ถ้า the LIN mode ถูก enabled (LINEN=1), ทันทีที่ a framing error เกิดขึ้น (เช่น stop bit ถูกตรวจพบที่ ‘0’, ซึ่งจะเป็นกรณีของ break frame ใดๆ), the receiver หยุดจนกระทั่ง the break detection circuit รับอย่างใดอย่างหนึ่ง a ‘1’, ถ้า the break word ไม่เสร็จสมบูรณ์, หรือ a delimiter character ถ้า a break ถูกตรวจพบแล้ว.
The behavior of the break detector state machine และ the break flag ถูกแสดงบน the Figure 287. Examples of break frames ถูกให้ไว้บน Figure 288.

