Interface Products Design Guide Using CAN, LIN and Infrared Connectivity

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Analog and Interface Product Solutions

Interface Products Design Guide


Using CAN, LIN and Infrared Connectivity

Design ideas in this guide are based on many of the interface devices available from Microchip Technology. A complete device list and
corresponding data sheets for these products can be found at www.microchip.com
Stand-alone CAN Controller
MCP2515
CAN Transceiver
MCP2551
CAN I/O Expander
MCP250xx

LIN Transceiver
MCP201
General Purpose I/O Expander
MCP23016
Microcontrollers
PIC12F675
PIC18F6680

IrDA Encoder/Decoder
MCP2120
IrDA Protocol Handler
MCP2140
MCP215x

Controller Area Network (CAN)

CAN Design Example: Simple Sensor Node


The CAN bus (Controller Area Network) protocol was
designed to be a high-speed, reliable communication
protocol for command and control network applications.
Microchip offers a complete line of products to meet the
needs of high-performance embedded applications using
the CAN protocol, including 8- and 16-bit microcontrollers
(MCUs) with integrated CAN, stand-alone CAN controllers,
CAN I/O expanders, and CAN transceivers.
As CAN continues to grow and proliferate into other
markets, the need to add CAN to simple sensor circuits
increases. In some applications, a simple CAN sensor
node can be cost prohibitive due to the higher cost of
using a microcontroller with integrated CAN modules.
Often the microcontrollers with integrated CAN have

extra peripherals, program memory, RAM, etc. which the


simple sensor application does not need.
In addition to MCUs with integrated CAN, Microchip
offers a low cost stand-alone CAN controller with SPI
interface (MCP2515) which can be paired up with the
desired MCU to create an optimized CAN node. The
designer does not have to settle for the peripherals
offered by an MCU with integrated CAN, but rather the
designer can choose the MCU which best matches the
application.
Additionally, the four pins used by the MCU for SPI can
be regained by using the general purpose inputs and outputs on the MCP2515.
The schematic shown below represents a very simple,
low cost CAN solution.

Simple Sensor Node using MCP2515 Stand-alone CAN Controller

MCP2515 Stand-alone CAN Controller Features:


n

Implements CAN V2.0B at 1Mb/s

n
n
n
n
n
n

Masks and filters to filter out unwanted messages


Two receive buffers
Three transmit buffers
High speed SPI interface (10 MHz)
Low voltage operation (2.7 V 5.5 V)
One shot mode to ensure a message transmission
is only attempted once
Start-of-frame (SOF) signal pin to detect CAN
start-of-frame

Product specifications can be found on page 10


2 Interface Products Design Guide

n
n
n
n
n
n

Data byte filtering of the first two data bytes


Clock out pin with prescaler can be used as a clock
source
Interrupt output pin with selectable interrupt enables
Two buffer full pins (can be used as general
purpose outputs)
Three request-to-send pins (can be used as general
purpose inputs)
18-pin PDIP and SOIC, 20-pin TSSOP

Controller Area Network (CAN)


CAN Design Example: Adding CAN to Existing Applications
Existing applications that require the addition of CAN
will find that the MCP2515 can be used to add CAN
connectivity to any application ranging from low-end

simple sensor applications, to high-end DSP, 32-bit


MCU, ASIC, etc.

The diagram shows CAN added to a high-end application, as many high-end processors do not have embedded
CAN peripherals.

Dual CAN Node

The MCP2515 can be used to easily add dual CAN capabilities for a given node.

Product specifications can be found on page 10


Interface Products Design Guide 3

Controller Area Network (CAN)


CAN Design Example: Simple Sensor Network using CAN I/O Expander
MCP250xx CAN I/O Expander
The MCP250xx devices operate as I/O expanders
for a CAN system. These devices feature several
peripherals including eight digital I/O, four 10-bit A/D
converters, and two 10-bit PWM channels. In addition,
the MCP250xx can automatically send messages when
an input changes state, including when an analog channel exceeds a preset threshold. The device can also
be configured to send A/D and digital I/O messages at
regular intervals.
Three bits (plus the RTR bit or one more ID bit for
direction) are reserved in the identifier/arbitration field of

