PXF3306-CANOpen从站实训系统

Shanghai Passiontech Tech, 021-51870017, sales@51Lm.cn

     
     
     

CANOpen从站实训系统


型号: PXF3306


简介:·1 Introduction ·2 System requirements ·3 Content of the Evaluation Kit ·4 Preparation of the ER-ST-EVAL-EVAL evaluation board ·5 Startup of the Example Application ·6 Implemented Functionality ·7 Examples ·7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download ·7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols ·7.3 Testing Heartbeat Pro...
品牌 etherrt etherrt
产地China
型号PXF3306
折扣其他电询

·       1 Introduction

·       2 System requirements

·       3 Content of the Evaluation Kit

·       4 Preparation of the ER-ST-EVAL-EVAL evaluation board

·       5 Startup of the Example Application

·       6 Implemented Functionality

·       7 Examples

·       7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download

·       7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols

·       7.3 Testing Heartbeat Producer and Consumer Functionality

·       8 Order Numbers

·       9 References

Quick Start Guide

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_0.jpg

Protocol Software

Quick Start Guide for STMicroelectronics STM32F107 Evaluation Software on ER-ST-EVAL-EVAL Development Board

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_1.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_2.jpg

IXXAT

Headquarter US Sales Office

IXXAT Automation GmbH IXXAT Inc. Leibnizstr. 15 120 Bedford Center Road D-88250 Weingarten USA-Bedford, NH 03110

Tel.: +49 (0)7 51 / 5 61 46-0 Phone: +1-603-471-0800 Fax: +49 (0)7 51 / 5 61 46-29 Fax: +1-603-471-0880 Internet: www.ixxat.de Internet: www.ixxat.com e-Mail: info@ixxat.de e-Mail: sales@ixxat.com

Support

In case of unsolvable problems with this product or other IXXAT products please contact IXXAT in written form by:

Fax: +49 (0)7 51 / 5 61 46-29 e-Mail: support@ixxat.de

For customers from the USA/Canada

Fax: +1-603-471-0880 e-Mail: techsupport@ixxat.com

Copyright

Duplication (copying, printing, microfilm or other forms) and the electronic distribution of this document is only allowed with explicit permission of IXXAT Automation GmbH. IXXAT Automation GmbH reserves the right to change technical data without prior announcement. The general business conditions and the regulations of the license agreement do apply. All rights are reserved.

Document number: 1.02.0124-ER-ST-EVAL-EVAL Version: 1.0

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_3.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_4.jpg

1 Introduction ....................................................................................7 2 System requirements.....................................................................7 3 Content of the Evaluation Kit ........................................................7 4 Preparation of the ER-ST-EVAL-EVAL evaluation board................8 5 Startup of the Example Application ..............................................9 6 Implemented Functionality ..........................................................11 7 Examples ......................................................................................12

7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download ............................................................................ 12

7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols......................................................... 13

7.3 Testing Heartbeat Producer and Consumer Functionality 15 8 Order Numbers.............................................................................18 9 References....................................................................................18

1 Introduction

The CANopen example application demonstrates the IXXAT CANopen Protocol Software for the STM32F107 micro controller on the ER-ST-EVAL EVAL development board by STMicroelectronics [1]. This evaluation kit has been build using the Keil MDK-ARM by Keil Inc [4], a version build with IAR Embedded Workbench for ARM [5] is available as well.

The functionality implemented in the example application covers CANopen services such as SDO, PDO protocol processing, and heartbeat, as well as simple digital and analog input and output via the on-chip peripherals of the STM32F107 controller and the color TFT mounted on the ER-ST-EVAL-EVAL.

2 System requirements

The CANopen example application requires following components:

·       ER-ST-EVAL-EVAL development board by STMicroelectronics [1]

·       Flash Loader Demonstrator by STMicroelectronics [2] or any other Flash loader tool supporting download of Intel HEX files into the STM32F107

·       CAN interface with a CAN/CANopen bus monitor, for example CAN-to-USB compact and MiniMon V3 or canAnalyser V2.7 by IXXAT Automation GmbH [3]. To follow some of the examples described in this guide, it is required to transmit CAN frames to the ER-ST-EVAL-EVAL.

3 Content of the Evaluation Kit

The IXXAT CANopen slave example for the STM32F107 micro controller respectively the ER-ST-EVAL-EVAL board by STMicroelectronics is supplied as compressed ZIP archive. The archive file contains a downloadable CANopen application in Intel HEX file format, as well as corresponding CANopen device description files both in EDS and XDD format according to CiA 306 and CiA

