CANBus Logger Final A
CANBus Logger Final A
CANBus Logger Final A
Abstract
The goal of this project is to produce A Realtime Data Logging system which connects to a vehicles CAN-Bus, An External GPS device and Analog sensors, for reach data storage and analysis.
reliability and security. Designed for communication between several Electronic Control Units (ECU's). Widely spread and accepted standard in industrial systems, mainly in automotive systems. Properties: Prioritized Multi-Master & Multi-Cast Message Routing Arbitration - CSMA/CD Strong Error Detection and Fault Confinement
Objectives
Preliminary Design
Detailed Design
Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design
Block Diagram
CAN Module
Processing Unit
Physical Layer
Processing Unit :
Physical Layer :
Maintaining CAN electrical requirements
Protecting the device
Protocol implementation
Basic message filtering
Block Diagram
On-Board User Interface LCD & Key-Pad
CAN Module
MCU
PC
Analog Devices
Flash Memory
Design Concepts
Complete board design
Evaluation Board
CAN-to-USB
Pigi-board
Design Concepts
Complete board design
Evaluation Board
Main considerations:
CAN-to-USB
Pigi-board
fields of design.
Objectives
Preliminary Design
Detailed Design
Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design
To MCU
MCP2515 Controller
RX TX
MCP2551 Transceiver
CANH CANL
CAN Controller MCP2515 Implementing the CAN protocol engine Receiving and transmitting buffers. Filtering and masking capabilities for message analyses and acceptance. Error detection and handling and bit timing.
CAN Transceiver MCP2551 Transform the TX,RX lines to CAN_H , CAN_L required for the connector to the bus. Supports 1 Mb/s operation Suitable for 12V and 24V systems fault-tolerant & high buffering protection
Electrical Design
VCC_3p3
4.7k R1
C1 100nF 16V 10% TP1 TP2 TP3 TP4 canctrl_canxr_TX 1 canctrl_canxr_RX 2 3 can_mcu_sof 4 TX0RTSn 5 TX1RTSn 6 TX2RTSn 7 8 9 canctrl_osc2 U1 TXCAN RXCAN CLKOUT/SOF TX0RTS TX1RTS TX2RTS OSC2 OSC1 VSS MCP2515-I/SO Y1 24MHz C3 VCC_3p3 VCC_3p3 15pF 50V 5% can_rx0bf n canctrl_osc1 VDD RESET CS SO SI SCK INT RX0BF RX1BF 18 17 16 15 14 13 12 11 10
R2
mcu_can_spi_csn can_mcu_spi_dout mcu_can_spi_din mcu_can_spi_clk can_mcu_intn
4.7k
VCC_3p3 300
can_rx1bf n
C2
15pF 50V 5%
canctrl_rst
R4
R5
4.7k
300
300
R6
D2
D3
R8
4.7k
LED
LED
300
120
R9
1 2 3 canctrl_canxr_RX_r 4
8 7 6 5
1 2 3
J3
R10
HEADER-3
J4 ESQT-102-03-G-S-401 1 2 J5 mcu_can_spi_clk
TP5
470
R11
Pinout Description
Voltage supply
3.3 Volt for the operation of the MCP2515 CAN controller. 5 Volt for the operation of the MCP2551 CAN transceiver. Gnd SPI Data In SPI Data In SPI Clock SPI CSn
Connectors on-board Connectors on-board the PCD board: the CAN board:
SPI Interface
CAN Communication
mcu_can_csn
SPI BUS - both connection of the CAN module and the MicroSD memory card are mapped to the MCUs SPI module pinout using bus mode.
from the TMP sensor accepted method of gathering INT signals. The SD memory card CS line is mapped as well to the INT bus , thus requiring adding of pull-up resistor and setting the line configuration as shown here:
VCC_3p3
R70
4.7k
R86
1k
aux_mcu_can_int
mcu_aux_sd_cs
This configuration requires that the arbitration of the INTs and the operation
of the SD card will be handled in software. Usage of the CAN module will be done mostly in polling mode. Reading of the TMP sensor will be done without using the ALERT line. When used , the CAN module and the SD card must be disabled.
Relevant Modifications
Power-up and shutdown circuits upgrading and fixing the power stream:
Shutting down the device wasnt possible when the battery was still connected. Same button for power-up and shutdown. Stabling the voltage levels.
mcu_power_shutdown_detect mcu_power_shutdown dcdc_3p3_en R1003 47k 1 SW1 R1002 47k Non-Inv erting DCDC 1 2
ECO
VCC_REG EN VCC_OUT FB
chrg_out
VCC_OUT FB
VCC_OUT
Relevant Modifications
Adding new EPROM memory chip adding more memory for the support of:
Future CAN applications. Supporting longer periods of data storing time of the logging process. Storing BOOT, bring up and configuration data.
ECO
VCC_3p3 U1000 C1002 100nF 16V 10% 1 2 3 4 A0 A1 A2 GND VCC WP SCL SDA 8 7 6 5
mcu_scl mcu_sda
24LC1024
Mechanical Design
The main mechanical design consideration is fitting an additional board into the very crowded PCD package.
The only available free space is between the main board and the keypad. Taking in to consideration the spikes on the bottom of the keypad leaves just under 11mm.
Mechanical Design
The CAN board is placed on four 100mil connectors, for robustness. the cards outline goes around high components on the PCD board.
All large components and connectors are located on the bottom side of the CAN board.
Mechanical Design
The CAN board dimensions: length: 22 mm, width: 32 mm, height: 8 mm Top view: Bottom view:
Objectives
Preliminary Design
Detailed Design
Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design
Software Outline
1. 2.
3.
Device Drivers ( LCD, KEY-PAD, SD, USB ) Setting up a MENU for starter simple operations like save/send to memory, receiving op codes from the user by the key-pad. PIC MCP communication through SPI communication:
1. 2. 3. 4. send/receive packets Queuing messages. Filtering capabilities. MCP configuration.
4. 5.
Logging process configuration of : time, filtering options, time stamping etc. Real time transfer directly to the PC, through USB.
Objectives
Preliminary Design
Detailed Design
Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design
Project B Milestones
PCD & CAN board bring up. Power up & Connectivity Checking stability of voltage on components and proper
operation. Software Debugging. CAN_H , CAN_L scope analyze Transmit and receive testing between 2 devices. OBD-II Testing : request, receive, validate and store. GUI on PC. Final Integration: VEHICLE -> OBD -> MCP -> PIC -> SD > USB -> PC GUI
Questions
?
(u dont have to..)