电子发烧友App

硬声App

0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示
创作
电子发烧友网>电子资料下载>类型>参考设计>EVADM305E-ARDZ软件

EVADM305E-ARDZ软件

2021-03-23 | pdf | 5.6MB | 次下载 | 2积分

资料介绍

This version (03 Jan 2021 21:58) was approved by Robin Getz.The Previously approved version (04 Dec 2019 16:42) is available.Diff

CN0401 SPI to CAN FD Transceiver Demo

The ADuCM3029_demo_cn0401 project provides a solution to adding isolated fieldbus communication to a microcontroller circuit. The project demonstrates basic CAN FD communication, transmission and response to the ISO11898-2:2016 remote wake-up pattern, and control of switchable termination circuitry. The example code is written for the EVAL-ADICUP3029 development platform to control the EVAL-ADM3055E-ARDZ daughter board over the SPI bus interface. The daughter boards main component is the ADM3055E, an isolated signal and power CAN FD transceiver with integrated auxiliary channel.

General Description/Overview

The ADuCM3029_demo_cn0401 project uses the EVAL-ADM3055E-ARDZ to provide CAN FD bus connectivity to underlying development board that it may be added to an existing CAN FD bus as another node. This example demonstrates the EVAL-ADM3055E-ARDZ circuit features using two nodes, each a EVAL-ADM3055E-ARDZ and EVAL-ADICUP3029 development board.

The node is at first in low power mode by putting the CAN controller and transceiver to standby mode. The user can then issue a command to transmit an ASCII message on the bus. the message is repeated for 5 seconds or until it is acknowledged by another node, then the transmitting node goes to standby. If the system receives a message, particularly the slower baud rate arbitration phase, it wakes up, receives the message and displays it on the CLI terminal, then goes back to standby. A node not connected to a CAN bus can also run a self-test routine on the command of the user, in which it transmits and receives a message in loopback mode and displays a PASS of FAIL message. The initial baud rate is 500KHz for the arbitration phase and 2MHz for the data phase and the application acknowledges messages with the Standard ID (SID) of 0x300. The SID can be changed by user commands.

The application is controlled by the user with a CLI implemented using the serial UART core in the ADuCM3029 controller. The CLI is displayed on a connected PC using a serial terminal connection.

The program is divided in 2 parts: the setup part in which the present module is discovered and the main process.  Main flow chart

To replicate the CAN FD bus described in the example both boards need to be connected to each other via the P1 or P4 connectors on the board and each in turn connected to the Arduino form factor headers of the ADICUP3029. Then each ADICUP3029 needs to be connected to the PC via USB to provide serial terminal CLI interface for each node.

Demo Requirements

The following is a list of items needed in order to replicate this demo.

  • Hardware
    • EVAL-ADICUP3029 (Qty 2)
    • EVAL-ADM3055E-ARDZ (Qty 2)
    • Micro USB to USB cable
    • Dual WR-DSUB connector cable or twisted pair cable
    • PC or Laptop with a USB port
The circuit might need an external power supply of 5V to run in some circumstances.

Setting up the Hardware

  1. Connect EVAL-ADM3055E-PMDZ board to the EVAL-ADICUP3029 as seen in the pictures below:
  2. Connect the boards with each other with either a WR-DSUB cable or a pair of wires:
  3. Connect a micro-USB cable to P10 connector of each of the the EVAL-ADICUP3029 boards and connect them to a computer.

Configuring the Software

Most of the configuration parameters can be found in the CAN controller API module. The CAN controller API will instantiate a handler that will determine the initial configuration of the node. The handler is instantiated by the initialization structure with the following form:

struct can_ctrl_init_param {
	struct spi_init_param can_ctrl_spi_init;
	bool con_iso_crc_en;
	bool con_store_in_tef_en;
	bool con_txq_en;
	uint8_t tef_fifo_size; /* Number of messages in TEF FIFO*/
	bool tef_time_stamp_en;
	enum can_ctrl_fifo_plsize txq_plsize;
	uint8_t txq_fifo_size; /* Number of messages in TXQ FIFO */
	uint8_t txq_tx_priority; /* 0 is lowest; 0x1f is highest */

	uint8_t tx_fifo_nr;
	enum can_ctrl_fifo_plsize tx_fifo_plsize;
	uint8_t tx_fifo_size; /* Number of messages in FIFO */
	uint8_t tx_fifo_priority; /* 0 is lowest; 0x1f is highest */

	uint8_t rx_fifo_nr;
	enum can_ctrl_fifo_plsize rx_fifo_plsize;
	uint8_t rx_fifo_size; /* Number of messages in FIFO */
	bool rx_fifo_tsen;

	uint8_t rx_flt_nr;
	uint16_t rx_sid_addr;

	enum can_ctrl_nominal_bitrate can_nbt;
	enum can_ctrl_data_bitrate can_dbt;
	enum can_ctrl_ssp_mode ssp_mode;
};