311. Also included as PDF file are this document and a document describing the terms and conditions under which the evaluation kit is made available.

Figure 1: Content of the STM32F107 CANopen evaluation kit

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_5.jpg

4 Preparation of the ER-ST-EVAL-EVAL evaluation board

After unpacking the archive file, the CANopen slave executable has to be downloaded to the ER-ST-EVAL-EVAL evaluation board. STMicroelectronics provides a free of charge Flash loader demonstrator on their home page that supports connecting to the ER-ST-EVAL-EVAL via a RS232 interface (Figure 2). The Flash loader demonstrator is designed to work with all STMicroelectronics devices that support the system memory boot mode UART protocol. The tool requires Microsoft Windows 2000, XP, Vista or Windows 7.

Please follow the installation instructions in the corresponding documentation provided by STMicroelectronics [2]. To connect to the ER-ST-EVAL-EVAL, the evaluation board must be configured to boot from System Memory (SW1: 0, SW2: 1). Please consult the ER-ST-EVAL-EVAL user manual [1] for details.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_6.jpg

Figure 2: Setup of the RS232 connection to the ER-ST-EVAL-EVAL

After a successful connection the user may proceed until a wizard page requests the selection of the HEX file that shall be downloaded into the Flash memory of the STM32F107.

Select the ER-ST-EVALEVAL.hex file included with the example distribution and continue with Next ( Figure 3). After successful download and verification of the application the boot selection switches can be reset such that the ER-ST-EVAL-EVAL boots from User Flash (SW2: 0) after the next reset or power cycle.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_7.jpg

Figure 3: Selection of the HEX file with the CANopen example application

5 Startup of the Example Application

To start the example application, proceed with the following steps:

1. Set up the hardware.

 Use a suitable adapter to connect the CAN bus to the CAN header CN3 (CAN1) on the ER-ST-EVAL-EVAL board

1.     Connect and start a suitable CAN analyzer tool. Set the bit rate to 125 Kbit/s.

2.     Power-on the evaluation board.

3.     The CANopen example application will display a small welcome note on the color TFT followed by status information on CAN bit rate and used node-ID. Subsequently the example application will attempt to transmit the CANopen NMT boot-up message. The application is build with a fixed node-ID 10d and bit rate of 125 Kbit/s.

5. If the ER-ST-EVAL-EVAL board is not connected to any other active CAN device, the application will continue transmitting its NMT boot-up message and displaying a Wait for ACK.... status message on the color TFT display until any other CAN device acknowledges the NMT boot-up message (Figure 4).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_8.jpg

Figure 4: Startup screen of the CANopen example application

6. Provided that a CAN analyzer such as the IXXAT canAnalyser [3] is connected to the ER-ST-EVAL-EVAL board, the boot-up message will be recorded in the trace window of the analyzer (Figure 5, depicted is the trace window of the CANopen Module for IXXAT canAnalyser 2.7).

The startup screen will now display additional information on Consumer heartbeat and digital respectively analog output status (Figure 6).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_9.jpg

Figure 5: NMT boot-up message of the CANopen example application, data as interpreted by the CANopen Module for canAnalyser V2.7 by IXXAT Automation GmbH Figure 6: Full content of TFT color LCD display

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_10.jpg

6 Implemented Functionality

The IXXAT CANopen Protocol Software example application for the STM32F107 on the ER-ST-EVAL-EVAL evaluation board implements a simple I/O device according to CiA 401CANopen device profile for generic I/O modules. The application starts a CANopen slave device with node-ID 10d on CAN1 at a CAN bit rate of 125 Kbit/s. The following features are implemented:

·       1 × SDO server

·       2 × RPDO (static)

·       2 × TPDO (static)

·       Node guarding

·       Producer heartbeat time, Consumer heartbeat time (1 entry)

·       Error behavior (Communication error)

·       Digital inputs (mapped on joystick U15)

·       Digital outputs (mapped on 3.2” TFT color LCD)

·       Analog input (mapped on potentiometer RV1)

·       Analog output (mapped on 3.2” TFT color LCD)

The default RPDO mapping maps object 6200h sub-index 01h (8 simulated LEDs on 3.2” TFT color LCD, text line Digital Out) on RPDO1, and object 6411h sub-index 01h (Bar graph on 3.2” TFT color LCD, text line Analog Out) on RPDO2.