the CAN message to communicate with the MCP250xx.


This allows a master CAN node to communicate/control
the CAN I/O Expanders via the CAN bus.
Simple Sensor Network
The MCP250xx is ideal for simple, low cost sensor
networks. Particularly where the higher layers are
proprietary so the system designer can maximize the
MCP250xx features. The diagram below shows a fournode sensor network using only one MCU.

MCP250xx CAN I/O Expander Features:


n
n
n
n
n
n
n

Implements CAN 2.0 B


Masks and filters to filter out unwanted messages
Two receive buffers
Three auto transmit buffers for sending messages
automatically
Non-volatile memory for user configuration
Configuration can be modified via the CAN bus
Message scheduling capability
Sends GPIO and analog data

Product specifications can be found on page 10


4 Interface Products Design Guide

n
n
n
n
n

Eight general purpose I/O pins individually selectable as inputs or outputs


Individually selectable transmit-on-change for
each input
Four 10-bit analog channels with programmable
conversion clock and Vref sources
Individually selectable threshold detection
Two 10-bit PWM outputs
Low voltage operation (2.7 V 5.5 V)
14-pin PDIP and SOIC

Controller Area Network (CAN)


Design Example: Basic Connections using CAN Transceiver
MCP2551 CAN Transceiver
The MCP2551 is a high speed CAN transceiver which
serves as an interface between the CAN bus and the
CAN controller. The MCP2551 implements the ISO
11898-2 physical layer requirements which is by far the
most common physical layer for CAN.
The MCP2551 converts between logic levels generated
by the CAN controller and differential signal levels on

MCP2551 CAN Transceiver Features:

Implements ISO 11898-2 physical layer


requirements
n Suitable for 12 V and 24 V systems
n 40 V short circuit protection on the bus pins
Automatic thermal shutdown protection
n 250 V transient protection on the bus pins
n

the bus. The differential signal is less prone to electrical


disturbances. The MCP2551 protects the CAN controller
from electrical anomalies such as voltage spikes, short
circuits, and other electrical transients on the bus.
The diagram below shows the basic connections for
connecting the MCP2551.

n
n
n
n

Ground fault (permanent dominant) detection on the


transmit input pin
Keeps faulty transmitters from bringing down
the bus due to a permanent dominant condition
Externally controlled slope on the bus pins to
reduce RFI emissions
Power on reset and brown out detection
Unpowered nodes will not disturb the bus
Up to 112 nodes can be connected

Product specifications can be found on page 10


Interface Products Design Guide 5

Local Interconnect Network (LIN)


Example Designs: Typical Applications using LIN Transceiver
MCP201 LIN Transceiver
LIN is a low speed network (20 kbaud) intended for
automotive and industrial applications where the speed
and robustness of CAN is not needed and where low
cost is essential. The MCP201 is a LIN transceiver

which provides the interface between the LIN bus and


the LIN controller. The MCP201 converts between
CMOS/TTL levels and LIN levels.
The diagram shows a typical implementation of a LIN
node using the MCP201.

Typical MCP201 Application

Typical LIN Network Configuration

MCP201 LIN Transceiver Features:


n
n
n
n

Supports LIN rates up to 20 kbaud


40 V load dump protected
Operates from 6 V to 18 V
Robust LIN bus pin
Protected against ground shorts
Protected against loss of ground
Automatic thermal shutdown
High current drive (40 mA to 200 mA)

6 Interface Products Design Guide

n
n

Built in voltage regulator (LDO)


5 V output (5 % tolerance)
50 mA maximum output current
Internal thermal overload protection
Internal short circuit protection

