English
Language : 

C8051F52X_12 Datasheet, PDF (165/221 Pages) Silicon Laboratories – 8/4/2 kB ISP Flash MCU Family
C8051F52x/F53x
17.1. Software Interface with the LIN Peripheral
The selection of the mode (Master or Slave) and the automatic baud rate feature are done though the LIN0
Control Mode (LIN0CF) register. The other LIN registers are accessed indirectly through the two SFRs
LIN0 Address (LINADDR) and LIN0 Data (LINDATA). The LINADDR register selects which LIN register is
targeted by reads/writes of the LINDATA register. The full list of indirectly-accessible LIN register is given in
Table 17.4 on page 174.
17.2. LIN Interface Setup and Operation
The hardware based LIN peripheral allows for the implementation of both Master and Slave nodes with
minimal firmware overhead and complete control of the interface status while allowing for interrupt and
polled mode operation.
The first step to use the peripheral is to define the basic characteristics of the node:
 Mode—Master or Slave
 Baud Rate—Either defined manually or using the autobaud feature (slave mode only).
 Checksum Type—Select between classic or enhanced checksum, both of which are implemented in
hardware.
17.2.1. Mode Definition
Following the LIN specification, the peripheral implements both the Slave and Master operating modes in
hardware. The mode is configured using the MODE bit (LIN0CF.6).
17.2.2. Baud Rate Options: Manual or Autobaud
The LIN peripheral can be selected to have its baud rate calculated manually or automatically. A master
node must always have its baud rate set manually, but slave nodes can choose between a manual or auto-
matic setup. The configuration is selected using the ABAUD bit (LIN0CF.5).
Both the manual and automatic baud rate configurations require additional setup. The following sections
explain the different options available and their relation with the baud rate, along with the steps necessary
to achieve the required baud rate.
17.2.3. Baud Rate Calculations—Manual Mode
The baud rate used by the peripheral is a function of the System Clock (SYSCLK) and the bit-timing Reg-
isters according to the following equation:
baud_rate
=
-----------------------------------------S---Y----S---C-----L---K-------------------------------------------
2prescaler + 1  divider  multiplier + 1
The prescaler, divider and multiplier factors are part of the LIN0DIV and LIN0MUL registers and can
assume values in the following range:
Rev. 1.4
165