Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 230L: Simplify your Networked Application with CAN and.

Slides:



Advertisements
Similar presentations
Renesas Electronics America Inc. ID A19C: Soup to Nuts with Free Software Innovation:New business models mean new opportunities DJ Delorie Senior Engineer,
Advertisements

ID 311C:Utilizing JTAG / boundary scan and JTAG emulation for board and system level test and design verification Get the total Coverage ! GOEPEL Electronics.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Using a Renesas Code Generation Tool for RL78 Devices.
ID 210C: Introduction to CAN/LIN Solutions
ID 020C: Hardware-in-Loop: System Testing Without the System Marcella Haghgooie Sr. Field Applications Engineer Version: 1.2 Applied Dynamics International.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. A13C: Performing Digital Filtering on an MCU Kevin P King.
ID 911C: Case studies for Embedded Security
ID 413C: Can Touch This: Designing Capacitive-Based Touch Solutions Mark F Rodriguez Senior Engineering 13 October 2010 Version: 1.0 Xaplos Inc.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID B32L: Graphical Application Development under Linux/Implementing.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Debugging on RX with IAR Embedded Workbench.
Renesas Electronics America Inc. ID 311L: PIC to R8C Converter David Hedley Staff AE, Applications Engineering 14 Oct 2010 Version: 1.1.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Increase the Dynamic Range and Precision of Digital Filters.
© 2008, Renesas Technology America, Inc. All Rights Reserved The RCAN-ET peripheral and the CAN API SH2 & SH2A MCUs V 1.2 Mar 2010.
422L:Introduction to the.NET Micro Framework Julie Trygstad Vice President and Principal Engineer Version: 1.1 TrygTech 13 October 2010.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Know your Precise Position with RX600 MCU.
Renesas Electronics America Inc. “© 2010 Renesas Electronics America Inc. All rights reserved.” ID 720L: Software Development with an Open Source Real-Time.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A15C: Application Code Reprogramming Using Different Serial.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 320L: Rapid RX600 System Development Using the RPDL and.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L13B David Hedley, Applications Engineer Advanced.
Renesas Electronics America Inc. “© 2010 Renesas Electronics America Inc. All rights reserved ID 220L: Hands-on Embedded Ethernet Design with an Open Source.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. 431L: Using a Graphics API to Create User Interface Components—Advanced.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. 020L: Superior SH2A Design Process using Model Based Design.
An Introduction to OSEK l JRD l ETAS-STV/PRM-E l 2010 © ETAS GmbH All rights reserved. The names and designations used in this document are trademarks.
© 2010 Renesas Electronics America Inc. All rights reserved. ID 411C: Capacitive Touch User Interfaces and Hardware- based Solutions Renesas Electronics.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 115C: Low Pin Count V850: Small but Powerful MCU for portable.
Renesas Electronics America Inc. ID 322C:Using HEW's Many Capabilities to Boost Software Development Productivity Axel Wolf Marketing Manager, Development.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
ID 310C:Run-Time Visualization on Renesas MCUs Matt Gordon Sr. Applications Engineer Version: 1.2 Micriµm 12 October 2010.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Migrating from CubeSuite+ to Eclipse.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A12C:Noise Fundamentals and Techniques for Minimizing.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 930L: Board ID Embedded Security Lab Shotaro Saito Application.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 410L: Low cost audio in 8/16 bit applications using ADPCM.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. A11L: 78K0R Low Power MCU Hands-On Lab Bob Proctor Staff.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. A30L: Increase the Dynamic Range and Precision of Digital.
ID A16C: Outfitting Embedded Devices with Low Power Wireless Communications Design considerations for adding wireless communications to low power embedded.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Know your Precise Position with RX600 MCU Huangsheng.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A11C: Hardware Design Fundamentals for MCU-based Embedded.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. 113C: Migration to the RX600 Made Easy Life in the fast lane.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID630L: Becoming Familiar with Sensorless Vector Control.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Using Virtual EEPROM and Flash API for.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 011C: VELOCITY LAB TM Embedded Development Ecosystem Amrit.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. QuantiPhi for RH850 and RL78 - The Fastest Path from Idea.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Increase the Dynamic Range and Precision of Digital.
IAR Systems, Inc. ID 323C:A High Performance Compiler Solution for the RX Platform Shawn A. Prestridge Senior Field Applications Engineer 12 October 2010.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Implementing Bootloaders on Renesas MCUs.
2L01I Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 2L02I CAN In A Day Carl Stenquist, Staff.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 434L: Incorporating a Capacitive Touch Interface into.
ID 415:Drive a Color TFT-LCD panel with Low-cost Flash MCUs Sridhar Lingam Product Marketing Manager 12 October 2010 Version: 06.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced Debugging on the RX600.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced E 2 Studio Topics.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 411L:A Direct Drive LCD Software Solution for Driving.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Low Power Design Michael Thomas, Applications Engineer.
ID 222L: Get Connected with USB on RX62N
ID 024C: Auto Code Generation: The Shortest Distance From Idea to Implementation Christopher Myers Director of Software Development 12 October 2010 Version:
Global Edge Ian Carvalho Architect 14 October 2010 Copyright © 2010, Global Edge Software Ltd., Bangalore, India Version 1.0 ID 730L: Getting Started with.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 416C:SH-2A Graphics for Low- to Mid-level Graphics Applications.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L05I Advanced Debugging on the RX600 Fatih Peksenar.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 5L08I Using the Renesas Graphics API to Create.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 322L:Advanced Debugging on the RX600 Brandon Hussey Applications.
IAR Systems, Inc. ID 324C:Introducing the Embedded Workbench for the Renesas SH Shawn A. Prestridge Senior Field Applications Engineer 12 October 2010.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 421L: R8C Segment-LCD API Lab Bob Proctor Staff Engineer.
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID A10L:A Flexible Flash Rewrite Application Brandon Hussey.
ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:
An Introduction to CAN CAN Basics 2 Renesas Interactive
Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 130L: Optimizing your SH2A Application Kevin P King Senior.
Class ID: Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Using Software Building Blocks for Faster.
David Hedley Staff AE, Applications Engineering 12 Oct 2010
David Hedley Staff AE, Applications Engineering 13 October 2010
ID 325L: Getting Started with CubeSuite
Presentation transcript:

Renesas Electronics America Inc. © 2010 Renesas Electronics America Inc. All rights reserved. ID 230L: Simplify your Networked Application with CAN and the CAN API RX CAN Lab Carl Stenquist, C&I Staff Applications Engineer 13 October 2010 Ver. 1.0

2 © 2010 Renesas Electronics America Inc. All rights reserved. Mr. Carl Stenquist Staff Applications Engineer Wrote CAN API for R8C, M16C, R32C, SH, and RX. Design CAN Development Kit. Support/manage CAN middleware. PREVIOUS EXPERIENCE CAN truck electronics, Stoneridge Electronics, Sweden. 5 years designing and supporting CAN firmware applications for Renesas MCUs. MScEE, Chalmers University of Technology, Sweden.

3 © 2010 Renesas Electronics America Inc. All rights reserved. Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** Solutions for Innovation ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).

4 © 2010 Renesas Electronics America Inc. All rights reserved. 4 Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis). Solutions for Innovation

5 © 2010 Renesas Electronics America Inc. All rights reserved. 5 Microcontroller and Microprocessor Line-up Superscalar, MMU, Multimedia  Up to 1200 DMIPS, 45, 65 & 90nm process  Video and audio processing on Linux  Server, Industrial & Automotive  Up to 500 DMIPS, 150 & 90nm process  600uA/MHz, 1.5 uA standby  Medical, Automotive & Industrial  Legacy Cores  Next-generation migration to RX High Performance CPU, FPU, DSC Embedded Security  Up to 10 DMIPS, 130nm process  350 uA/MHz, 1uA standby  Capacitive touch  Up to 25 DMIPS, 150nm process  190 uA/MHz, 0.3uA standby  Application-specific integration  Up to 25 DMIPS, 180, 90nm process  1mA/MHz, 100uA standby  Crypto engine, Hardware security  Up to 165 DMIPS, 90nm process  500uA/MHz, 2.5 uA standby  Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, Low Power Ultra Low Power General Purpose