Infrared Communications
Example Designs: Infrared Data Applications
MCP2150 and MCP2155 IrDA Protocol
Stack Controller
The MCP215x devices allow an embedded systems
designer to interface to popular IrDA standard devices
(such as PDAs and PCs) using the embedded systems
host controller UART and some I/O pins.
The MCP215x implements the IrDA standard stack.
At the application layer, the IrCOMM protocol (9-wire

Note 1:
Note 2:

n
n

n
n

The diagram below shows a typical system block


diagram.

The CD and RI signals have different directions (and functions) between the MCP2150 and the MCP2155.
Please refer to MCP2150 Data Sheet (DS21655) or MCP2155 Data Sheet (DS21690) for the function of the Host
UART signals (TX, RX, RTS, CTS, DSR, CD, and RI). Not all signals may be required in your application (see AN858)

MCP215x Features:
n

cooked service class) is the IrDA standard replacement for the serial cable. Thus the embedded systems
designer will interface to the MCP215x as if it was a
serial cable. The MCP215x does not implement the IR
transceiver of the physical layer.

Implements the IrDA standard including:


IrLAP
IrLMP
IAS
TinyTP
IrCOMM (9-wire cooked service class)
UART to IrDA standard encoder/decoder
Interfaces with UARTs and infrared transceivers
UART support to Data Terminal Equipment (DTE)
interfaces (MCP2150) or Data Communication
Equipment (DCE) interfaces (MCP2155)
Supports 1.63 s bit width for transmit/receive
Independent UART and IR baud rates

n
n
n
n

UART baud rates:


906 kbaud
19.2 kbaud
57.6 kbaud
115.2 kbaud
IrDA baud rates:
906 kbaud
19.2 kbaud
38.4 kbaud
57.6 kbaud
115.2 kbaud
64 byte data packet
Programmable device ID
Operates as a Slave Device
Hardware pin for low power mode

Product specifications can be found on page 10


Interface Products Design Guide 7

IrDA Protocol Stack Controller


Example Designs: Using 9600 Baud IrDA Protocol Stack Controller
MCP2140 IrDA Protocol Stack Controller
MCP2140 has all of the same features as the MCP2150
except:
n Supports discrete IR circuitry instead of integrated
infrared transceivers

n
n
n

Host UART and IR interface fixed at 9600 baud


Fixed device ID
Wake-up on IR detect

The diagram below shows a typical system block


diagram and typical discreet IR transceiver

Note 1: Not all microcontroller I/O pins are required to be connected to the MCP2140.

MCP2120 Infrared Encoder/Decoder


Unlike the MCP2150 and MCP2140 which implement the IrDA stack, the MCP2120 is simply an encoder/decoder. This
allows the application processor to implement all or part of the IrDA stack, or implement a custom protocol using IR.
The diagram below shows a typical system block diagram.

MCP2120 Features:
n
n
n

UART to IrDA encoder/decoder


Supports IrDA physical layer specification (v.1.3)
Interfaces with IrDA compliant transceivers

Product specifications can be found on page 10


8 Interface Products Design Guide

n
n
n

Interfaces to standard UARTs


Operates up to the full IrDA data rate (115.2 kbaud)
-- 312.5 kbaud maximum
Low power mode

General Purpose I/O Expanders


Example Designs: Using General Purpose Parallel I/O Expanders
The MCP23016 provides 16-bit, general purpose
parallel I/O expansion for I2C applications. The
MCP23016 is an ideal solution when additional I/O
are needed for power switches, sensors, push buttons,
LEDs, etc.
The diagram shows a typical use for an MCP23016
GPIO Expander
Typical Application using the MCP23016 GPIO Expander

MCP23016 Features:
n

I2C interface to connect to a microcontroller

n
n

400 kHz max


Three hardware address pins for up to eight
devices on the bus
High current drive for each output
25 mA max
Sixteen individually selectable I/O pins
Interrupt capture register to capture interrupt
conditions on the I/O
Polarity inversion register to configure the polarity
of each input
Interrupt output

n
n
n
n
n
n

Product specifications can be found on page 10


Interface Products Design Guide 9

Interface Products
Selected Product Specifications
See Microchip Product Selector Guide for complete product selection and specifications

Stand-alone Controller Area Network (CAN) Products


Device

Oper. Volt. (V)

Temp. Range (C)

MCP2510 (1)

2.7 to 5.5

-40 to +125

MCP2515

