CANBus Logger Final A

download CANBus Logger Final A

of 32

Transcript of CANBus Logger Final A

  • 8/3/2019 CANBus Logger Final A

    1/32

    CAN-Bus LoggerFinal A Presentation

    Jan. 14, 2010

    Elad BarzilayIdan Cohen-Gindi

    Supervisor: Boaz Mizrahi

  • 8/3/2019 CANBus Logger Final A

    2/32

    Abstract

    The goal of this project is to produce A Real-

    time Data Logging system which connects to a

    vehicles CAN-Bus, An External GPS deviceand Analog sensors, for reach data storage and

    analysis.

  • 8/3/2019 CANBus Logger Final A

    3/32

    Necessity & Overview

    In the vehicle industry, the most common protocol is the CAN- Control Area Networkprotocol on a central communication

    Bus.

    OBD - self diagnostic and reporting capability, which allowsaccess 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 systemstatus, 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.

  • 8/3/2019 CANBus Logger Final A

    4/32

    Necessity & Overview

    The device will be compact, user friendly and portable, thusmaking it more suitable for personal and public usecontrary

    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 andwill allow analysis on board a PC.

  • 8/3/2019 CANBus Logger Final A

    5/32

    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 ElectronicControl 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

  • 8/3/2019 CANBus Logger Final A

    6/32

  • 8/3/2019 CANBus Logger Final A

    7/32

    Objectives

    Preliminary Design Block Diagram Design Concepts Architecture & Platform

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

    Layout & Manufacturing Software\Firmware

    overview & outline

  • 8/3/2019 CANBus Logger Final A

    8/32

    Block Diagram

    Processing

    UnitData Link

    LayerPhysical

    Layer

    CAN Module

    Physical Layer : Maintaining CAN

    electrical requirements

    Protecting the device

    Data Link Layer-

    Protocol implementation

    Basic message filtering

    Processing Unit :

    Manage CAN applications

    Control peripheral devices

    User interface

  • 8/3/2019 CANBus Logger Final A

    9/32

    Block Diagram

    CANModule

    MCU

    AnalogDevices

    On-Board User InterfaceLCD & Key-Pad

    FlashMemory

    CAN Busnetwork

    PC

  • 8/3/2019 CANBus Logger Final A

    10/32

    Design Concepts

    Complete board design

    Evaluation Board

    CAN-to-USB

    Pigi-board

  • 8/3/2019 CANBus Logger Final A

    11/32

    Design Concepts

    Complete board design

    Evaluation Board

    CAN-to-USB

    Pigi-board

    Main considerations:

    Producing a complete

    product Simple design, re-use,

    given time frame.

    Versatile project, touching various

    fields of design.

  • 8/3/2019 CANBus Logger Final A

    12/32

    Architecture & Platform

    The chosen Pigi-board concept requires a strong platform for

    power and processing.

    we explored two devices to base our CAN project uponPCD

    and POWER BENCH.

  • 8/3/2019 CANBus Logger Final A

    13/32

    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.

  • 8/3/2019 CANBus Logger Final A

    14/32

    Objectives

    Preliminary Design Block Diagram Design Concepts Architecture & Platform

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

    Layout & Manufacturing Software\Firmware

    overview & outline

  • 8/3/2019 CANBus Logger Final A

    15/32

    CAN Module Components

    CAN Module

    CANH

    CANL

    RX

    TX

    MCP2551Transceiver

    MCP2515Controller

    SPI

    To

    MCU

    CAN ControllerMCP2515

    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 TransceiverMCP2551

    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

  • 8/3/2019 CANBus Logger Final A

    16/32

    Electrical Design

    canctrl_osc1

    canctrl_canxr_RX_r

    J1

    ESQT-102-03-G-S-401

    12

    J2

    ESQT-102-03-G-S-401

    1

    2

    J4

    ESQT-102-03-G-S-401

    12

    J5

    ESQT-102-03-G-S-401

    12

    VCC_3p3

    VCC_5p0

    can_mcu_intn

    mcu_can_spi_clk

    mcu_can_spi_dincan_mcu_spi_dout

    mcu_can_spi_csn

    VCC_3p3

    can_rx0bfn

    VCC_3p3

    VCC_3p3

    VCC_5p0

    mcu_can_spi_csn

    can_mcu_intn

    canxr_canh

    canctrl_canxr_TX

    canxr _rs

    can_mcu_sof

    canctrl_rst

    canctrl_rst_r

    can_rx1bfn_dcan_rx1bfn

    canxr_canl

    can_mcu_spi_doutmcu_can_spi_din

    TX0RTSn

    canctrl_canxr_RX

    U1

    MCP2515-I/SO

    TXCAN1

    RXCAN2

    CLKOUT/SOF3

    TX0RTS4

    TX1RTS5

    TX2RTS6

    OSC27

    OSC18

    VSS9

    VDD18

    RESET17

    CS16

    SO15

    SI14

    SCK13

    INT12

    RX0BF11

    RX1BF10

    C4

    100nF 16V 10%

    R3 300

    TP3

    1

    R11

    0

    D3

    LED

    D2

    LED

    R4

    300

    J3

    HEADER-3

    123

    R7 4.7k

    R2

    4.7

    k

    R6

    4.7

    k

    C5

    1uF 6.3V 10%

    TP4

    1

    C1

    100nF 16V 10%

    MCP2551-I/SN

    U2

    TXD1

    V_SS2

    V_DD3

    RXD4

    Rs8

    CANH7

    CANL6

    V_REF5

    TX1RTSn

    Y124MHz

    R8

    300

    R1

    4.7

    k

    C3 15pF 50V 5%

    TP1

    1

    R10

    470

    R5

    300

    C2 15pF 50V 5%

    mcu_can_spi_clk

    R9120

    TP5

    1

    TP2

    1

    TX2RTSn

    D1LED

    VCC_3p3

    canctrl_osc2

  • 8/3/2019 CANBus Logger Final A

    17/32

    Pinout Description

    Voltage supply 3.3 Volt for the

    operation of the MCP2515 CANcontroller.

    5 Volt for theoperation of the MCP2551 CAN

    transceiver. Gnd

    SPI Interface SPI Data In SPI Data In SPI Clock SPI CSn

    CAN Communication

    MCP2515 Interrupt

    request for attention from theMCU.

    Connectors on-boardthe PCD board:

    Connectors on-boardthe CAN board:

  • 8/3/2019 CANBus Logger Final A

    18/32

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

  • 8/3/2019 CANBus Logger Final A

    19/32

    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.

    SPI BUS - both connection of the CAN module and the MicroSD memory

    card are mapped to the MCUs SPI module pinout using bus mode.

    MCU PIN 53: mcu_aux_led3

    R127

    300

    VCC_3p3

    D3

    LED

    debug_led_pwr

    mcu_can_csn

  • 8/3/2019 CANBus Logger Final A

    20/32

    Integration & Assembly

    Overloading the CAN module interrupt line upon the existing interrupt linefrom the TMP sensoraccepted method of gathering INT signals.

    The SD memory card CS line is mapped as well to the INT bus , thusrequiring adding of pull-up resistor and setting the line configuration as shownhere:

    This configuration requires that the arbitration of the INTs and the operationof 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.

    sens_mcu_temp_alert_r

    mcu_aux_sd_cs

    R70

    4.7

    k

    R86 1k

    VCC_3p3

    MCU PIN 56: mcu_aux_lcd_led

    aux_mcu_can_intMCP2515 INT PIN

    TMP Sens INT PIN

    sens_mcu_temp_alert

  • 8/3/2019 CANBus Logger Final A

    21/32

    Relevant Modifications

    Power-up and shutdown circuitsupgrading 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.

    R100247k

    C1102

    100nF 16V 10%

    SW1

    1 2

    Inv erting DCDC

    Inv erting DCDC

    VCC_REG

    VCC_OUTEN

    Non-Inverting DCDC 2

    Non-Inverting DCDC

    VCC_REG

    FB

    VCC_OUT

    EN

    Non-Inverting DCDC 1

    Non-Inverting DCDC

    VCC_REG

    FB

    VCC_OUT

    EN

    ECO

    R1003 47kmcu_power_shutdown

    mcu_power_shutdown_detect

    mcu_power_dcdc_en

    chrg_out

    C1747uF 6.3V 20%

    C?22uF 10V 20%

    R12847k

    dcdc_3p3_en

  • 8/3/2019 CANBus Logger Final A

    22/32

    Relevant Modifications

    Adding new EPROM memory chipadding 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.

    U1000

    24LC1024

    A01

    A12

    A23

    GND4

    VCC8

    WP7

    SCL6

    SDA5 mcu_sda

    mcu_sclC1002

    100nF 16V 10%

    ECOVCC_3p3

  • 8/3/2019 CANBus Logger Final A

    23/32

    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.

  • 8/3/2019 CANBus Logger Final A

    24/32

    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.

  • 8/3/2019 CANBus Logger Final A

    25/32

    Mechanical Design

    The CAN board dimensions:

    length: 22 mm, width: 32 mm, height: 8 mm

    Top view: Bottom view:

  • 8/3/2019 CANBus Logger Final A

    26/32

    Objectives

    Preliminary Design Block Diagram Design Concepts Architecture & Platform

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

    Layout & Manufacturing Software\Firmware

    overview & outline

  • 8/3/2019 CANBus Logger Final A

    27/32

    Layout & Manufacturing

    Top view:Bottom view:

  • 8/3/2019 CANBus Logger Final A

    28/32

    Layout & Manufacturing

    30 boards were sent to manufacture, both the revised PCDplatform and the CAN board. Date: 20/12/09 Offshoresupplier (china): MakePCB Ltd. Total cost including taxand shipment: 275 Euro.

  • 8/3/2019 CANBus Logger Final A

    29/32

    Software Outline

    1. Device Drivers ( LCD, KEY-PAD, SD, USB )2. Setting up a MENU for starter simple operations like save/send

    to memory, receiving op codes from the user by the key-pad.

    3. PIC

    MCP communication through SPI communication:1. send/receive packets

    2. Queuing messages.

    3. Filtering capabilities.

    4. MCP configuration.

    4. Logging process configuration of : time, filtering options, timestamping etc.5. Real time transfer directly to the PC, through USB.

  • 8/3/2019 CANBus Logger Final A

    30/32

    Objectives

    Preliminary Design Block Diagram Design Concepts Architecture & Platform

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

    Layout & Manufacturing Software\Firmware

    overview & outline

  • 8/3/2019 CANBus Logger Final A

    31/32

    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 analyzeTransmit 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

  • 8/3/2019 CANBus Logger Final A

    32/32

    Questions

    ?(u dont have to..)