Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN4101 Datasheet(PDF) 10 Page - STMicroelectronics

Part # AN4101
Description  LIN communication with STM8A-DISCOVERY
PDF  21 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN4101 Datasheet(HTML) 10 Page - STMicroelectronics

Back Button AN4101 Datasheet HTML 6Page - STMicroelectronics AN4101 Datasheet HTML 7Page - STMicroelectronics AN4101 Datasheet HTML 8Page - STMicroelectronics AN4101 Datasheet HTML 9Page - STMicroelectronics AN4101 Datasheet HTML 10Page - STMicroelectronics AN4101 Datasheet HTML 11Page - STMicroelectronics AN4101 Datasheet HTML 12Page - STMicroelectronics AN4101 Datasheet HTML 13Page - STMicroelectronics AN4101 Datasheet HTML 14Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 10 / 21 page
background image
Implementing a LIN slave node with STM8AF board
AN4101
10/21
Doc ID 23127 Rev 1
5
Implementing a LIN slave node with STM8AF board
5.1
STM8AF microcontroller LINUART features for LIN slave
LINUART supports autonomous handling of LIN headers. The software is notified of header
reception through a dedicated flag, LHDF. This means that a single interrupt occurs only
when the entire header is received, including the Break, the Synch Field and the Identifier
Field.
LINUART implements a mute mode, allowing the software to remain quiet without
generating any interrupts until reception of the next header. This is very useful for filtering
frames for which the STM8AF is neither publisher nor subscriber. All data bytes of the frame
response will thus be ignored by the LINUART, and will not generate any interrupts.
The automatic resynchronization feature allows a LIN slave to be built with the STM8AF
microcontroller, without the need for an external crystal, oscillator or resonator. The
LINUART can synchronize on the Synch Field of each received header, and automatically
adjusts the baudrate prescaler in order to receive and send the rest of the frame with the
right frequency tolerance, whatever the frequency deviation of the embedded internal RC
oscillator (HSI) may be.
If one of the following errors is detected during the header reception, the software is notified
through the LHE flag:
●
resynchronization error, if the deviation is greater than 14%
●
identifier error (framing error or parity error)
●
break delimiter error, if the delimiter is too short
●
header timeout, if the LIN header is longer than the T_HEADER_MAX defined in the
LIN standard
In order to enhance system robustness, the LINUART can detect a Break at any time, even
while receiving a data byte, and resynchronizes upon detecting the Break.
5.2
Software algorithm
The software algorithm described below is NOT implemented in the demonstration software
of the STM8A-DISCOVERY. Refer to AN4178 to use another piece of demonstration
software for the STM8A-DISCOVERY running the STM8AF board as a LIN slave.
Note:
The demonstration described in AN4178 is based on two STM8AF boards connected
together: one a LIN master, and the other a LIN slave.
5.2.1
LIN state machine
The LIN task is called regularly by the main routine. This task is a basic LIN slave driver that
implements a state machine with the following states:
●
Idle
●
Identifier
●
DataReception
●
DataTransmission



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com