XC2287 HOT. Exercise CAN_1 Communication using the CAN Module

Similar documents
XC2287M HOT Solution CAN Serial Communication using the CAN. Device: XC2287M-104F80 Compiler: Tasking Viper 2.4r1 Code Generator: DAvE 2.

XC2287M HOT. Solution CAN_2 Serial Communication using the CAN with external CAN BUS

XC2287M HOT. Solution ASC. Uses a timer triggered LED to toggle with ASC Interrupt

XC2287M HOT. Solution GPT12. Uses a timer triggered LED s to toggle. Device: XC2287M-104F80 Compiler: Tasking Viper 2.4r1 Code Generator: DAvE 2.

XC2287M HOT Getting Started Exercise 1 Get familiar with the tool chain and uses a timer triggered LED toggle

XC866 Getting Started on EasyKit & Toolkits

XC886/888CLM Getting Started on MCAN - ADC

XC2000 series Board Manual, V.1.0, June XC2000 Easy Kit. Board REV. V1.0. Microcontrollers. Never stop thinking.

XE166 family Easy Kit

Updating Reader Firmware

XE166 Family AP Application Note. Microcontrollers. UConnect XE162N Hardware Description V1.0,

USB-COMi-TB USB to Industrial Single RS-422 / 485 Adapter Manual. Specifications and Features

XE164 UConnect Manual, V.1.1, February XE164 UConnect. Board REV. 2007/40. Microcontrollers. Never stop thinking.

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

This 4-port RS-422/485 Adapter is provided with an external switching power adapter in the package.

PI Scanner User Guide

PSIM Tutorial. How to Use SCI for Real-Time Monitoring in F2833x Target. February Powersim Inc.

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

USB-16COMi-M 16-Port RS-422/485 USB Serial Adapter User Manual. Features and Specifications. Power Supply

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

USB485. USB to RS485 Converter Card. User Manual for connecting with Windows Vista Version 1.01

Infineon Flash Programmer Memtool for XMC1000 Family. XMC Microcontrollers January 2016

USB485 USB to RS485 Converter Card

Easy Kit Board Manual

Installation Guide of Hi-Speed USB to Octal RS-232/422/485 Adapter

USBG-8COM-PRO 8-Port USB to RS-232, 422, 485 Auto Setup Adapter Manual. Features & Specifications. Specifications

Application Note, V2.0, April 2010 AP16174 XE164

VORAGO VA108x0 Bootloader application note

XMC4800 EtherCAT APP SSC Firmware Update Slave Example. Getting Started Version 3.0

Programming in the MAXQ environment

Quick Start Guide: RL78G14 Motor Control Starter Kit

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

NEW CEIBO DEBUGGER. Menus and Commands

I-7570 Serial To HART Converter

Installation Guide of Hi-Speed USB to Industrial Single RS-422/485 Adapter

Firmware Reprogramming Guide

01348(N or G) MH** -- Material Handling (N or G) MH** -- Material Handling

Quick Start Guide Demo Distance2Go. July 2018

USB to DB25 RS232 Adapter User Manual. Features. Windows 7/ Vista / 2003 / XP / 2000 Driver Installation

Application Note, V 1.0, Sep AP TC1796 step B. Micro Link Interface: Quick Start. Microcontrollers. Never stop thinking.

Figure 1: ZigBee Evaluation Kit (ZEK) Contents. Figure 2: ZigBee Adapter Zb-121 and Module Zb-21

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

ZFSM-201-KIT-1 Wireless UART Application User Guide

Locus Engineering Inc

Application Note, V2.0, August 2007 AP08067 XC886/XC888

User Manual. ESP8266 Wifi Shield

Migration from HEW to e 2 studio Development Tools > IDEs

Introduction & Specifications of Hi-Speed USB to Industrial Dual Ports RS-422/485 Adapter

Using Code Composer Studio IDE with MSP432

USB BF70x Bulk Library v.1.1 Users Guide Users Guide Revision 1.1. For Use With Analog Devices ADSP-BF70x Series Processors. Closed Loop Design, LLC

CF-850/F1K-144-S Hardware Manual

GEM80 & ewon Setup Quick Guide

EKK-LM3S811 QUICKSTART

PCI Express 16-Port Serial I/O Cards

Cookery-Book, V1.0, February XMC1400 BootKit HelloWorld

VLT 5000 DeviceNet and Allen Bradley Control logix 5550

CommLink IV Technical Guide

Introduction USART & AVR EVK1100

CF-850/F1KM-176-S Hardware Manual

