LIN Bus Controller
The DLIN is soft core of the Local Interconnect Network (LIN) bus controller provides single master with multiple slaves communication concept.
The LIN is a serial communication protocol designed primarity for use in automotive application. Compared to CAN, LIN is a slower but is simplier and more cost efective. It used in applications where events happen in “human time”. It is ideal for communication in intelligent sensors and actuators where the bandwidth and versatility of CAN is not required.
DLIN core provides an interface between a microprocessor/microcontroller and LIN bus. It can work as master or slave LIN node de-pending on work mode determined by microprocessor/microcontroller. The DLIN controller supports transmission speed between 1kb/s and 20kb/s and can transmit and receive LIN messages compatible to LIN 1.3 and LIN 2.1. Reported status information includes the type and condition of transfer operations being performed by the DLIN, as well as wide range of LIN error conditions (overrun, framing, parity, timeout). The DLIN includes programmable timer allows detection of timeout and synchronization error. The core is described at RTL level allowing target use in FPGA andASIC technologies.

LIN (Local Interconnect Network) is a serial communication protocol, which was created to provides a cost efficient bus communication. The LIN standard is developed by LIN consortium ( http://www.lin-subbus.org). It includes the specification of the transmission medium, the interface between development tools, the transmission protocol, and the interfaces for software programming. LIN has been created to decrease costs of automotive networks, and replace more expensive CAN in simple application (sensors or actuators). The LIN device can be implemented as a master or as a slave node.
Transmission is initiated by Master Node, which sends the data frame to Slaves Nodes ( maximum 15) throat one wire bus.

|

|
- Conforms with LIN 2.1 and LIN 1.3 specification.
- Automatic LIN Header handling
- Automatic Re-synchronization
- Data rate between 1Kbit/s and 20 Kbit/s
- Master and Slave work mode
- Time-out detection
- Extended error detection
- “Break-in-data” support
- Available system interface wrappers:
- AMBA - APB Bus
- Altera Avalon Bus
- Xilinx OPB Bus
|
- Automotive, industrial
- Embedded communication systems
|

 clk
 rst
 addr (2:0)
 datai (7:0)
 rd
 wr
 cs
datao (7:0) 
 rxd
txd 
irq 

| Pin | Type | Description |
| clk | input | Global clock |
| rst | input | Global reset |
| addr (2:0) | input | Address bus |
| datai (7:0) | input | Input data bus |
| rd | input | Read data strobe |
| wr | input | Write data strobe |
| cs | input | Chip select |
| rxd | input | LIN receive data |
| datao (7:0) | output | Output data bus |
| txd | output | LIN transmit data |
| irq | output | Interrupt signal |

| Host Controller Interface |
 addr (2:0)
 datai (7:0)
 datao (7:0)
 rd
 wr
 cs
| Receive Controller & Shift Register |
 rxd
| Transmitter Controller & Shift Register |
 txd
irq 
clk 
rst 

Control State UnitControl State unit is responsible for receiving frame from LIN bus. Provides necessery function for data reception, frame timming and error checking.
Host Controller InterfaceAccepts inputs from the system bus and generates control signals for other DLIN functionl blocks. Address bus ADDR(2:0) selects one of register to be read from/written into. Active level of RD, WR and CS can be configurable. RD and WR are ignored unless the DLIN has been selected by activing CS input.
Baud Rate GeneratorThe DLIN contains a programmable 15 bit baud generator which divides clock input by a divisor in the range beteen 1 and (215-1). The output frequency of the baud generator is 32 x the baud rate. Two registers, called divisor latches DLL and DLH, store the divisor in the 15-bit binary format.
Receive Controller & Shift RegisterReceive Controller is responsible for receiving frame from LIN bus. Provides necessery function for data reception, frame timming and error checking.
Data BufferStores the receive or transmit data
Transmitter Controller & Shift RegisterPerforms transmit management function, sends data by LIN bus.
Interrupt ControllerInterrupt controller works with transmitter, receiver and control unit to indicate DLIN transmission events or errors. User can configure which events may generates interrupt by enabled or disabled corresponding bits in Interrupt Enable regis-ter. When interrupt was generated host can find information about reason by reading LIN Status Register.

Each core has been tested in variety of FPGA and ASIC technologies. Its implementation's results are summarized below.
| Implementation | Speed grade | Utilized Area [LC] | Frequency [MHz] |
| APEX20KC | -7 | 730 | 115 |
| CYCLONE | -6 | 674 | 159 |
| CYCLONE-II | -6 | 670 | 207 |
| STRATIX | -5 | 674 | 147 |
| STRATIX-II | -3 | 467 | 266 |
| STRATIX GX | -5 | 462 | 184 |
DLIN implementation results for ALTERA devices. All features have been included.
| Implementation | Speed grade | Utilized Area [Slices] | Frequency [MHz] |
| SPARTAN-IIE | -7 | 359 | 94 |
| SPARTAN-III | -5 | 346 | 116 |
| SPARTAN-IIIE | -4 | 347 | 115 |
| VIRTEX-E | -8 | 361 | 105 |
| VIRTEX-II | -6 | 357 | 159 |
| VIRTEX-II pro | -7 | 346 | 168 |
| VIRTEX-IV | -12 | 365 | 196 |
DLIN implementation results for XILINX devices. All features have been included.
| Implementation | Speed grade | Utilized Area [LUT/PFU] | Frequency [MHz] |
| SC | -7 | 653/317 | 270 |
| ECP2 | -7 | 555/314 | 170 |
| ECP2M | -7 | 555/314 | 152 |
| XP2 | -7 | 555/314 | 128 |
| XP | -5 | 425/316 | 85 |
| ECP | -5 | 578/316 | 95 |
| EC | -5 | 578/316 | 90 |
DLIN implementation results for LATTICE devices. All features have been included.
| Implementation | Speed grade | Utilized Area [Tiles] | Frequency [MHz] |
| Axcelerator | -2 | 1135 | 107 |
| ProAsic3 | -2 | 1652 | 102 |
| ProAsic3E | -2 | 1660 | 99 |
| Fusion | -2 | 1660 | 99 |
DLIN implementation results for ACTEL devices. All features have been included.
|