The default TPDO mapping maps object 6000h sub-index 01h (mapped on joystick U15) on RPDO1, and object 6401h sub-index 01h (mapped on potentiometer RV1) on RPDO2.

7 Examples

7.1 Manipulating LEDs and Bar Graph on Color TFT Display by SDO Download

Digital and analog output data are routed to the TFT color LCD via objects 6200h sub-index 01h, and 6411h sub-index 01h. To manipulate the digital outputs SDO protocols may be used as described below (Figure 7, Figure 8).

Transmit the following message (CAN frame No 1) from a suitable CAN tool:

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_11.jpg

Figure 7: SDO download to node-ID 10d object 6200h sub-index 01h, data 53h

CAN frame No 1 uses the expedited SDO download protocol with CAN-ID 60Ah to write one data byte 53h to the addressed application object. The response frame No 2 with CAN-ID 58Ah confirms the download request.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_12.jpg

Figure 8: Color TFT status after SDO download of value 53h to object 6200h sub-index 01h

Copyright IXXAT Automation GmbH 12 STMicroelectronics STM32F107 Evaluation Kit Version 1.0

Performing a similar operation on the analog output will result in the following screen. Transmit the following frame (TX frame):

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_13.jpg

TX 60Ah 8 2Bh 11h 64h 01h A8h 61h 00h 00h

RX 58Ah 8 60h 11h 64h 01h 00h 00h 00h 00h

The SDO expedited download confirmation corresponds to the RX frame in the table above, the resulting screen after the SDO download will be approximately as shown in Figure 9.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_14.jpg

Figure 9: Color TFT display after SDO downloads of value 61 A8h (25000d) to object 6411h sub-index 01h. Please note the Little-Endian representation of the two Byte data value

For object 6411h sub-index 01h software limits are set to 1000h respectively F000h. Any attempt to write a value outside this range is aborted by the device.

7.2 Manipulating LEDs and Bar Graph on Color TFT Display using PDO Write Protocols

To use PDO protocols the CANopen slave device has to be transferred into NMT state Operational (Figure 10). This is achieved transmitting a NMT start remote node command (CAN frame No 1).

Note that any other CANopen devices present in the network will be addressed as well by frame No 1. Use direct addressing of node-ID 10d (data content 01 0Ah) instead if the NMT broadcast message may interfere with the operation of any other device in the network.

Upon entering NMT state Operational the CANopen slave device will transmit once all its TPDOs with transmission type 255 (frames No 2 and No 3).

Following this you may transmit PDOs with CAN-ID 20Ah – the default CAN-ID for RPDO1 of node-ID 10d according to the CiA 301 Pre-defined connection set – from your CAN tool containing one data byte 5Ah (frame No 4), or with CAN-ID 30Ah – the default CAN-ID for RPDO2 – with two data bytes 00 A0h (note: Little-Endian representation). The resulting screen will be comparable to Figure 11. For reasons of simplicity object 6411h sub-index 01h has been implemented with a dynamic range from 0 – 216 -1.

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_15.jpghttp://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_16.jpg

The examples above can be reproduced with any CAN tool supporting manual configuration and transmission of CAN frames. For a further evaluation of the CANopen slave shipped with the evaluation kit and the possibilities of the CANopen protocol it is recommended to purchase commercial tools such as the IXXAT canAnalyser ( Figure 5, Figure 7, and Figure 10) or the IXXAT CANopen

 Device Manager (Figure 12).

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_17.jpg

7.3 Testing Heartbeat Producer and Consumer Functionality

Another feature offered by the CANopen example application is consumer heartbeat functionality with support for monitoring one CANopen device. To evaluate this functionality one additional CANopen device is required that acts as heartbeat producer.

The following example first resets the CANopen network to obtain a well-defined state. Then, the consumer heartbeat time on our evaluation board with node-ID 10d is configured to expect a heartbeat message transmitted by the additional device every 1200 ms at latest. Node-ID 10d will also be configured to return to NMT state Pre-operational on detection of a communication error. After the producer heartbeat time on the second device has been configured, monitoring starts with the first heartbeat message received by the CANopen device that is monitored and the monitoring status can be observed on the color TFT display.

Assuming that the additional CANopen device uses node-ID 1d, perform the following configuration steps (messages denoted with TX) from your CAN tool:

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_18.jpg

TX

000h

2

81h

00h

Reset remote node all

nodes to obtain a defined

