Implementing a Low Speed, Low Cost
Communications Protocol
by Fred Eady
(that you’ve probably never heard of) — Part 2
The word “vehicle” is used at least eight times within the LIN Specification
document. I searched the LIN document for the word “robot” and received
zero hits. Thus, it’s rather obvious that the LIN Specification is definitely
aimed at use in automobiles. Fortunately, the LIN protocol is a very well
thought out and its disciplines lend themselves well to non-automotive
robotic things. LIN is not designed to turn motor shafts, service sensors,
or make decisions. LIN is a communications conduit that carries the
commands to turn motor shafts and transports the data gathered from
sensors. Our goal is to assemble a set of software routines that will take
advantage of the LIN protocol. How you put those routines to use is up to you.
The LIN Hardware
All of the master and slave LIN functions we create will
be based on the hardware design depicted in Schematic 1.
The LIN node hardware grinning at us in Photo 1 can be
configured as a LIN master (master configuration jumper
present at JP1) or LIN slave node.
A Microchip LIN Serial Analyzer will be used to
complement our LIN node hardware. The LIN Serial
Analyzer shown in Photo 2 can also be configured as a
master or slave node. The LIN Serial Analyzer will be used
PHOTO 1. This LIN hardware is battle tested. We’ve already
used this hardware to successfully transmit a LIN frame. Note
that the master configuration jumper (JP1) is not positioned in
the master mode position which configures this node as an
official LIN slave.
to assist us in writing our LIN drivers as it can be
programmed to send master task messages as a master
node or respond to master task messages as a slave node.
LIN 101
A typical LIN bus supports a single master node and
multiple slave nodes. The collection of a LIN master and
slaves along with the physical bus wire is called a LIN
cluster. LIN nodes are based on hardware equipped with a
UART interface that supports standard RS-232 principles
PHOTO 2. The LIN Serial Analyzer is supported by a Windows
application which enables LIN message logging, master mode
messaging, and slave mode response. You can develop your
LIN-based applications without this tool, but it sure came in
handy while writing the code for this article.
42 SERVO 07.2009