The following is a non-exhaustive list that contains the most important parameters and their values:

  • can_dbt - Data bit rate; values are contained into the following enum:
 enum can_ctrl_data_bitrate {
	BITRATE_DBT_500K,
	BITRATE_DBT_833K,
	BITRATE_DBT_1M,
	BITRATE_DBT_1M5,
	BITRATE_DBT_2M,
	BITRATE_DBT_3M,
	BITRATE_DBT_4M,
	BITRATE_DBT_5M,
	BITRATE_DBT_6M7,
	BITRATE_DBT_8M,
	BITRATE_DBT_10M
}; 
  • can_nbt - Nominal bit rate; values are contained into the following enum:
 enum can_ctrl_nominal_bitrate {
	BITRATE_NBT_125K,
	BITRATE_NBT_250K,
	BITRATE_NBT_500K,
	BITRATE_NBT_1M
}; 
  • rx_fifo_nr - Number of the FIFO that will function as a RX FIFO. Between 1 and 31 when using TXQ and 0 and 31 hen not using TXQ.
  • rx_fifo_plsize - Payload size for input messages. CAN FD supports up to 64 bytes.
  • rx_fifo_size - Number of messages that will trigger an interrupt. Set to 1 to interrupt after every message.
  • rx_fifo_tsen - Enable/Disable timestamp for messages received in this FIFO.
  • rx_flt_nr - ID of the input filter active for this FIFO. can be between 0 and 7.
  • rx_sid_addr - SID value of the input filter. Only messages that contain this specific SID will be received in the attached FIFO. Can be between 0 and 0x3FF.
  • tx_fifo_nr - Number of the FIFO that will function as a TX FIFO. Between 1 and 31 when using TXQ and 0 and 31 hen not using TXQ.
  • tx_fifo_plsize - Payload size for output messages. CAN FD supports up to 64 bytes.
  • tx_fifo_size - Number of messages that need to be setup before transmission starts. Set to 1 to interrupt after every message.

These parameters can be changed in the can_ctrl_get_config function from the can_obj_layer.c file.

Outputting Data

A serial terminal is an application that runs on a PC or laptop that is used to display data and interact with a connected device (including many of the Circuits from the Lab reference designs). The device's UART peripheral is most often connected to a UART to USB interface IC, which appears as a traditional COM port on the host PC/ laptop. (Traditionally, the device's UART port would have been connected to an RS-232 line driver / receiver and connected to the PC via a 9-pin or 25-pin serial port.) There are many open-source applications, and while there are many choices, typically we use one of the following:

Before continuing, please make sure you download and install one of the above programs.

There are several parameters on all serial terminal programs that must be setup properly in order for the PC and the connected device to communicate. Below are the common settings that must match on both the PC side and the connected UART device.

  1. COM Port - This is the physical connection made to your PC or Laptop, typically made through a USB cable but can be any serial communications cable. You can determine the COM port assigned to your device by visiting the device manager on your computer. Another method for identifying which COM port is associated with a USB-based device is to look at which COM ports are present before plugging in your device, then plug in your device, and look for a new COM port.
  2. Baud Rate - This is the speed at which data is being transferred from the connected device to your PC. These parameters must be the same on both devices or data will be corrupted. The default setting for most of the reference designs in 115200.
  3. Data Bits - The number of data bits per transfer. Typically UART transmits ASCII codes back to the serial port so by default this is almost always set to 8-Bits.
  4. Stop Bits - The number of “stop” conditions per transmission. This usually set to 1, but can be set to 2 for redundancy.
  5. Parity - Is a way to check for errors during the UART transmission. Unless otherwise specified, set parity to “none”.
  6. Flow Control - Is a way to ensure that data lose between fast and slow devices on the same UART bus are not lost during transmission. This is typically not implemented in a simple system, and unless otherwise specified, set to “none”.

In many instances there are other options that each of the different serial terminal applications provide, such as local line echo or local line editing, and features like this can be turned on or off depending on your preferences. This setup guide will not go over all the options of each tool, but just the minor features that will make it easier to read back data from the connected devices.

Example setup using Putty

  1. Plug in your connected device using a USB cable or other serial cable.
  2. Wait for the device driver of the connected device to install on your PC or Laptop.
  3. Open your device manager, and find out which COM port was assigned to your device.
  4. Open up your serial terminal program (Putty for this example)
  5. Click on the serial configuration tab or window, and input the settings to match the requirements of your connected device. The default baud rate for most of the reference designs is 115200. Make sure that is the selected baud rate as well.
  6. Ensure that local echo and line editing are enabled, so that you can see what you type and are able to correct mistakes. (Some devices may echo typed characters - if so, you will see each typed character twice. If this happens, turn off local echo.)
  7. Click on the open button, and as long as your connected device and serial terminal program are setup the same, than you should see data displaying.