6 © 2010 Renesas Electronics America Inc. All rights reserved. 6 Microcontroller and Microprocessor Line-up Superscalar, MMU, Multimedia  Up to 1200 DMIPS, 45, 65 & 90nm process  Video and audio processing on Linux  Server, Industrial & Automotive  Up to 500 DMIPS, 150 & 90nm process  600uA/MHz, 1.5 uA standby  Medical, Automotive & Industrial  Legacy Cores  Next-generation migration to RX High Performance CPU, FPU, DSC Embedded Security  Up to 10 DMIPS, 130nm process  350 uA/MHz, 1uA standby  Capacitive touch  Up to 25 DMIPS, 150nm process  190 uA/MHz, 0.3uA standby  Application-specific integration  Up to 25 DMIPS, 180, 90nm process  1mA/MHz, 100uA standby  Crypto engine, Hardware security  Up to 165 DMIPS, 90nm process  500uA/MHz, 2.5 uA standby  Ethernet, CAN, USB, Motor Control, TFT Display High Performance CPU, Low Power Ultra Low Power General Purpose CAN MCU Solutions R8C/R32C/SH/RX

7 © 2010 Renesas Electronics America Inc. All rights reserved. CAN – Continuously Moving into New Fields Machines (knitting) Machines (knitting) Agriculture Agriculture Control Electronics Control Electronics Factory Assembly Lines Factory Assembly Lines Medical Systems Medical Systems Railway Electronics Railway Electronics Marine Electronics Marine Electronics Elevators Elevators Building Automation Building Automation Printing, Copying Printing, Copying

8 © 2010 Renesas Electronics America Inc. All rights reserved. Communication Made Simple Use CAN API, which uses the +CAN peripheral, which handles low level details = Fast implementation! Position

9 © 2010 Renesas Electronics America Inc. All rights reserved. Agenda The CAN Dataframe The CAN Mailbox The CAN API Polling vs. Interrupts Transmit Dataframes Receive Dataframes Error Handling Lab

10 © 2010 Renesas Electronics America Inc. All rights reserved. Key Takeaways Know how to… Initialize the CAN module Transmit from a CAN mailbox Receive data to a mailbox Use a CAN Monitor to view and send dataframes See how easy it is to use CAN  Focus on your application!

© 2010 Renesas Electronics America Inc. All rights reserved. 11 Lowest Levels Dataframe and Mailbox

12 © 2010 Renesas Electronics America Inc. All rights reserved. ID extend 1 Rem Req 1 I F S 3+ Data (Bytes) 0-8 bytes C R C 15 ACK1ACK1 SOF1SOF1 Identifier 11 Control 6 The Dataframe Data (Bytes) 0-8 bytes Identifier 11 Control 6 “Standard” 11-bit ID Dataframe Application software only reads/writes CAN ID Data Length Code (in Control Field) Data Field

13 © 2010 Renesas Electronics America Inc. All rights reserved. RX has 32 mailboxes/peripheral  RX/62N has 64 mailboxes to use on one bus. One mailbox handles one complete Dataframe (0-8 bytes) More mailboxes  SW design easier More SW design flexibility Less runtime reconfiguring Frame resides in Mailbox Application bus point of interaction Application reads & writes Mailbox A.k.a. “Message Box”, “Buffer”, “Slot”

14 © 2010 Renesas Electronics America Inc. All rights reserved. Managing a Mailbox HW takes care of rest Tx mailbox: HW takes care of low level transmit details Rx mailbox: HW captures messages with the set ID Mailboxes can be reconfigured at runtime Transmit Write All app needs to do! Field ID DLC Data Receive Setup mailbox Write - - Receive Get message Read

15 © 2010 Renesas Electronics America Inc. All rights reserved. CAN Firmware & Peripheral Interaction Peripheral Firmware Node MCU Mask ID=5,Data=,RXID=5,Data=123,TX Config. A mailbox to receive ID=5 Config. A mailbox to send a frame with ID=5 Mailboxes Transceiver 123…

16 © 2010 Renesas Electronics America Inc. All rights reserved. 1.CAN ID 2.Data Length Code 3.Data Field 4.All above  Which of these do you need to specify to setup a mailbox to receive? 1.CAN ID  2.Data Length Code 3.Data Field 4.All above QUESTION Which of these do you need in order to setup a mailbox to transmit?

