M
Features
• Implements CAN V2.0B
- Programmable bit rate up to 1 Mb/s
- One programmable mask
- Two programmable filters
- Three auto-transmit buffers
- Two message reception buffers
- Does not require synchronization or
configuration messages
• Hardware Features
- Non-volatile memory for user configuration
- User configuration automatically loaded on
power-up
- Eight general-purpose I/O lines individually
selectable as inputs or outputs
- Individually selectable transmit-on-pin-
change for each input
- Four 10-bit, analog input channels with
programmable conversion clock and V
REF
sources (MCP2505X devices only)
- Message scheduling capability
- Two 10-bit PWM outputs with independently
programmable frequencies
- Device configuration can be modified via
CAN bus messages
- In-Circuit Serial Programming™ (ICSP™) of
default configuration memory
- Optional 1-wire CAN bus operation
• Low-power CMOS technology
- Operates from 2.7V to 5.5V
- 10 mA active current, typical
- 30 µA standby current (CAN Sleep mode)
• 14-pin PDIP (300 mil) and SOIC (150 mil)
packages
• Available temperature ranges:
- Industrial (I): -40°C to +85°C
- Extended (E): -40°C to +125°C
MCP2502X/5X
CAN I/O Expander Family
Description
The MCP2502X/5X devices operate as I/O expanders
for a Controller Area Network (CAN) system,
supporting CAN V2.0B active, with bus rates up to
1 Mb/s. The MCP2502X/5X allows a simple CAN node
to be implemented without the need for a
microcontroller.
The devices
exceptions:
are
identical,
with
the
following
Device
MCP25020
MCP25025
MCP25050
MCP25055
A/D
No
No
Yes
Yes
One Wire
Digital
CANbus
No
Yes
No
Yes
The MCP2502X/5X devices feature a number of
peripherals, including digital I/Os, four-channel 10-bit
A/D (MCP2505X) and PWM outputs with automatic
message transmission on change-of-input state. This
includes an analog input exceeding a preset threshold.
One mask and two acceptance filters are provided to
give maximum flexibility during system design with
respect to identifiers that the device will respond to.
The device can also be configured to automatically
transmit a unique message whenever any of several
error conditions occur.
The device is pre-programmed in non-volatile memory
so that the part defaults to a specific configuration at
power-up.
2003 Microchip Technology Inc.
DS21664C-page 1
MCP2502X/5X
Package Types
PDIP/SOIC
GP0/AN0
GP1/AN1
GP2/AN2/PWM1
GP3/AN3/PWM2
GP4/V
REF
-
GP5/V
REF
+
V
SS
1
2
3
4
5
6
7
14
13
12
11
10
9
8
V
DD
TXCAN/TXRXCAN*
RXCAN/NC*
GP7/RST/V
PP
GP6/CLKOUT
OSC2
OSC1/CLKIN
Threshold Detection
- refers to the MCP2502X/5X’s
ability to automatically transmit a message when a
predefined analog threshold is reached.
*
One-wire option available on MCP250X5 devices.
Definition of Terms
The following
document:
terms
are
used
throughout
this
I/O Expander
- refers to the integrated circuit (IC)
device being described (MCP2502X/5X).
Input Message
- term given to messages that are
received by the MCP2502X/5X and cause the internal
registers to be modified. Once the register modification
has been performed, the MCP2502X/5X transmits a
Command Acknowledge message to indicate that the
command was received and processed.
Command Acknowledge Message
- term given to the
message that is automatically transmitted by the
MCP2502X/5X after receiving and processing an input
message.
Information Request Message
- term given to
Remote Request messages that are received by the
MCP2502X/5X that subsequently generate an output
message (data frame) in response.
Output Message
- term given to the message that the
MCP2502X/5X sends in response to an Information
Request message.
On Bus Message
- term given to the message that the
MCP2502X/5X transmits after completing the power-on/
self-configuration sequence at timed intervals, if
enabled.
Self-Configuration
- term used to describe the
process of transferring the contents of the EPROM
memory array to the SRAM memory array.
On Bus
- term used to describe the condition when the
MCP2502X/5X is fully-configured and ready to
transmit, or receive, on the bus. This is the only state in
which the MCP2502X/5X can transmit on the bus.
Edge Detection
- refers to the MCP2502X/5X’s ability
to automatically transmit a message based upon the
occurance of a predefined edge on any digital input.
DS21664C-page 2
2003 Microchip Technology Inc.
MCP2502X/5X
1.0
DEVICE OVERVIEW
This document contains device-specific information on
the MCP2502X/5X family of CAN I/O expanders. The
CAN protocol is not discussed in depth in this
document. Additional information on the CAN protocol
can be found in the CAN specification, as defined by
Robert Bosch GmbH.
Figure 1-1 is the block diagram of the MCP2502X/5X
and Table 1-1 is the pinout description.
The following sections detail the modules as listed in
Figure 1-1.
FIGURE 1-1:
MCP2502X/5X BLOCK DIAGRAM
GPIO
GP0/AN0
GP1/AN1
GP2/AN2/PWM1
GP3/AN3/PWM2
GP4/V
REF
-
GP5/V
REF
+
User
Memory
GP6/CLKOUT
GP7RST/V
PP
State Machine
and
Control Logic
CAN
Protocol
Engine
OSC1/CLKIN
OSC2/CLKOUT
Timing
Generation
TXCAN/
TXRXCAN
RXCAN
PWM2
PWM1
A/D
*
*
Only the MCP2505X devices have the A/D module.
TABLE 1-1:
Pin
Name
GP0/AN0
*
GP1/AN1
*
GP2/AN2/PWM2
*
GP3/AN3/PWM3
*
GP4/V
REF
-
GP5/V
REF
+
V
SS
OSC1/CLKIN
OSC2
GP6/CLKOUT
GP7/RST/V
PP
RXCAN
TXCAN/TXRXCAN
V
DD
PINOUT DESCRIPTION
Pin
Number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Standard
Function
Bidirectional I/O pin, TTL input buffer
Bidirectional I/O pin, TTL input buffer
Bidirectional I/O pin, TTL input buffer
Bidirectional I/O pin, TTL input buffer
Bidirectional I/O pin, TTL input buffer
Bidirectional I/O pin, TTL input buffer
Ground
External oscillator input
External oscillator output
Bidirectional I/O pin, TTL input buffer
Input pin, TTL input buffer
CAN data receive input
CAN data transmit output
Power
Alternate
Function
Analog input channel
Analog input channel
Analog input/PWM output
Analog input/PWM output
External V
REF
-
External V
REF
input
None
External clock input
None
CLKOUT output
External Reset input
Not connected for 1-wire
CAN TX and RX for 1-wire
operation (MCP250X5)
None
Programming
Mode Function
None
None
None
None
Data
Clock
Ground
None
None
None
Vpp
None
None
Power
*
Only the MCP2505X devices have the A/D module.
2003 Microchip Technology Inc.
DS21664C-page 3
MCP2502X/5X
NOTES:
DS21664C-page 4
2003 Microchip Technology Inc.
MCP2502X/5X
2.0
CAN MODULE
The CAN module is a protocol controller that converts
between raw digital data and CAN message packets.
The main functional block of the CAN module is shown
in Figure 2-1 and consists of:
• CAN protocol engine
• Buffers, masks and filters
The module features include:
• Implementation of the CAN protocol
• Double-buffered receiver with two separate
receive buffers
• One full-acceptance mask (standard and
extended)
• Two full-acceptance filters (standard and
extended)
• One filter for each receive buffer
• Three prioritized transmit buffers for transmitting
predefined message types
• Automatic wake-up on bus traffic function
• Error management logic for transmit and receive
error states
• Low-power SLEEP mode
FIGURE 2-1:
BUFFERS
CAN MODULE
TXB0
MESSAGE
TXREQ
ABTF
MLOA
TXERR
TXB1
MESSAGE
TXREQ
ABTF
MLOA
TXERR
TXB2
MESSAGE
A
c
c
e
p
t
R
X
B
0
TXREQ
ABTF
MLOA
TXERR
Acceptance Mask
RXM
Acceptance Filter
RXF0
M
A
B
Acceptance Filter
RXF1
R
X
B
1
A
c
c
e
p
t
Message
Queue
Control
Identifier
Data Field
Identifier
Data Field
Transmit Byte Sequencer
PROTOCOL
ENGINE
Transmit<7:0>
Shift<14:0>
{Transmit<5:0>, Receive<8:0>}
Comparator
CRC<14:0>
Receive<7:0>
Receive
Error
Counter
Transmit
Error
Counter
REC
TEC
ErrPas
BusOff
Protocol
Finite
State
Machine
Transmit
Logic
Bit
Timing
Logic
RXCAN
Clock
Generator
TXCAN/TXRXCAN
Configuration
Registers
2003 Microchip Technology Inc.
DS21664C-page 5