Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CANBus Logger Final A

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 32

CAN-Bus Logger

Final A Presentation Jan. 14, 2010


Elad Barzilay Idan Cohen-Gindi Supervisor: Boaz Mizrahi

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.

Necessity & Overview


In the vehicle industry, the most common protocol is the CAN

- Control Area Network protocol on a central communication Bus. OBD - self diagnostic and reporting capability, which allows access to the vehicles bus and access to variable information of all sub systems of the vehicle. The OBD standard is very informative, giving a wide range of information such as: Engine temperature, RPM, fuel system status, car speed, and many analog sensors data. The device will operate as a data logger of such information, integrating it with various supporting data from the sensors, for complete overview of the vehicles operation.

Necessity & Overview


The device will be compact, user friendly and portable, thus
making it more suitable for personal and public use contrary to the rigid, professional OBD scan tools available on the market today. The device will posses advanced functions such as: Advanced diagnostic. Real time monitoring of the vehicles operation. Access and control of other control units on the vehicle. The device will be able to support various applications and will allow analysis on board a PC.

CAN Protocol - Reminder


CAN is a message based serial communication protocol efficiently supports real-time control and very high level of

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

Block Diagram Design Concepts Architecture & Platform

Layout & Manufacturing Software\Firmware


overview & outline

Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design

Block Diagram
CAN Module

Processing Unit

Data Link Layer

Physical Layer

Processing Unit :

Data Link Layer-

Physical Layer :
Maintaining CAN electrical requirements
Protecting the device

Manage CAN applications


Control peripheral devices User interface

Protocol implementation
Basic message filtering

Block Diagram
On-Board User Interface LCD & Key-Pad

CAN Bus network

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

Producing a complete product Simple design, re-use, given time frame.

Pigi-board

Versatile project, touching various

fields of design.

Architecture & Platform


The chosen Pigi-board concept requires a strong platform for power and processing. we explored two devices to base our CAN project upon PCD and POWER BENCH.

Architecture & Platform


We chose to use the PCD, mainly because of its higher level of readiness. in addition, it holds many analog sensors, useful for various applications. the Power-Bench has better processing abilities, but its also much larger and a bit of an over-kill for our needs.

Objectives

Preliminary Design

Detailed Design

Block Diagram Design Concepts Architecture & Platform

Layout & Manufacturing Software\Firmware


overview & outline

Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design

CAN Module Components


CAN Module
SPI

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%

LED can_rx1bf n_d D1 R3

canctrl_rst

R4

R5

4.7k

ESQT-102-03-G-S-401 1 2 VCC_3p3 can_mcu_intn

300

300

VCC_5p0 C4 100nF 16V 10%

R6

D2

D3

R8

canctrl_rst_r R7 C5 1uF 6.3V 10%

4.7k

J1 ESQT-102-03-G-S-401 1 2 VCC_5p0 mcu_can_spi_csn

LED

LED

300

120

R9

1 2 3 canctrl_canxr_RX_r 4

U2 TXD Rs V_SS CANH V_DD CANL RXD V_REF MCP2551-I/SN

8 7 6 5

canxr _rs canxr_canh canxr_canl

1 2 3

J3

J2 ESQT-102-03-G-S-401 1 2 can_mcu_spi_dout mcu_can_spi_din

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

MCP2515 Interrupt request for attention from the MCU.

Integration & Platform Adjustments


Add/Remove HW and fix problems spotted during the first debug:
1. Completing the ECOs list. 2. Adding new memory to the new PCB version. 3. Finishing Supporting Firmware. Making suitable Adjustments for the CAN Module integration: 4. Adding needed connectors to the PCD board. 5. Mapping required nets to the CAN module. 6. Integrating connectors and all ECO's (already mapped). 7. Manufacturing the revised board. Bring up and power up of the new Board: 8. Creating bring up software. 9. Mechanical design (CAN board, PCD external case).

Integration & Assembly


Because of shortage of free I/O ports on the microprocessor we are using only the most essential ports of the CAN controller.
CAN module CS line is mapped to exciting aux debug led line, thus operation of the module using the bus is indicated by the led.
VCC_3p3 R127 300 LED debug_led_pwr MCU PIN 53: mcu_aux_led3 D3

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.

Integration & Assembly


Overloading the CAN module interrupt line upon the existing interrupt line

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

TMP Sens INT PIN


sens_mcu_temp_alert

R70

4.7k

R86

1k

sens_mcu_temp_alert_r MCU PIN 56: mcu_aux_lcd_led

MCP2515 INT PIN

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

R128 C? 47k 22uF 10V 20%

Non-Inv erting DCDC Non-Inv erting DCDC 2

chrg_out

VCC_REG C1102 100nF 16V 10% EN

VCC_OUT FB

Non-Inv erting DCDC mcu_power_dcdc_en Inv erting DCDC

EN VCC_REG C17 47uF 6.3V 20% Inv erting DCDC

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

Block Diagram Design Concepts Architecture & Platform

Layout & Manufacturing Software\Firmware


overview & outline

Main Components Electrical Design Pin to Pin Integration & Platform Adjustments Mechanical Design

Layout & Manufacturing


Bottom view: Top view:

Layout & Manufacturing

30 boards were sent to manufacture, both the revised PCD


platform and the CAN board. Date: 20/12/09 Offshore supplier (china): MakePCB Ltd. Total cost including tax and shipment: 275 Euro.

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

Block Diagram Design Concepts Architecture & Platform

Layout & Manufacturing Software\Firmware


overview & outline

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..)

You might also like