Saab TransponderTech. R4 Display SW Update Instruction

USB Host Shield 2. Features and Specifications

CONNECTING YOUR PC TO THE USB EVALUATION BOARD

(1) Device Management tool: enables you to remotely manage AX220xx RS232-to-WiFi devices.

3.1 I-7560 Pin Assignment and Specifications: Introduction

Installation and Quick Start of isystem s winidea Open in DAVE. Tutorial Version 1.0, May, 2014

STEPPER-MOTOR-RD STEPPER MOTOR REFERENCE DESIGN KIT USER S GUIDE. 1. Kit Contents. 2. Kit Overview. Figure 1. Stepper Motor Reference Design Board

Mu.S.E. Operating Manual

8 Port USB to RS- 232/422/485 Octal Adapter. Product Manual. Coolgear, Inc. Version 1.1 April 2018 Model Number: USB-8COMi-RM.

XMC4700/XMC4800 RelaxKit HelloWorld (USB)

PCI Express 4-Port Industrial Serial I/O Cards

MxDS1 CNC Data Shuttle

HandsOn Technology -- HT-MC-02 MODEL: HT-MC-02

Evaluation Board Getting Started. TLE984x_EVB_1.x TLE9845_EVB_1.x

Implementing a Serial Download Manager for Two 256K Byte Flash Memories

Wireless-Tag WT51822-S4AT

SFP+ Breakout 2. Data Sheet. Datasheet SFP+ Breakout. 1 Overview. Table of Contents. 2 Features

Debugging in AVR32 Studio

ACE PLUS CORP. APCON100 series Operation Manual RS-232 to Ethernet Converter

Exercise: PWM Generation using the N2HET

Innovati s Bluetooth 100M Universal Wireless Bluetooth Module

OVERVIEW HARDWARE. C167 / ST10-F168 CAN Bus Programming and Simulation

ECE251: Thursday November 8

S32K148 EVB QUICK START GUIDE REV1 APPLIES FOR: S32K148 EVB (SCH REV A/B) EXTERNAL USE

DFS/Cutter. Debugging Communication Problems

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465

1.6inch SPI Module user manual

1. Introduction. 2. Installation INSTALLATION INSTRUCTIONS: MCD USB MODULE

Product Specification for CANbus to DeviceNet Transducer Gateway

Getting Started Guide: TMS-FET470A256 IAR Kickstart Development Kit

AN HI-3200 Avionics Data Management Engine Evaluation Board Software Guide

USB TO SERIAL CONVERTER

Quick Start Guide Sense2GoL Module. July 12 th 2018

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

Getting Started with Qorivva Fast

HT32 Series In-System / In-Application Programmer User Manual

WizISP Program User Guide for W7100

USB232 board EB Technical datasheet

Application Note. Startup DevKit16. History 19 th June 00 TKa V1.0 started 20 th June 00 TKa V1.1 Some minor text corrections

Installation Guide of Hi-Speed USB to Industrial I/O Adapter

Transcription:

XC2287 HOT Exercise CAN_ Communication using the CAN Module

XC2267 HOT Exercise CAN_ Serial Communication using the CAN Let s get started now! Page 2

HOT Exercise CAN_ Simple USIC Example In this exercise you will: Configure the XC2000 with DAvE Configure USIC 0 Channel 0 as a UART Receive a character from a PC and generate a receive interrupt Transmit the character on CAN node 0 and receive the CAN message on CAN node Transmit the value back to the PC and toggle one of the LEDs on the board on receipt of every character Page 3

HOT Exercise CAN_ RS232 & CAN settings RS232 Settings Baud Rate = 9200 Baud 8 bit data, stop bit, no parity Receive interrupt RXD:P7.4 TXD: P7.3 CAN Settings Baud Rate = 500 kbaud Message Object 2 : CAN node 0, transmit, byte, -bit ID = 0x Message Object 5 : CAN node, receive, byte, -bit ID = 0x RX-interrupt, level 5 CAN 0: RX: P2.0, TX P2. CAN ; RX: P2.4, TX P2.2 Page 4

HOT Exercise CAN_ Flow Chart /2 Init CAN Module Module enable Fractional Divider EINIT write protected register Init CAN Node Enable node and interrupts Configure pin connections Set baud rate Assign Message Objects to node Init Message Objects (MO) RX/TX mode data length INT pointer and enable Identifier Data content Enable MO CAN_2 Init Main fsys=80mhz Init USIC Init MultiCAN Module Node 0 Node Message Objects Start nodes While() Start Node on CAN Bus Page 5