17 © 2010 Renesas Electronics America Inc. All rights reserved. Messages are broadcast, and then received by all CAN controllers on the bus. 1.No, only to those mailboxes that have a CAN mailbox set up to receive that ID. 2.Yes, since they must do a CRC check, but the message is only copied to a CAN mailbox if there is one set up to receive that ID.  QUESTION Messages are broadcast and received by all CAN controllers on the bus, they all do a CRC check, then check If any mailbox is configured to receive that ID!

© 2010 Renesas Electronics America Inc. All rights reserved. 18 Application Level The CAN API

19 © 2010 Renesas Electronics America Inc. All rights reserved. Let ’ s move up the layers. Application interfaces with CAN API only  No bother with low level details. Layers (Where are we?) Optional industrial protocol

20 © 2010 Renesas Electronics America Inc. All rights reserved. Dealing with the CAN Registers… …can be tedious. Sure would be nice to have… CAN Initialization A CAN API! START Enter CAN reset/ initialization mode CAN reset mode? NO YES Enable CAN ports Set CAN control register - Loopback mode select bit - Message order select bit - Basic CAN mode select bit - Bus error interrupt enable bit Set CAN bit timing and baud rate Set mask register Go to CAN operation mode CAN operation mode? NO END YES Exit CAN sleep mode R_CAN_Create() The CAN API

21 © 2010 Renesas Electronics America Inc. All rights reserved. The CAN API Initialization, Port and Peripheral Control R_CAN_Create (ch_nr); R_CAN_SetBitrate (ch_nr); R_CAN_PortSet (ch_nr, action_type); [action_type = ENABLE, DISABLE ] R_CAN_Control (ch_nr, action_type); [action_type = ENTERSLEEP_CANMODE, EXITSLEEP_CANMODE, RESET_CANMODE, HALT_CANMODE, OPERATE_CANMODE, CANPORT_TEST_LISTEN_ONLY, CANPORT_TEST_0_EXT_LOOPBACK, CANPORT_TEST_1_INT_LOOPBACK, CANPORT_RETURN_TO_NORMAL ] Send R_CAN_TxSet (ch_nr, mbox_nr, frame_p, frame_type); R_CAN_Tx (ch_nr, mbox_nr); R_CAN_TxCheck (ch_nr, mbox_nr); R_CAN_TxStopMsg (ch_nr, mbox_nr); Receive R_CAN_RxSet (ch_nr, mbox_nr, stid, frame_type); R_CAN_RxRead (ch_nr, mbox_nr, frame_p); R_CAN_RxPoll (ch_nr, mbox_nr, frame_p); R_CAN_RxSetMask (ch_nr, sid_mask_value, mask_reg_nr); Error Check R_CAN_CheckErr (ch_nr); The CAN API

22 © 2010 Renesas Electronics America Inc. All rights reserved. Polling When data needed – Lowest priority; no interrupts When only interested in data at certain points in time - No hurry to get data Interrupts For processing data as soon as it arrives When processing messages in certain order Polling vs. Interrupts The CAN API

23 © 2010 Renesas Electronics America Inc. All rights reserved. Transmitting A Frame struct can_std_data_s { uint16 id; uint8 dlc; uint8 data[8]; }; R_CAN_TxSet (0, mbox_nr, &my_tx_frame, DATA_FRAME); my_tx_frame.id = 0x700; my_tx_frame.dlc = 2; my_tx_frame.data[0] = 0x11; my_tx_frame.data[1] = 0x22; struct can_std_frame_t my_tx_frame; The API function Waits for previous frame to finish transmit Clears message control register Disables interrupts for mailbox Sets CAN ID Sets DLC Sets transmit data Transmits Dataframe The CAN API

24 © 2010 Renesas Electronics America Inc. All rights reserved. Transmit Verification Not necessary...unless application must know when message sent CAN peripheral will deliver unless Bus Off (Just check for Error Passive) Do not define USE_CAN_POLL in config_r_can_rapi.h Successful Dataframe transmit triggers ISR CAN0_TXM0_ISR() Flag the application that data has been sent! Polling Define USE_CAN_POLL in config_r_can_rapi.h Check if data sent by calling R_CAN_TxCheck (ch_nr, mbox_nr); If returns API_OK, message was sent! Transmit interrupt

25 © 2010 Renesas Electronics America Inc. All rights reserved. A CAN mailbox configured with an ID can later be reused to handle other IDs? True, a mailbox can be reconfigured at runtime QUESTION Can a mailbox be reconfigured from transmit to receive? Again, yes! A mailbox can be reconfigured at runtime.