2.7 to 5.5

-40 to +125

MCP25020

2.7 to 5.5

-40 to +125

MCP25025

2.7 to 5.5

-40 to +85

MCP25050

2.7 to 5.5

-40 to +125

MCP25055

2.7 to 5.5

-40 to +85

MCP2551

4.5 to 5.5

-40 to +125

Unique Features
CAN 2.0B Active controller with SPI interface to MCU, 3 transmit
buffers, 2 receive buffers, HW and SW message triggers
MCP2510 pin compatible upgrade with enhanced features including
higher throughput and data byte filtering
CAN 2.0B Active I/O Expander, Configurable I/O, 2 PWM outputs
CAN 2.0B Active I/O Expander, Configurable I/O, 2 PWM outputs,
One-wire CAN option
Mixed-Signal CAN 2.0B Active I/O Expander, Configurable I/O, 4 10bit ADCs, 2 PWM outputs
Mixed-Signal CAN 2.0B Active I/O Expander, Configurable I/O, 4 10bit ADCs, 2 PWM outputs, One-wire CAN option
High-Speed CAN Transceiver (1 Mbps max. CAN bus speed),
ISO11898 compatible, Industry standard pinout

Package
18-Pin PDIP, 18-Pin SOIC,
20-Pin TSSOP
18-Pin PDIP, 18-Pin SOIC,
20-Pin TSSOP
14-Pin PDIP, 14-Pin SOIC
14-Pin PDIP, 14-Pin SOIC
14-Pin PDIP, 14-Pin SOIC
14-Pin PDIP, 14-Pin SOIC
8-Pin PDIP, 8-Pin SOIC

(1) Not recommended for new designs, use MCP2515

INTERFACE Infrared Products

Infrared Products
Min./Max.
Baud Rate
(Kbaud)

Part #

Operating
Voltage (V)

Operating Temp.
Range (C)

MCP2120

2.5 to 5.5

-40 to +85

0/325

MCP2140

2.7 to 5.5

-40 to +85

-/9.6

MCP2150

3.0 to 5.5

-40 to +85

9.6/115.2

MCP2155

3.0 to 5.5

-40 to +85

9.6/115.2

Unique Features

Packages

UART to IR encoder/decoder with both hardware and


software baud rate selection
IrDA protocol handler plus bit encoder/decoder, Fixed baud
rate, Low power, Low cost
IrDA Standard protocol handler plus bit encoder/decoder
on one chip for DTE applications, Programmable device ID
IrDA Standard protocol handler plus bit encoder/decoder
on one chip for DCE applications, Programmable device ID

14-Pin PDIP, 14-Pin SOIC


18-Pin PDIP, 18-Pin SOIC,
20-Pin SSOP
18-Pin PDIP, 18-Pin SOIC,
20-Pin SSOP
18-Pin PDIP, 18-Pin SOIC,
20-Pin SSOP

LIN bus Transceiver


Part #
MCP201

Description
LIN Transceiver with
integrated VREG

Vreg Output
Voltage (V)

Operating
Temperature
Range (C)

4.75 TO 5.25

-40 TO +125

Vreg Output
Current (mA)
50(1)

VCC Range (V)


6.0 to 18(2)

Max Baud
Rate

LIN Specification
Supported

20
Kbaud

Revision 1.2

Packages
8-pin PDIP,
8-pin SOIC

Notes 1: Output current can be increased with external pass transistor.


Note 2: Can withstand 40V load dump.

Serial Peripherals
Part #

MCP23016

Description

16-bit I/O Port Expander

10 Interface Products Design Guide

Operating
Voltage (V)
2.0 to 5.5

Operating
Temperature Range
(C)
-40 to +85

Bus
Type
I2C

Max. Bus
Frequency
(kBits/s)
400

Features
3 H/W address inputs, H/W
interrupt, 25 mA source/sink
capability per I/O

Packages
28-Pin PDIP,
28-Pin SOIC,
28-Pin SSOP