HOT Exercise CAN_ Flow Chart 2/2 USIC 0 Channel 0 (ASC) Interrupt ASC RX Interrupt Clear ASC status register Received Character -> MOData2 Sent MOData2 Exit CAN Message Object 5 Interrupt CAN MO5 RX Interrupt Clear CAN status register Received Character -> U0C0 ASC TX Sent U0C0 ASC Exit Page 6

HOT Exercise CAN_ Start DAvE Start DAvE Select Open an existing project' from the startup dialog or click Select the USIC_ project from the previous example Page 7

HOT Exercise CAN_ - DAvE Configurations Project Settings Now do File and Save As Browse and create folder c:\ifx_hot\vx_code_workspace\can_ Enter project name: CAN_' Click 'Save. Page 8

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings XC2287 MultiCAN : Click on the Page 9

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN General: Enable module Page 0

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN General: Select Node 0 Page

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Node 0 General: Select P2.0 for Receive Input and P2. for Transmit Output Initialize the CAN node 0 Page 2

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Node 0 Baud Rate: Required baud rate : 500 Kbaud TSeg2 : 5 to get Real baud rate at 500 Kbaud Page 3

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN General: Select Node Page 4

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Node General: Select P2.4 for Receive Input and P2.2 for Transmit Output Initialize the CAN node Page 5

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Node Baud Rate: Required baud rate : 500 Kbaud TSeg2 : 5 to get Real baud rate at 500 Kbaud Page 6

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN List, 2: Drag M02 and drop it to List (Node 0) Drag M05 and drop it to List 2 (Node ) Page 7

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN M0s: Select M02 Page 8

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Message Object (M02) Object: Enable MO2, Select Transmit data frames Identifier: 0x0, Data Length: data bytes Page 9

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN M0s: Select M05 Page 20

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Message Object (M05) Object: Enable MO5, Select Transmit data frames Identifier: 0x0, Data Length: data bytes Page 2

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure CAN Message Object (M05) Interrupt: Enable receive interrupt Use CAN SRN 0 Page 22

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN Interrupts : Drag CAN INT 0 and drop it to Interrupt Level 4, Group 0 Page 23

HOT Exercise CAN_ - DAvE Configurations A MultiCAN settings Configure MultiCAN Functions: Include CAN_vInit Include CAN_vTransmit and CAN_vLoadData Page 24

HOT Exercise CAN_ - DAvE Configurations Save DAvE Project Save your DAvE Project File Go to File Save (or Save As) or click on Filename entered previously: c:\ifx_hot\vx_code_workspace\can_\can_.dav Page 25

HOT Exercise CAN_ - DAvE Configurations Code Generation Let DAvE Generate Code for You Go to File generate Code or click on DAvE generated code files are MAIN.C, MAIN.H USIC0.C, USIC0.H U0C0.C, U0C0.H IO.C, IO.H SCS.C, SCS.H CAN.C CAN.H XC22XXREGS.H Page 26

HOT Exercise CAN_ Tasking VX Toolset Open Project Work Space if not already open Click on Filename: browse to c:\ifx_hot\vx_code_workspace Click OK 2 Page 27

HOT Exercise CAN_ Tasking VX Toolset Create New Project Click on Workbench (if not already there ) Page 28

HOT Exercise CAN_ Tasking VX Toolset Create New Project Click on File and New Select Tasking VX-toolset Click OK 2 Page 29