26 © 2010 Renesas Electronics America Inc. All rights reserved. Configure Mailbox to Receive The API Waits for any previous transmission/reception to complete Interrupt disables the mailbox Clears mailbox control register Sets Standard ID for selected mailbox Sets Dataframe/Remote frame Sets receive interrupt enabled unless USE_CAN_POLL defined R_CAN_RxSet(ch_nr, mbox_nr, stid, frame_type); The CAN API

27 © 2010 Renesas Electronics America Inc. All rights reserved. Polling for Received Data How to receive Dataframe in application At System Setup Uncomment USE_CAN_POLL in config_r_can_rapi.h: #define USE_CAN_POLL 1 When Polling R_CAN_RxPoll(ch_nr, mbox_nr, frame_p); If returns API_OK, mailbox has new message, call R_CAN_RxRead (ch_nr, mbox_nr, frame_p); Dataframe is copied to address frame_p.

28 © 2010 Renesas Electronics America Inc. All rights reserved. Using the Receive Interrupt How to receive Dataframe in application At System Setup Comment USE_CAN_POLL in config_r_can_rapi.h: //#define USE_CAN_POLL 1 When frame arrives with ID set by API the CAN Receive ISR triggers Check which mailbox caused the interrupt with R_CAN_RxPoll (ch_nr, mbox_nr, frame_p); If new frame, call R_CAN_RxRead (ch_nr, mbox_nr, frame_p); which copies the data to frame_p Set a flag to tell the main application that data has been received

29 © 2010 Renesas Electronics America Inc. All rights reserved. Messages are broadcast, and then received by all CAN controllers on the bus. 1.No, only to nodes with a mailbox set to receive that ID. 2.Yes, since they must do a CRC check. The message is only copied to a CAN mailbox if there is one set up to receive that ID.  QUESTION Messages are broadcast and received by all CAN controllers on the bus, they all do a CRC check, then check If any mailbox is configured to receive that ID!

30 © 2010 Renesas Electronics America Inc. All rights reserved. Dice Pictures for you to use We will have dice at every station. In your presentation, instruct the attendee to roll the dice to a spot when they complete a section. Here are the pictures for your use.

31 © 2010 Renesas Electronics America Inc. All rights reserved. Checking Progress We are using the die to keep track of where everyone is in the lab. Make sure to update it as you change sections. When done with the lab, your die will have the 6 pointing up as shown here.

32 © 2010 Renesas Electronics America Inc. All rights reserved. CAN Lab Setup

33 © 2010 Renesas Electronics America Inc. All rights reserved. Questions?

© 2010 Renesas Electronics America Inc. All rights reserved. 34 Thank You

© 2010 Renesas Electronics America Inc. All rights reserved. 35 Appendix

36 © 2010 Renesas Electronics America Inc. All rights reserved. Your CAN Application - Keep in Mind No real addresses Messages broadcast to whomever happens to listen! Mailbox ID can be reconfigured anytime  Flexible data flow Subdivide ID field for higher level functionality 11-bit ID split into “user protocol” fields Group priority (critical, info,..) Function ID (temp sensor, motor,..) Device address You CAN use!

37 © 2010 Renesas Electronics America Inc. All rights reserved. Error Handling Check node state regularly with int8_t R_CAN_CheckErr(void) Returns STATE_ERROR (Error Active): < 127 CAN transmit and receive errors occurred, OK! STATE_ERROR_PASSIVE: Over 127 errors occurred – warn user. STATE_BUSOFF:Node will not transmit until it recovers. Pause application, notify user that node is not working. Reinitialize CAN and reset mailboxes when node recovers to Error Active. The CAN API

38 © 2010 Renesas Electronics America Inc. All rights reserved. Bus Off reached Peripheral recovered: Reinitialize CAN! Minimum Application Handling of Bus Off Normal application activity Poll if peripheral is in Bus Off Application can not send or receive System goes into error mode: Poll if peripheral recovers

39 © 2010 Renesas Electronics America Inc. All rights reserved. CAN-D-Kit CAN Development Kit “CAN-D-Kit” Two R32C/118 Renesas Starter Boards Systec CAN bus monitor Debugger Interface Sample projects and evaluation software

Renesas Electronics America Inc.