Hint: If you see nothing in the serial terminal, try hitting the reset button on the embedded development board.

Available commands

Typing help or h after initial calibration sequence will display the list of commands and their short versions. Bellow is the short command list:

Command Example Description
General commands
h h Display available commands.
Communication commands
ct <msg> ct Hello world! Send a message through the CAN bus.
<msg> = Message to be sent.
css <sid> css 245 Set standard ID for the CAN messages sent.
<sid> = Standard ID in hexadecimal; between 0x000 and 0x3FF.
cg ct Get received messages if any.
test test Perform a loopback test.
  • For the “h”, “cg” and “test” commands press Enter without inserting any space afterwards.
  • For the “ct” and “css” commands, to invoke in application instructions, write just the command without parameters, insert a space afterwards and press Enter.


Obtaining the Source Code

We recommend not opening the project directly, but rather import it into CrossCore Embedded Studios and make a local copy in your workspace.

The source code and include files of the ADuCM3029_demo_cn0401 can be found here:

How to use the Tools

The official tool we promote for use with the EVAL-ADICUP3029 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.

Importing

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.

Debugging

For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.

Project Structure

Project structure includes:

  • CAN controller API module: can_obj_layer.c, can_obj_layer.h;
  • Main file ADuCM3029_demo_cn0401.c
  • Application module with files: cn0401.c, cn0401.h;
  • CLI module with files: cli.c, cli.h;
  • SPI platform driver module: spi.c, spi.h;
  • System delays module: delay.c, delay.h;
  • GPIO platform driver module: gpio.c, gpio.h;
  • External interrupts module: interrupt.c, interrupt.h;
  • UART platform driver module: uart.c, uart.h;
  • Platform drivers header: platform_drivers.h;
  • Error header: error.h;
  • Power core initialization module with files: power.c, power.h;
  • Timer and delay driver module with files: timer.c, timer.h.

End of Document

下载该资料的人也在下载 下载该资料的人还在阅读
更多 >

评论

查看更多

下载排行

本周

  1. 1电子电路原理第七版PDF电子教材免费下载
  2. 0.00 MB  |  1491次下载  |  免费
  3. 2单片机典型实例介绍
  4. 18.19 MB  |  95次下载  |  1 积分
  5. 3S7-200PLC编程实例详细资料
  6. 1.17 MB  |  27次下载  |  1 积分
  7. 4笔记本电脑主板的元件识别和讲解说明
  8. 4.28 MB  |  18次下载  |  4 积分
  9. 5开关电源原理及各功能电路详解
  10. 0.38 MB  |  11次下载  |  免费
  11. 6100W短波放大电路图
  12. 0.05 MB  |  4次下载  |  3 积分
  13. 7基于单片机和 SG3525的程控开关电源设计
  14. 0.23 MB  |  4次下载  |  免费
  15. 8基于AT89C2051/4051单片机编程器的实验
  16. 0.11 MB  |  4次下载  |  免费

本月

  1. 1OrCAD10.5下载OrCAD10.5中文版软件
  2. 0.00 MB  |  234313次下载  |  免费
  3. 2PADS 9.0 2009最新版 -下载
  4. 0.00 MB  |  66304次下载  |  免费
  5. 3protel99下载protel99软件下载(中文版)
  6. 0.00 MB  |  51209次下载  |  免费
  7. 4LabView 8.0 专业版下载 (3CD完整版)
  8. 0.00 MB  |  51043次下载  |  免费
  9. 5555集成电路应用800例(新编版)
  10. 0.00 MB  |  33562次下载  |  免费
  11. 6接口电路图大全
  12. 未知  |  30320次下载  |  免费
  13. 7Multisim 10下载Multisim 10 中文版
  14. 0.00 MB  |  28588次下载  |  免费
  15. 8开关电源设计实例指南
  16. 未知  |  21539次下载  |  免费

总榜

  1. 1matlab软件下载入口
  2. 未知  |  935053次下载  |  免费
  3. 2protel99se软件下载(可英文版转中文版)
  4. 78.1 MB  |  537793次下载  |  免费
  5. 3MATLAB 7.1 下载 (含软件介绍)
  6. 未知  |  420026次下载  |  免费
  7. 4OrCAD10.5下载OrCAD10.5中文版软件
  8. 0.00 MB  |  234313次下载  |  免费
  9. 5Altium DXP2002下载入口
  10. 未知  |  233046次下载  |  免费
  11. 6电路仿真软件multisim 10.0免费下载
  12. 340992  |  191183次下载  |  免费
  13. 7十天学会AVR单片机与C语言视频教程 下载
  14. 158M  |  183277次下载  |  免费
  15. 8proe5.0野火版下载(中文版免费下载)
  16. 未知  |  138039次下载  |  免费