HOT Exercise CAN_ Tasking VX Toolset Create New Project Create Project name `CAN_ Same name as DAvE directory Select Default Location Select Empty project Click Next 2 3 4 Page 30

HOT Exercise CAN_ Tasking VX Toolset Create New Project Select Configuration just Debug (this enables symbolic debug information automatically) Set Options 3 2 4 Page 3

HOT Exercise CAN_ Tasking VX Toolset Refresh files in the project Right click on CAN_ in the navigator Select Refresh from the pull down menu Click on the + to the right of ADC_ to expand the project to be able to see all the files 2 Page 32

HOT Exercise CAN_ Tasking VX Toolset Exclude the CAN_.asm file Right click on CAN_.asm in the file list Select Exclude from build Then check Debug 2 3 Page 33

HOT Exercise CAN_ Tasking VX Toolset Set Target Board Configuration for Project ADC_ Click on Select Infineon XC2287 Easy Kit Board Select DAS over MiniWigglerII Select Single Chip Select XC2287-96F 2 3 Page 34

HOT Exercise CAN_ Tasking VX Toolset Set Project Properties Click on Project and Properties Click Setting and Preprocessing Disable Automatic inclusion of.sfr file 3 4 5 2 6 Page 35

HOT Exercise CAN_ Tasking VX Toolset Set Project Properties Click on Project and Properties Click Run/Debug Settings Select CAN_ simulator and click on delete 3 4 5 2 6 Page 36

HOT Exercise CAN_ Tasking VX Toolset 4 3 3 2 Page 37

HOT Exercise CAN_ Tasking VX Toolset Software Hint DAvE doesn t change code that is inserted in the USER CODE sections if you let DAvE regenerate the code. Therefore, whenever adding code to the generated code, write it into a USER CODE section. The code you have to add should look like this: while() { // USER CODE BEGIN (Main,4) BlinkLED(); // USER CODE END } Page 38

HOT Exercise CAN_ - Complete code Edit File U0C0.C In the ISR function U0C0_ASC_vi0IC(void) (almost at the end) _interrupt(u0c0_0int) void U0C0_ASC_vi0IC(void) { // USER CODE BEGIN (ASC0IC,2) // USER CODE END if (U0C0_PSR & 0x4000) { // USER CODE BEGIN (ASC0IC,4) CAN_MODATA2LL = U0C0_RBUF; //store received character in MO2 CAN_vTransmit(2); // USER CODE END } U0C0_PSCR = 0x4000; // clear PSR_RIF // USER CODE BEGIN (ASC0IC,5) // USER CODE END } // End of function U0C0_ASC_vi0IC Page 39

HOT Exercise CAN_ - Complete code Edit File CAN.C In the ISR function CAN_viSRN0(void) (almost at the end) _interrupt(can_srn0int) void CAN_viSRN0(void) { uword uwsrn0objhandler; : : while (CAN_MSID0!= 0x0020) { switch(can_msid0){ case 5: // message object 5 interrupt uwsrn0objhandler = CAN_HWOBJ[5].uwMOCTRL; if(uwsrn0objhandler & MOSTAT_RXPND) // if message object 5 receive { // USER CODE BEGIN (SRN0_OBJ5,) IO_vTogglePin(IO_P0_0); U0C0_ASC_vSendData(CAN_MODATA5LL); // USER CODE END : : Page 40

HOT Exercise CAN_ Tasking VX Toolset Build Project Click on Build Project CAN_ Result should be Linking to CAN_.elf Page 4

HOT Exercise CAN_ Connect XC2267 Board Disconnect power supply from the board Connect CAN nodes: Connect wires from node A to node B (connect CAN_L to CAN2_L and CAN_H to CAN2_H) CAN USB CAN 2 Infineon XC2267 Page 42

HOT Exercise CAN_ Tasking EDE Connect XC2287 Easy Kit Connect XC2287 Board to PC Check the DIP Switch Settings on S02: OFF-OFF-OFF-OFF (Start from Internal Flash) Reset The Board (Press The Reset Button) S02 Standard Internal Start configuration ON DIP 2 3 4 USB Reset button Page 43

HOT Exercise CAN_ Start HyperTerminal With the FTDI chip an on board, USB interface can be used for UART. FTDI device will converts the USB protocol the ASC protocol. Both USB and UART can be used at the same time. Open Device Manger and check which COM port is activated for the FTDI chip Page 44

HOT Exercise CAN_ Start HyperTerminal. Start->Programs->Accessories->Communications->HyperTerminal 2. Enter any name and click OK 3. Connect using: COMx (COM port activated for the FTDI chip) 4. Click Configure to enter Port settings 5. Select 9200 baud, no Parity, 8 Data Bits and Stop Bit 6. Click OK Page 45

HOT Exercise CAN_ Tasking VX Toolset Run Debugger Click on Click on Resume and start program 2 Page 46

HOT Exercise CAN_ Running the program Start typing Enter ASCII characters in the HyperTerminal The characters you enter are sent to the XC2287 and back to the Terminal Program so that you can read them on the screen The characters are not sent directly from the keyboard to the screen! Hold the reset button down to verify that the screen no longer displays the typed characters Page 47

HOT Exercise CAN_ Tasking VX Toolset Run Debugger See Results The LED toggles as keys are pressed on the keyboard LED Toggles Page 48

HOT Exercise CAN_ Tasking VX Toolset Run Debugger Verifications Click on Suspend Click on Restart The LED no longer toggles when a key is pressed Click on Resume LED toggles again when a key is pressed Page 49