-
Notifications
You must be signed in to change notification settings - Fork 0
1. Command List
----------------------------------------------------------------------------------------------------
CMD | SUPPORT | SYNTAX | DESCRIPTION
----------------------------------------------------------------------------------------------------
'S' | YES | Sn[CR] | Setup with CANFD nominal bit rate where n is 0-8.
| | | S0 10Kbps S3 100Kbps S6 500Kbps
| | | S1 20Kbps S4 125Kbps S7 800Kbps
| | | S2 50Kbps S5 250Kbps S8 1Mbps
's' | YES+ | sddxxyyzz[CR] | Setup CANFD nominal bit rate and bit timing,
| | | where dd, xx, yy and zz are hex values.
'Y' | YES+ | Yn[CR] | Setup with CANFD data bit rate where n is 0-2, 4, 5, 8.
| | | Y0 500Kbps Y3 3Mbps (N/A) Y6 6Mbps (N/A)
| | | Y1 1Mbps Y4 4Mbps Y7 7Mbps (N/A)
| | | Y2 2Mbps Y5 5Mbps Y8 8Mbps
'y' | YES+ | yddxxyyzz[CR] | Setup CANFD data bit rate and bit timing,
| | | where dd, xx, yy and zz are hex values.
'O' | YES | O[CR] | Open the CANFD channel in normal mode.
| | | Both sending & receiving are enabled.
'L' | YES | L[CR] | Open the CANFD channel in listen only mode.
| | | Only receiving is enabled.
'C' | YES | C[CR] | Close the CANFD channel.
'r' | YES | riiil[CR] | Transmit a base remote frame.
'R' | YES | Riiiiiiiil[CR] | Transmit an extended remote frame.
't' | YES | tiiildd...[CR] | Transmit a classical base data frame.
'T' | YES | Tiiiiiiiildd...[CR] | Transmit a classical extended data frame.
'd' | YES+ | diiildd...[CR] | Transmit a FD base data frame without bit rate switch.
'D' | YES+ | Diiiiiiiildd...[CR] | Transmit a FD extended data frame without bit rate switch.
'b' | YES+ | biiildd...[CR] | Transmit a FD base data frame with bit rate switch.
'B' | YES+ | Biiiiiiiildd...[CR] | Transmit a FD extended data frame with bit rate switch.
'P' | - | P[CR] | Poll incoming FIFO for CAN frames (single poll).
'A' | - | A[CR] | Poll incoming FIFO for CAN frames (all pending frames).
'F' | YES | F[CR] | Read status flags.
'f' | YES+ | f[CR] | Read detailed status.
'X' | - | Xn[CR] | Sets Auto Poll/Send ON/OFF for received frames.
'W' | YES | Wn[CR] | Filter mode setting.
| | | W0 Dual filter mode (N/A)
| | | W1 Single filter mode (N/A)
| + | | W2 Simple filter mode
'M' | YES | Mxxxxxxxx[CR] | Set Acceptance Code Register (ACn Register).
'm' | YES | mxxxxxxxx[CR] | Set Acceptance Mask Register (AMn Register).
'U' | - | Un[CR] | Setup UART with a new baud rate where n is 0-6.
'V' | YES | V[CR] | Get software and hardware version number.
'v' | YES+ | v[CR] | Get detailed version information.
'I' | YES+ | I[CR] | Get CANFD controller information.
'i' | YES+ | i[CR] | Get detailed CANFD controller information.
'N' | YES | N[CR] | Get serial number of the hardware.
| + | Nxxxx[CR] | Set serial number of the hardware to xxxx,
| | | where the new serial number xxxx is a hex value.
'Z' | YES | Zn[CR] | Set time stamp ON/OFF for received frames only.
| | | Z0 No timestamp
| | | Z1 Millisecond timestamp
| + | | Z2 Microsecond timestamp
'z' | YES+ | znxyy[CR] | Set the reporting mechanism.
| | | where x and yy are hex values.
'Q' | YES | Qn[CR] | Set auto startup feature ON/OFF (from power on).
| | | Q0 Auto startup off
| | | Q1 Auto startup in normal mode
| | | Q2 Auto startup in listen only mode
----------------------------------------------------------------------------------------------------
All commands to the device must be terminated with CR and they are CASE sensitive.
All response from the device is terminated with CR except BELL for ERROR. The hexadecimal (hex) values are expressed with capital letters.
Ascii codes
- CR (Ascii 13 /
'\r'
) : Used for OK or termination - BELL (Ascii 7 /
'\a'
) : Used for ERROR
Data length code (DLC)
-
0-8
: Same as data length -
9
: Length = 12 -
A
: Length = 16 -
B
: Length = 20 -
C
: Length = 24 -
D
: Length = 32 -
E
: Length = 48 -
F
: Length = 64
Same as CAN232 and CANUSB.
Note:
- Though bit rate can be set with this command, it is recommended to use
s
andy
commands for a proper bit timing.
Setup CANFD nominal bit-rates and bit-timing, where dd
, xx
, yy
and zz
are hex values.
-
dd
Prescaler value in hex (01 - FF) -
xx
Time seg1 value in hex (01 - FF) -
yy
Time seg2 value in hex (01 - 80) -
zz
Sync jump width value in hex (01 - 80)
Precondition:
- The CANFD channel should be closed.
Example:
s10460908[CR]
Setup CANFD nominal bit rate to 125kbps and sampling point to 88.75%. This is the default setting when the device is powered on.
See bit timing calculator in the link page for the relationship between these parameters and bit rate and bit timing.
Returns:
- CR for OK or BELL for ERROR.
Setup CANFD data bit-rates, where n
is 0-2, 4, 5, 8.
-
Y0
500Kbps -
Y1
1Mbps -
Y2
2Mbps -
Y4
4Mbps -
Y5
5Mbps -
Y8
8Mbps
Precondition:
- The CANFD channel should be closed.
Example:
Y2[CR]
Setup CANFD data bit rate to 2Mbps.
Return:
- CR for OK or BELL for ERROR.
Note:
- Though bit rate can be set with this command, it is recommended to use
s
andy
commands for a proper bit timing.
Setup CANFD data bit rate and bit timing, where dd
, xx
, yy
and zz
are hex values.
-
dd
Prescaler value in hex (01 - 20) -
xx
Time seg1 value in hex (01 - 20) -
yy
Time seg2 value in hex (01 - 10) -
zz
Sync jump width value in hex (01 - 10)
Precondition:
- The CANFD channel should be closed
Example:
y021E0908[CR]
Setup CANFD data bit rate to 2Mbps and sampling point to 77.50%. This is the default setting when the device is powered on.
See bit timing calculator in the link page for the relationship between these parameters and bit rate and bit timing.
Returns:
- CR for OK or BELL for ERROR.
Same as CAN232 and CANUSB.
Example:
O[CR]
Open the channel, green LED is turned OFF.
Same as CAN232 and CANUSB.
Example:
L[CR]
Open the channel, green LED is turned OFF.
Same as CAN232 and CANUSB
Example:
C[CR]
Close the channel, green LED is turned ON.
Transmit a base (11bit) remote frame.
-
iii
Identifier in hex (000 - 7FF) -
l
Data length code in hex (0 - F)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
r100F[CR]
Sends a CAN remote frame with ID = 0x100 and DLC = F (64bytes).
Returns:
-
z[CR]
orzr...[CR]
for OK or BELL for ERROR.
Transmit a extended (29bit) remote frame.
-
iiiiiiii
Identifier in hex (00000000 - 1FFFFFFF) -
l
Data length code in hex (0 - F)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
R00000100F[CR]
Sends a CAN remote frame with ID = 0x00000100 and DLC = F (64bytes).
Returns:
-
Z[CR]
orZR...[CR]
for OK or BELL for ERROR.
Transmit a classical base (11bit) data frame.
-
iii
Identifier in hex (000 - 7FF) -
l
Data length code in hex (0 - 8) -
dd
Data byte value in hex (00 - FF)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
t10020011[CR]
Sends a classical CAN data frame with ID = 0x100 and 2 data bytes with the valued 0x00 and 0x11.
Returns:
-
z[CR]
orzt...[CR]
for OK or BELL for ERROR.
Transmit a classical extended (29bit) data frame.
-
iiiiiiii
Identifier in hex (00000000 - 1FFFFFFF) -
l
Data length code in hex (0 - 8) -
dd
Data byte value in hex (00 - FF)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
T0000010020011[CR]
Sends a classicle CAN data frame with ID = 0x00000100 and 2 data bytes with the values 0x00 and 0x11.
Returns:
-
Z[CR]
orZT...[CR]
for OK or BELL for ERROR.
Transmit a FD base (11bit) data frame without bit rate switch.
-
iii
Identifier in hex (000 - 7FF) -
l
Data length code in hex (0 - F) -
dd
Data byte value in hex (00 - FF)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
d200900112233445566778899AABB[CR]
Sends a CANFD data frame with ID = 0x200 and 12 data bytes.
Returns:
-
z[CR]
orzd...[CR]
for OK or BELL for ERROR.
Transmit a FD extended (29bit) data frame without bit rate switch.
-
iiiiiiii
Identifier in hex (00000000 - 1FFFFFFF) -
l
Data length code in hex (0 - F) -
dd
Data byte value in hex (00 - FF)
Precondition:
- The CANFD channel should be open in normal mode.
- The CANFD channel should not be bus off.
Example:
D00000200900112233445566778899AABB[CR]
Sends a CANFD data frame with ID = 0x00000200 and 12 data bytes.
Returns:
-
Z[CR]
orZD...[CR]
for OK or BELL for ERROR.
Transmit a FD base (11bit) data frame with bit rate switch.
This command is same as d
except bit rate switch.
Transmit a FD extended (29bit) data frame with bit rate switch.
This command is same as D
except bit rate switch.
Read status flags.
Precondition:
- The CANFD channel should be open.
Example:
F[CR]
Read status flags.
Returns:
-
Fxx[CR]
for OK or BELL for ERROR, wherexx
is a hex value with 8 status bits:
- Sets when CAN Tx or CDC Rx buffer overflows.
- Sets when CAN Rx or CDC Tx buffer overflows.
- Sets when a CAN error counter exceeds warning level (96).
- Sets when CAN frame is lost in the driver side.
- Reserved
- Sets when a CAN error counter exceeds error passive level (127).
- Not supported
- Sets when a CAN error counter increments.
All flags are cleared after responding to the F
command.
They are also reset when the channel gets open by O
command.
Any stored error flag will turn both green and blue LED to constant on.
For example, F84[CR]
is responded when the device has detected bus error and the error counter is warning level.
Or F02[CR]
is returned when the device has been receiving too much CAN frames and some of them are lost before processed via USB.
Read detailed status.
Precondition:
- The CANFD channel should be open.
Example:
f[CR]
Read detailed status.
Returns:
-
f: <Some thing>=<Some value>[CR]
style information(s) for OK or BELL for ERROR.
Set filter mode. See acceptance filter for details.
-
W0
Dual filter mode (not supported) -
W1
Single filter mode (not supported) -
W2
Simple filter mode (default)
Precondition:
- The CANFD channel should be closed.
Example:
W2[CR]
Set filter mode to simple filter mode.
Returns:
- CR for OK or BELL for ERROR.
Same as CAN232 and CANUSB.
See acceptance filter for details.
Same as CAN232 and CANUSB.
See acceptance filter for details.
Same as CAN232 and CANUSB.
Get detailed version information.
Precondition:
- None.
Example:
v[CR]
Get detailed version information.
Returns:
-
v: <Some thing>=<Some value>[CR]
style information(s) for OK or BELL for ERROR.
Get CAN controller information.
Precondition:
- None.
Example:
I[CR]
Get detailed CAN controller information.
Returns:
-
Ixyzz[CR]
for OK or BELL for ERROR, wherex
,y
andzz
are -
x
CAN protocol (3 = ISO-CANFD) -
y
Reserved -
zz
CAN clock in hex (MHz)
Get detailed CAN controller information.
Precondition:
- None.
Example:
i[CR]
Get detailed CAN controller information.
Returns:
-
i: <Some thing>=<Some value>[CR]
style information(s) for OK or BELL for ERROR.
Get serial number of the device.
Precondition:
- None.
Example:
N[CR]
Get serial number.
Returns:
-
Nxxxx[CR]
for OK (ex.NA123[CR]
) or BELL for ERROR.
Set serial number of the device. Digits 1-9 and letters A-F can be used for serial number.
-
xxxx
The serial number in hex (0000 - FFFF)
Precondition:
- None.
Example:
NA123[CR]
Set serial number to A123
.
Returns:
- CR for OK or BELL for ERROR.
Set timestamp on/off for received frames only.
Unlike CAN232 or CANUSB, this command itself does not write non-volatile memory.
The time stamp mode is stored in non-volatile memory when auto startup feature is enabled by Q
command.
-
Z0
Timestamp off -
Z1
Milli second timestamp (Reset to 0 at 0xEA60 ms = 60,000 ms) -
Z2
Micro second timestamp (Reset to 0 at 0xD693A400 us = 3600,000,000 us)
Precondition:
- The CANFD channel should be closed.
Example 1:
Z0[CR]
Turn off the time stamp feature (default).
Example 2:
Z2[CR]
Turn on the micro second time stamp feature (default). Four bytes time stamp is attached behind data bytes of the frame.
Returns:
- CR for OK or BELL for ERROR.
Setup the reporting mechanism.
-
n
Time stamp mode corresponding toZ
command -
x
Reserved -
yy
A hex value with 8 bits:
- Enables (1) or disables (0) Rx frame report.
- Enables (1) or disables (0) Tx event report.
- Reserved
- Reserved
- Enables (1) or disables (0) ESI (Error Status Indicator) in Rx frame and Tx event report.
- Reserved
- Reserved
- Reserved
Precondition:
- The CANFD channel should be closed.
Example 1:
z0001[CR]
Turn on Rx frame reporting without time stamp or ESI (default).
Example 2:
z1012[CR]
Turn on Tx event with milli second time stamp and ESI.
The ESI bit is placed behind time stamp and 0
is used for error active and 1
for error passive.
No Rx frame is reported in this setting.
Returns:
- CR for OK or BELL for ERROR.
Note:
- The milli second time stamp is taken after the CAN frame transmission is complete, while the micro second time stamp is taken at the start of CAN frame.
- This command is mutually exclusive with the
Z
command. Any settings made by this command will be overwritten by the one in the command or by default.
Same as CAN232 and CANUSB
Note:
- Settings for bit-rates (
S
,s
,Y
andy
), filter (W
,M
andm
) and report (Z
andz
) is stored in non-volatile memory and automatically applied on every power on.