Interface Products
Related Application Notes
Complete Application Note library is available on the Microchip website: www.microchip.com
CAN Communications
AN212: Smart Sensor CAN Node Using the MCP2510 and
PIC16F876. Demonstrates a way to implement a simple input
pressure switch connected to a node board, along with a visual
light source to display the value in terms of brightness. Several
uses for different types of inputs and outputs can be implemented by using the basic techniques from this design.
AN215: A Simple CAN Node Using the MCP2510 and
PIC12C67X. Describes the design, development and implementation of a smart, low cost, stand-alone Controller Area Network
(CAN) node. Combines the 8-pin PIC12C672 with the 18-pin
MCP2510 stand-alone CAN controller to create a fully autonomous CAN node, which supports both time-based and event
driven message transmission.

TB073: Selecting an MCP21XX Device for IrDA Applications.


This document will help you select which MCP21xx family device
is a good fit for your application.
AN923: Using the MCP2120 Developers Board for IR Sniffing.
Discusses the implementation of an IR Sniffer using the
MCP2120 Developers board connect to a PC running a program
call Listen32.
AN756: Using the MCP2120 for Infrared Communications.
Communications A
discussion regarding the encoding/decoding function in the
MCP2120 which is performed as specified in the physical layer
component of the IrDA standard known as the IrPHY.

AN228: A CAN Physical Layer Discussion.


Discussion A discussion of the
many network protocols which are described using the seven
layer Open System Interconnection (OSI) mode.

TB059: Using The MCP2150 Developers Board With The


MCP2155. This Technical Brief describes how the MCP2150
Developers Board can be used for development of MCP2155
applications, and focuses on the Host UART signals from the U2
socket (MCP2150/MCP2155 ) to the MAX3238 device (U1) and
the Header (J1).

AN739: An In-Depth Look at the MCP2510.


MCP2510 Focuses on using
the MCP2510 including the minimal configuration necessary to
enable the CAN node, features and implementation, a detailed
discussion of many of the registers and potential pitfalls during
implementation.

AN758: Using the MCP2150 To Add IrDA Standard Wireless


Connectivity. Microchips MCP2150 provides support for the IrDA
Connectivity
standard protocol stack plus bit encoding/ decoding. This application note discusses the encoding/decoding functionality of this
device.

AN754: Understanding Microchips CAN Module Bit Timing.


Investigates the relationships between bit timing parameters,
the physical bus propagation delays, and oscillator tolerances
throughout the system as they pertain to Microchips CAN
module and assists in optimizing the bit timing for given physical
system attributes

TB046: Connecting the MCP2150 To The Psion Operating


System. Since the MCP2150 is a protocol handler supporting
IrDA standards plus an encoder/decoder, it can be used as a
Virtual Connector, a wireless link between an embedded application and an IrDA standard host. This host can be a handheld
device using the Psion OS. The Psion OS is generally used for
small Personal Digital Assistants (PDA) devices.
TB048: Connecting the MCP2150 to the Windows Operating
System. This technical brief is similar to TB046, however, in this
application the host is a Personal Computer (PC) using Microsoft
Windows which includes a terminal client that can easily be used
to demonstrate the capabilities of the MCP2150.
TB047: Connecting the MCP2150 to the Windows CE
Operating System
System. Similar to TB046 but using a Microsoft
Windows CE Operating System (OS). Windows CE is an
excellent host platform for use with the MCP2150 because of
the light weight, low cost, ease of use, and portability of these
devices. Microsoft Windows includes a terminal client that can
easily be used to demonstrate this capability.
TB049: Connecting the MCP2150 to the Palm Operating
System. Similar to TB046 but using the Palm Operating System
(OS) Personal Digital Assistants (PDA) devices are an excellent
host platform for use with the MCP2150 because of the light
weight, low cost, ease of use, and portability of these devices.

AN816: A CAN System Using Multiple MCP25025 I/O Expanders.


