ECAN-401 User Manual-EN V1.1 PDF
ECAN-401 User Manual-EN V1.1 PDF
ECAN-401 User Manual-EN V1.1 PDF
CONTENTS
1. PRODUCT OVERVIEW......................................................................................................................................................................... 4
1.1 BRIEF INTRODUCTION..................................................................................................................................................................... 4
1.2 FEATURE.............................................................................................................................................................................................. 4
1.3 APPLICATION...................................................................................................................................................................................... 5
2. PRODUCT SPECIFICATIONS AND CHARACTERISTICS................................................................................................................6
2.1 BASIC PARAMETERS.......................................................................................................................................................6
2.2 FACTORY DEFAULT PARAMETERS................................................................................................................................... 6
3. HARDWARE PARAMETER DESIGN INTRODUCTION................................................................................................................... 7
3.1 DESIGN INTRODUCTION................................................................................................................................................. 7
3.2 DIMENSIONS.................................................................................................................................................................. 8
3.3 CONNECTION METHOD...................................................................................................................................................9
3.3.1 RS485 connection method...................................................................................................................................... 9
3.3.2 RS422 connection method...................................................................................................................................... 9
3.3.3 RS232 connection method.................................................................................................................................... 10
3.3.4 CAN connection method....................................................................................................................................... 10
4. MODE DESCRIPTION......................................................................................................................................................................... 11
4.1 DATA CONVERSION METHOD........................................................................................................................................11
4.1.1 Transparent conversion mode.............................................................................................................................. 11
4.1.2 Transparent transmission with logo mode........................................................................................................... 14
4.1.3 Protocol mode...................................................................................................................................................... 16
4.1.4 Modbus mode....................................................................................................................................................... 18
4.1.5 Custom protocol mode..........................................................................................................................................20
5. AT COMMAND.....................................................................................................................................................................................23
5.1 ENTER AT COMMAND.................................................................................................................................................. 23
5.2 EXIT AT COMMAND..................................................................................................................................................... 23
5.3 QUERY VERSION.......................................................................................................................................................... 24
5.4 RESTORE DEFAULT PARAMETERS................................................................................................................................. 24
5.5 ECHO SETTINGS........................................................................................................................................................... 24
5.6 SERIAL PORT PARAMETERS.......................................................................................................................................... 25
5.7 SETTING/QUERYING CAN INFORMATION.................................................................................................................... 26
5.8 SETTING/QUERYING MODULE CONVERSION MODE....................................................................................................26
5.9 SET/QUERY THE FILTERING MODE OF THE CAN BUS...................................................................................................27
5.10 SET/QUERY FRAME HEADER AND FRAME END DATA.................................................................................................. 27
5.11 SETTING/QUERYING IDENTIFICATION PARAMETERS.................................................................................................. 27
5.12 SETTING/QUERYING IDENTIFICATION PARAMETERS.................................................................................................. 28
5.13 SET/QUERY TRANSMISSION DIRECTION......................................................................................................................28
5.14 SETTING/QUERYING FILTER PARAMETERS................................................................................................................ 29
5.15 DELETE THE FILTER PARAMETERS THAT HAVE BEEN SET........................................................................................... 29
6. REVISION HISTORY........................................................................................................................................................................... 30
ABOUT US................................................................................................................................................................................................ 30
Disclaimer
EBYTE reserves all rights to this document and the information contained herein.
Products, names, logos and designs described herein may in whole or in part be
third parties of this document or any part thereof without the express permission of
The information contained herein is provided “as is” and EBYTE assumes no
liability for the use of the information. No warranty, either express or implied, is given,
including but not limited, with respect to the accuracy, correctness, reliability and
fitness for a particular purpose of the information. This document may be revised by
Note:
The contents of this manual are subject to change due to product version upgrades
make changes to the contents of this manual without notice or suggestion.This manual
serves only as a user guide and Chengdu Ebyte Electronic Technology Co.,Ltd.
Electronics Co., Ltd. does not ensure that the contents are completely error-free and
that all statements, information and suggestions in this manual do not constitute any
1. Product Overview
ECAN-401 is a small intelligent protocol conversion product independently developed by Chengdu Ebyte
Electronic Technology Co., Ltd. The product uses 8V ~ 28V wide voltage power supply,
1.2 Feature
1.3 Application
3.2 Dimensions
The linear topology is the most commonly used in the CAN bus wiring specification. That is, the two lines of the main
trunk branch out branch lines to each node. Both ends of the backbone are equipped with suitable terminal resistors to
achieve impedance matching (usually 120 ohms within 2km).
4. Mode Description
In "transparent conversion" and "format conversion", one byte of frame information is used to identify some information
of the CAN frame, such as type, format, length, etc. The frame information format is as follows.
Frame information description
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
FF RTR NO NO DLC3 DLC2 DLC1 DLC0
Table 1.1 Frame information
FF: the identification of standard frame and extended frame, 0 is standard frame, 1 is extended frame;
RTR: identification of remote frame and data frame, 0 is data frame, 1 is remote frame;
NO: not used;
NO: not used;
DLC3~DLC0: Identifies the data length of the CAN message;
ECAN-401 device supports five data conversion methods: transparent conversion, transparent conversion with logo,
protocol conversion, MODBUS conversion and custom protocol conversion. Support two-way conversion between CAN
and RS485/RS232/RS422.
Data conversion method Switch direction
Transparent conversion CAN and RS485 bidirectional conversion
Transparent band information CAN and RS485 bidirectional conversion
conversion
Protocol conversion CAN and RS485 bidirectional conversion
MODBUS conversion CAN and RS485 bidirectional conversion
on
Serial User
Frame ID
frame configurati
on
0 data 1 User
configurati
on
1 data 2 data 1
2 data 3 data 2
3 data 4 data 3
4 data 5 Data field data 4
5 data 6 data 5
6 data 7 data 6
7 data 8 data 7
data 8
Convert serial frame into CAN message (transparent mode)
Conversion example:
The serial frame is converted into a CAN message (transparent mode).
Assuming that the configuration CAN frame information is "standard frame", frame ID: "0x0213, serial frame data is
0x01 ~ 0x0C, then the conversion format is as follows. The frame ID of the CAN message is 0x0213 (user configuration),
frame type: standard Frame (user configuration), the data part of the serial frame will be converted to the CAN message
without any modification.
Serial
CAN Message 1 CAN Message 2
frame
0x01 Frame information 0x08 0x04
0x02 0x02 0x02
Frame ID
0x03 0x13 0x13
0x04 0x01 0x09
0x05 0x02 0x0A
0x06 0x03 0x0B
0x07 0x04 0x0C
0x08 0x05
0x09 0x06
0x0A 0x07
0x0B 0x08
Data field
0x0C
data 1 0 data 1
data 2 1 data 2
data 3 2 data 3
data 4 3 data 4
Data field
data 5 4 data 5
data 6 5 data 6
data 7 6 data 7
data 8 7 data 8
Conversion example:
The CAN message "frame information" is enabled and "frame ID" is enabled in this example configuration. Frame ID1:
0x123, frame type: standard frame, frame type: data frame. Conversion direction: two-way. The data is 0x12, 0x34, 0x56,
0x78, 0xab, 0xcd, 0xef, 0xff. The data before and after conversion is as follows:
CAN Message Serial frame
Frame
informati 0x08 0x08
on
0x01 0x01
Frame ID
0x23 0x23
0x12 0x12
0x34 0x34
Data field
0x56 0x56
0x78 0x78
0xAB 0xAB
0xCD 0xCD
0xEF 0xEF
0xFF 0xFF
Note: If the ID length is greater than 2, the frame type sent by the device will be set as an extended frame. At this time,
the frame ID and frame type configured by the user are invalid and are determined by the data in the serial frame. The
frame ID range of the standard frame is: 0x000-0x7ff, which are respectively represented as frame ID1 and frame ID0,
where frame ID1 is the high byte, and the frame ID range of extended frames is: 0x00000000-0x1fffffff, which are
represented as frame ID3, frame ID2, and Frame ID1, frame ID0, among which frame ID3 is the high byte
Serial frame CAN Message CAN Message x
Frame User
User
0 Data 1(ID1) informati configurati
configuration
on on
6 Data 7 Data 6
7 Data 8 Data 7
… … Data 8
N Data N Data 9
Address
Data N Data 10
N
Serial frame is converted into CAN message (transparent transmission with identification)
Conversion example:
Serial frame to CAN message (transparent with logo).
CAN configuration parameters configured in this example. Conversion mode: Transparent conversion with logo, starting
address 2, length 3. Frame type: extended frame, frame ID: no configuration required, conversion direction: two-way.
The data before and after conversion is as follows.
ID1 ID0
Frame ID
ID0 Data 1
Data 1 Data 2
Data 2 Data 3
Data 3 Data 4
Data 4 Data 5
Data field
Data 5 Data 5
Data 5 Data 7
Data 7 Data 8
Data 8
Convert CAN messages to serial frames
Conversion example:
CAN configuration parameters configured in this example. Conversion mode: Transparent conversion with logo, starting
address 2, length 3. Frame type: extended frame, frame type: data frame. Conversion direction: two-way. Send identifier:
0x00000123, then the data before and after conversion is as follows.
on
1Byte 4Byte 8Byte
Segment
Segment type Segment counter
mark
Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Segmented message tag: indicates whether the message is a segmented message. If this bit is 0, it means a separate
message, and it is 1 it means
Belongs to a frame in the segmented message.
Segment type: Indicate whether it is the first paragraph, the middle paragraph or the last paragraph.
Place
meaning illustrate
value
First If the segment counter contains the value 0, then this
0
segment is the first segment in the segment series
Middle
1 Indicates that this is an intermediate segment
segment
Last
2 Mark the last segment
segment
Segment counter: The mark of each segment indicates the sequence number of the segment in the entire message. If it is
the number of segments, the value of the counter is the number. In this way, it is possible to verify whether any segments
are missing when receiving. 5Bit is used in total, and the range is 0~31.
No 7 6 5 4 3 2 1 0
Frame
FF RTR EDL BRS DLC(Data length)
information
Segmen
Data 1 Segment type Segment counter
t mark
Data 2 DATE
Data 3 DATE
Data 4 DATE
Data 5 DATE
Data 6 DATE
Data 7 DATE
Data 8 DATE
1. Convert serial frame to can message
The serial interface adopts the standard Modbus RTU protocol, so the user frame only needs to comply with this protocol.
If the transmitted frame does not conform to the Modbus RTU format, the module will discard the received frame
without converting it.
2. can message to serial frame
For the Modbus protocol data of the CAN bus, there is no need to do cyclic redundancy check (CRC16), the module
receives according to the segmentation protocol, and automatically adds the cyclic redundancy check (CRC16) after
receiving a frame analysis, and converts it into Modbus RTU frame to send To the serial bus. If the received data does not
conform to the segmentation protocol, the group of data will be discarded without conversion.
Modbus RTU CAN CAN CAN Message
Frame Message Message 1 x
Address domain Frame Frame Frame
Information Information Information
function code Frame ID3 0x00 0x00
Frame ID2 0x00 0x00
Data field Frame ID1 0x00 0x00
Frame ID0 Frame ID Frame ID (user
(user setting) setting)
CRC field Data 1 [Use of [Use of
Segmented Segmented
Protocol] Protocol]
Data 2 Address field
Data 3
Data 4
Data 5
Data 6 Data field Data field
Data 7
Data 8
Conversion example:
CAN CAN
Modbus RTU Serial CAN
Messag Message
Frame frame Message
e1 c2
Frame
Address
55 Informat 08 02
field
ion
Frame
function code 0F 00 00
ID3
Frame
00 00 00
ID3
Frame
00 00 00
ID1
Frame Frame Frame
Data field 00
ID0 ID ID
04 Data 1 81 C2
02 Data 2 55 00
00 Data 3 0F 00
00 Data 4 00
29 Data 5 00
CRC Field
13 Data 6 00
Data 7 04
Data 8 02
excluding the end of the serial frame. Frame information is divided into extended frames and standard frames. The
standard frame is fixed as 0x00, and the extended frame is fixed as 0x80, which is different from transparent conversion
and transparent conversion with identification. In custom protocol conversion, regardless of the data length contained in
the data field of each frame How much, the content of the frame information is fixed. When the frame type is a standard
frame (0x00), the last two bytes of the frame type represent the frame ID, with the high order first; when the frame
information is an extended frame (0x80), the last 4 bytes of the frame type represent the frame ID, where High ranking
first.
Note: In the custom protocol conversion, regardless of the data length contained in the data field of each frame, the frame
information content is fixed. It is fixed as standard frame (0x00) or extended frame (0x80). The frame ID needs to
conform to the ID range, otherwise the ID may be wrong.
Serial frame CAN Message
Serial User Frame
frame configuratio informati Frame information
header n on
Frame Frame
Frame ID1
length length
Frame
Frame
Frame ID
informatio Frame ID0
information
n
Frame ID1 Data 1
Frame ID
Frame ID0 Data 2
Data 0 Data 3
Data 1 Data Data 4
... field Data 5
Data field Data 6 Data 6
Data 7 Data 7
Data 8 Data 8
User
Serial end
configuratio
of frame
n
2. Convert CAN message to serial frame
CAN bus message receives a frame and then forwards a frame. The module will convert the data in the CAN message
data field in turn, and at the same time add frame header, frame length, frame information and other data to the serial
frame, which is actually a serial frame Transfer the reverse form of CAN message.
CAN Message Serial frame
Frame Serial
Frame
informat frame User configuration
information
ion header
Frame
Frame ID1 Frame length
Frame length
ID Frame
Frame ID0 Frame information
information
Data Data 1 Frame ID Frame ID1
Frame
Serial frame
AA informatio 00
header
n
Frame length 07 01
Frame Frame ID
00 23
information
01 11
Frame ID
23 22
Data field
11 33
22 44
Data field
33
44
Serial end of
FF
frame
5. AT Command
1. Enter AT command mode: send +++ via serial port, send AT again within 3 seconds, the device will return AT MODE,
then enter AT command mode.
2. If there is no special instruction, all subsequent AT command operations need to add "\r\n".
3. All examples are performed with the command echo function turned off.
4. After setting the parameters, you need to restart the device to make the set parameters take effect.
Error code table:
Command AT
Function Enter AT command mode
Send AT
Back <CR><LF>+OK<CR><LF>
【Example】
Send: +++ // no line break
Send: AT // no line break
Response: <CR><LF>AT MODE<CR><LF>
Command EXAT
Function Exit AT command mode
Setting AT+EXAT<CR><LF>
Back <CR><LF>+OK<CR><LF>
【Example】
Send: AT+EXAT\r\n
Response: <CR><LF>+OK<CR><LF>
Command VER?
Function Query firmware version
Inquire AT+VER?<CR><LF>
Back <CR><LF> VER=x.x<CR><LF>
Remark x.x version number
【Example】
Send: AT+VER? \r\n
Response: <CR><LF> VER=x.x <CR><LF>
Command RESTORE
Function Restore the default parameters of the device (factory parameters)
Setting AT+RESTORE<CR><LF>
Back <CR><LF>+OK<CR><LF>
Remark Need to restart the device for the parameters to take effect
【Example】
Send: AT+RESTORE \r\n
Response: <CR><LF>+OK<CR><LF>
Command E
Function User command echo setting/query
Setting AT+E=ON<CR><LF><CR><LF>
Back <CR><LF>+OK<CR><LF>
Remark ON OFF
【Example】
set up:
Send: AT+E=OFF\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+E?\r\n
Response: <CR><LF>+OK<CR><LF>
Command UART
Function Set the serial communication parameters of the module
Setting AT+UART=baud,date,stop,parity,flowcontrol
Back <CR><LF>+OK=<snString><CR><LF>
Inquire AT+UART?
Baud(Serial port baud rate):
600,1200,2400,4800,9600,14400,19200,38400,43000,57600, 76800,
115200, 128000, 230400, 256000, 460800, 921600 单位:bps
Parameter date: 8
stop: 1,2
parity: NONE,EVEN,ODD.
flowcontrol:NFC(No flow control ), FC(Flow Control ),
【Example】
set up:
Send: AT+UART=115200,8,1,EVEN,NFC\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+UART?\r\n
Response: <CR><LF>+OK<CR><LF> AT+UART=115200,8,1,EVEN,NFC <CR><LF>
Command CAN
Function Set CAN interface communication parameters
Setting AT+CAN =baud,id,mode<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+CAN?
Baud(CANBaud rate ):
6K,10K,20K,50K,100K,120K,125K,150K,200K,250K, 400K, 500K,
600K, 750K, 1000K unit :bps
Parameter
id (Frame ID): 0~7FF(Standard frame ) , 0~1FFFFFFF(Extended frame )
mode:(Frame category ):NDTF(Standard frame ),EDTF(Extended
frame )
【Example】
set up:
Send: AT+CAN=100,70,NDTF\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ CAN?\r\n
Response: <CR><LF>+OK<CR><LF> AT+CAN=100,70,NDTF <CR><LF>
Command MODE
Function Set/query module conversion mode
Setting AT+ MODE=mode<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+MODE?
mode (Module working mode ):TRANS(transparent ),
Parameter TPRTL(Transparent with logo ), PROTOL(Protocol mode ),
USER(Custom protocol ), MODBUS(MODBUS),
【Example】
set up:
Send: AT+CANLT=ETF\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ CANLT?\r\n
Response: <CR><LF>+OK<CR><LF> AT+CANLT=ETF<CR><LF>
Command CANLT
Function Set/query the filtering method of CAN bus
Setting AT+CANLT =mode<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+CANLT?
mode (Filter mode ):OFF(Receive all functions), ETF(Only receive
Parameter extended frames ),
NTF(Only receive standard frames ), USER (customize )
【Example】
set up:
Send: AT+MODE=MODBUS\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ MODE?\r\n
Response: <CR><LF>+OK<CR><LF>AT+MODE=MODBUS <CR><LF>
Command UDMHT
Function Set/query frame header and end data in custom mode
Setting AT+UDMHT=head,tail<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+ UDMHT?
Parameter head (Header data ),tail (End-of-frame data ). data range 0~0xFF
【Example】
Settings: Set the frame header data to FF and the frame end data to 55
Send: AT+UDMHT=FF,55 \r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+UDMHT?\r\n
Response: <CR><LF>+OK<CR><LF> AT+UDMHT=FF,55<CR><LF>
Command RANDOM
Function Set/query query identification parameters
Setting AT+RANDOM = idLength, idLocation <CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+RANDOM?
idLength (Frame header ID length ),idLocation (Frame ID position )。
Parameter
Data range: length range 0-4 position 0-7
【Example】
Settings: Set the frame ID length to 4, position 2
Send: AT+RANDOM=4,2 \r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ RANDOM?\r\n
Response: <CR><LF>+OK<CR><LF> AT+RANDOM=4,2 <CR><LF>
Command MSG
Function Set/query frame ID frame information enable
Setting AT+MSG =flag_id, flag_type<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+MSG?
Parameter flag_id (frame header data), tail (frame tail data). Data range 0~0xFF
【Example】
Settings: enable frame ID, frame information
Send: AT+MSG=1,1 \r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ MSG?\r\n
Response: <CR><LF>+OK<CR><LF> AT+MSG=1,1<CR><LF>
Command DIRECTION
Function Set/query frame ID frame information enable
Setting AT+DIRECTION= parameter<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+ DIRECTION?
parameter (direction parameter), UART-CAN (serial port to can).
Parameter
CAN-UART (CAN to serial port) BOTHWAY (two-way)
【Example】
Setting: Only convert serial port data to can bus
Send: AT+DIRECTION=UART-CAN\r\n
Response: <CR><LF>+OK<CR><LF>
Inquire:
Send: AT+ DIRECTION?\r\n
Response: <CR><LF>+OK<CR><LF> AT+DIRECTION=UART-CAN <CR><LF>
Command FILTER
Function Set/query filter frame information
Setting AT+FILTER=id_type,date<CR><LF>
Back <CR><LF>+OK<CR><LF>
Inquire AT+FILTER?
type (frame type), date (frame data) type: NDTF represents this command
Parameter is a standard ID, EDTF represents this command is an extended frame ID
date: ID data.
【Example】
Settings: Set frame filtering parameters: standard frame ID, 719
Send: AT+LFILTER=NDTF,719 \r\n
Response: <CR><LF>+OK<CR><LF>
Query: Will return all IDs that have been set
Send: AT+ FILTER?\r\n
Response: <CR><LF>+OK<CR><LF> AT+LFILTER=NDTF,719 <CR><LF>
Command DELFILTER
Function Set/query filter frame information
Setting AT+DELFILTER=id_type,date<CR><LF>
Back <CR><LF>+OK<CR><LF>
type (frame type), date (frame data)
NDTF: Represents this command as a standard ID, EDTF represents this
Parameter
command as an extended frame ID.
date: ID data.
【Example】
Setting: delete filter parameter: standard frame 719
Send: AT+DELFILTER=NDTF,719 \r\n
Response: <CR><LF>+OK<CR><LF>
6. Revision history
About us