network state (See note in

section 7.2 on NMT

broadcast messages)

RX

701h

1

00h

Boot-up of node-ID 1d

RX

70Ah

1

00h

Boot-up of node-ID 10d

TX

60Ah

8

2Fh

29h

10h

00h

00h

00h

00h

00h

Configure object 1029h

such that on detection of a

communication error node-

ID 10d changes to NMT

state Pre-operational if

currently in NMT state

Operational

RX

58Ah

8

60h

29h

10h

00h

00h

00h

00h

00h

Confirmation of download

TX

60Ah

8

23h

16h

10h

01h

B0h

04h

01h

00h

Configure Consumer

heartbeat time 1 (object

1016h sub-index 01h) on

node-ID 10d such that

node-ID 1d is monitored

with 1200 ms (04 B0h)

RX

58Ah

8

60h

16h

10h

01h

00h

00h

00h

00h

Confirmation of SDO

download. Time and

monitored node-ID are

indicated on the color TFT

(Figure 13a)

TX

601h

8

2Bh

17h

10h

00h

E8h

03h

00h

00h

SDO download of value 03

E8h (1000 ms) to object

1017h on node-ID 1d

RX

581h

8

60h

17h

10h

00h

00h

00h

00h

00h

SDO download response,

node-ID 1d transmits now

its producer heartbeat

message. Node-ID 10d will

detect the heartbeat

message and update the

display (Figure 13b)

TX

000h

2

01h

00h

Start remote node all

nodes (including node-ID

1d), the LED will change to

green (Figure 13c). A bus

monitor will trace heartbeat

messages indicating that

both devices are in NMT

state Operational

TX

000h

2

81h

01h

Reset remote node node-

ID 1d. The power-on

settings for object 1017h

sub-index 00h are reloaded

(typically heartbeat

producer disabled). The

heartbeat monitor on node-

ID 10d detects a heartbeat

error, the LED on the

display changes to red.

Node-ID 10d automatically

enters NMT state Pre

operational (Figure 13d)

(a)

(b)

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_19.jpg

(c) (d)

http://51lm.cn/pdf/ixxat/images/1.02.0124-STM3210C-EVAL_decrypted_img_20.jpg

Figure 13: (a) Consumer heartbeat time (1016h sub-index 01h) on node-ID 10d, monitoring not yet active, (b) first Producer heartbeat message by node-ID 1d received, monitoring active, node-ID 1d in NMT state Preoperational, LED yellow (c) The heartbeat monitor indicates that the monitored device is in NMT state Operational, LED green (d) The heartbeat monitor indicates the detection of a communication error, LED red

8 Order Numbers

1.02.0122.62130

CANopen Slave Protocol Software for STMicroelectronics STM32F107 for Keil MDK-ARM

1.02.0124.62130

CANopen Master/Slave Protocol Software for STMicroelectronics STM32F107 for Keil MDK-ARM

1.02.0122.62430

CANopen Slave Protocol Software for STMicroelectronics STM32F107 for IAR Embedded Workbench for ARM

1.02.0124.62430

CANopen Master/Slave Protocol Software for STMicroelectronics STM32F107 for IAR Embedded Workbench for ARM

1.01.0087.10200

USB-to-CAN compact (SUB-D9 plug); with galvanic isolation

1.02.0157.00000

CANopen Device Manager

1.02.0133.00000

canAnalyser

1.02.0145.00000

CANopen Module for canAnalyser

9 References

[1] STMicroelectronics, http://www.st.com/ , ER-ST-EVAL-EVAL , UM0600 , User manual, ER-ST-EVAL-EVAL evaluation board, Rev 3, STMicroelectronics, October 2009

[2] STM32™ STM8™ Flash loader demonstrator UM0462 , User manual, STM32  STM8  Flash loader demonstrator, Rev7, STMicroelectronics, November 2009

[3] IXXAT Automation GmbH, http://www.ixxat.com/ , CANopen Protocol Software , USB-to-CAN compact , IXXAT CANopen Device Manager , IXXAT canAnalyser

[4] Keil Microcontroller Development Kit (MDK-ARM)

[5] IAR Embedded Workbench® for ARM

 

 


url: http://www.51lm.cn/p/templates/cn/show.php?cid=0&aid=3306

 

电话400-878-1895, 传真:021-51561359 邮箱:sales@51LM.cn
sales@51LM.cn 上海徐汇区斜土路2601号嘉汇广场T1-11B