Describes a control system for a scissor-lift, which is essentially
a mobile work platform enabling the user to reach relatively high
places. All of the operations and movements use one Master
Node and three I/O Expander Nodes.
AN872: Upgrading from the MCP2510 to the MCP2515.
This application note discusses the differences between
the MCP2510 and MCP2515 (and possible impact of these
differences) in an effort to assist with the upgrade process.
AN873: Using the MCP2515 CAN Developers Kit. Serves as
a three-part tutorial for the MCP2515/2510 developers kit and
discusses the three software templates in detail as well as the
important menu items.
Infrared Communications
AN858: Interfacing The MCP215X to a Host Controller.
Controller
Discusses the operation of the MCP215X Host UART interface, implements an embedded system (as an IrDA Standard
Secondary device), and describes the setup of PDA devices to
operate as the IrDA Standard Primary device.
AN888: Programming the Palm OS for Embedded IR
Applications Strives to impart core, fundamental programming
concepts and design considerations for the development of
Palm OS application programs. Attention is given to each of the
fundamental areas of Palm OS application development in the
C programming language.
AN926: Programming the Pocket PC OS for Embedded IR
Applications. This application note details the tools, supporting
Applications
technologies and procedures for the development of infrared
applications on Windows Mobile based devices.
AN927: Data Throughput and the MCP215x. Discusses
techniques that will improve the data transfer throughput
between IrDA standard Primary Device and embedded system.
AN243: Fundamentals of the Infrared Physical Layer. Describes
the fundamentals of the infrared physical layer, the IrDA standard and selecting the proper discrete emitter and photodiode
components for circuit implementation.

I/O Expander
AN245: Interfacing the MCP23016 I/O Expander with the
PIC16F877A. This application note describes how to use a
PIC16F877A as an I2C master to communicate with the
Microchip MCP23016 I2C I/O Expander slave device. An I/O
Expander can also be used to monitor switches and/or sensors,
drive LEDs and/or relays, as well as other general-purpose I/O
functions.
LIN Bus Communications

AN729: LIN Protocol Implementation Using PICmicro MCUs.


This Application Note is intended to provide a broad overview of
the LIN bus and provide a high level look at how it works, how
to implement a Slave node on a PICmicro device and what its
designed to do.
AN829: LightKeeper Automotive Lighting Control Module. This
Application Note describes an automotive exterior lighting control
module using a PIC16C433.
Interface Products Design Guide 11

Devices for use with Sensors

Microchip Technologys Analog & Interface Product Families

Microchip Technology Inc. is a leading provider of


microcontroller, analog and memory products that provide
risk-free product development, lower total system cost
and faster time to market for thousands of diverse
customer applications worldwide. Microchips commitment to quality and innovation coupled with world-class
development tools, dependable delivery and outstanding
technical support sets us apart.

Integration
n One of the first to market with integrated LDO with
Reset, and Fan Controller with temperature sensor
n PGA integrates MUX, resistive ladder, gain switches,
high-performance amplifier, SPI interface

Analog & Interface Attributes

Space Savings
n Resets and LDOs in SC-70, ADCs in 5-lead SOT-23
n CAN and IrDAStandard protocol stack embedded in
an 18-pin package

Robustness
n MOSFET Drivers lead the industry in latch-up
immunity/ stability

Accuracy
n Offset trimmed after packaging using non-volatile
memory

Low Power/Low Voltage


n Op Amp family with the lowest power for a given gain
bandwidth
n 600nA/1.4V/10kHz bandwidth Op Amps
n 1.8V charge pumps and comparators
n Lowest power 12-bit ADC in SOT-23 package

Innovation
n Low pincount embedded IrDA Standard stack,
FanSense technology
n SelectMode operation
For more information, visit the Microchip website at
www.microchip.com

A Leading Provider of Microcontroller and Analog Products


Microchip Technology Inc. 2355 W. Chandler Blvd. Chandler, AZ 85224-6199 (480) 792-7200 Fax (480) 792-9210
Information subject to change. The Microchip name and logo, PIC, are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
FanSense and SelectMode are trademarks of Microchip Technology in the U.S.A. and other countries. IrDA is a registered trademark of Infrared Data Association. All other
trademarks mentioned herein are the property of their respective companies. 2004, Microchip Technology Inc. All rights reserved. DS21883A 3/2004

You might also like