CAN Bus Configuration

Settings for CAN Bus apply only to Controllers with a CAN Bus interface installed. Further, the CAN Bus Configuration may only be set using the CAN Bus interface.

After changing settings, the Controller must be reset (via power cycle or RESET command) before the new settings will take effect.

Note: the examples in this section assume the Controller's CAN Bus address is 0x80 while the Host device is 0x90. Different values must be substituted if your CAN Bus network is designed differently.

Configuration parameters are accessed using the System Commands message.

Note

The examples on this page use a Host Device ID of 0x90, and a Controller address of 0x80. These values will vary according to the design of the CAN Bus network.**

Available Info and Settings

Software Version

For non-DSP controllers there is a version for the motor processor and a version for the CAN Bus processor.

For DSP controllers there is a single version for motor and CAN Bus app.

Example

Read the Motor software version for a non-DSP controller. The version is stored at address low RAM 0x000A.

                     FC  MT  ADD LEN
Command:    10EF8090 45  00  0A  03 
Response:   1CEF9080 45  01  07  0B
FC=Function Code  MT=Memory Type  ADD=Address  LEN=Length
The response is version 1.7.11
Example

Read the CAN Bus processor software version for version 4.5.0 or greater CAN Bus processor or a DSP controller. The version is stored at address 0x044E.

                     FC  MT  ADD LEN
Command:    10EF8090 45  04  4E  03 
Response:   1CEF9080 45  04  05  00

FC=Function Code  MT=Memory Type  ADD=Address  LEN=Length
The response is version 4.5.0

The 0x49 command is a deprecated feature, but it may be the only way to read the CAN Bus processor version prior to version 4.5.0.

Parameter: 0x02
B0 B1 B2 B3 B4 B5 B6 B7
0x49 {OP} {Parameter} 0 Minor Version Major Version Patch Version 0

Example

Read the version of an older CAN Bus processor

Command:    10EF8090 49 43 02 
Response:   10EF9080 49 43 02 00 15 03 05 00 (Version = 3.21.5)

CAN Bus Baud Rate

The CAN Bus baud rate is stored at 0x040B. The valid values are in the table below.

Rate Selected Baud Rate
0 125 Kb/s
1 250 Kb/s (default)
2 500 Kb/s
3 1 Mb/s

Write Baud Rate Example

Set baud rate to 500K or (2).

Example

Write 0x02 to 0x040B.

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  0B  02
Response:   1CEF9080 46  00  (00=Success)

TX Message Priority

The CAN Bus priority is stored at 0x040C. The Priority determines the J1939 priority used by the Controller when sending messages. Messages with higher priority are less likely to be delayed. Adjusting this value allows the system designer to indicate which messages are most important within a given system.

Priority may be set to a value between 0 and 7 inclusive. Zero indicates the highest priority.

Example

Write priority 6 to 0x040C.

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  0C  06
Response:   1CEF9080 46  00  (00=Success)

Digital Control Options

Flags is a bitmapped 16 bit value. It is used to configure the behavior of the digital throttle control over CAN Bus. The default value is 0x0000.

NOTE: For dual motor controllers there are two Flag values. Motor #1 is stored at 0x040F-0x0410 and Motor #2 is stored at 0x0429-0x042A. The bit assignments are shown in the table below.

Byte Bit If set to '1'
040F Bits 0:3 Reserved (set to 0)
- Bit 4 Enable Digital Control functions
- Bit 5 Enable Digital Stop (if no Digital Control messages are received, motion is inhibited)
- Bit 6 Zero digital throttle when flow of digital throttle commands stops.
- Bit 7 Turn off digital brake when flow of digital throttle commands stops.
0410 Bit 0 Set to 1 to automatically switch between digital and analog control depending on presence or absence of digital control messages.
- Bit 1 Turn off digital horn when flow of digital throttle commands stops.
- Bits 2:3 Reserved (set to 0)
- Bit 4 Echo digital throttle (0x50) commands back to host.
- Bits 5:7 Reserved (set to 0)

Examples

Set digital throttle to 0 when CAN Bus throttle commands cease. Force controller to enable Digital Throttle when throttle commands start being received.

Example

Write 0x0150 to 0x040F-0x0410 (LSB First).

For versions prior to 4.2.0

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  0F  50
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  10  01
Response:   1CEF9080 46  00  (00=Success)
For versions 4.2.0 and above
                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  0F  50  01
Response:   1CEF9080 46  00  (00=Success)

Status Message Configuration

MSG Enable Flags is a bitmapped value. The value is stored at 0x0411. All messages are enabled by default.

Bit Mask If set to '1'
0x01 Message FF00 Enabled
0x02 Message FF01 Enabled
0x04 Message FF02 Enabled
0x08 Message FF03 Enabled
0x10 Message FF04 Enabled
0x20 Message FF05 Enabled
0x40 Message FF06 Enabled
0x80 Message FF07 Enabled
Not available prior to version 4.5.0

Example

Enable Messages FF00 and FF05 only

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  11  21
Response:   1CEF9080 46  00  (00=Success)

Timer Configuration

These timers are 10 millisecond software timers that control status message timing as well as CAN Bus message timeouts. If the "Value" is set to 255 (0xFF), the timeout will be 2.55 seconds until the next power cycle then the value reverts back to the factory default value.

Timer : There are 20 timers

Value : Is the time in 10 milliseconds units. The range is 5-255 or .05 to 2.55 seconds.

Address Timer Description Default
Value
0x0412 0 FF00 Status Repeat Rate 10
0x0413 1 FF01 Status Repeat Rate 100
0x0414 2 FF02 Status Repeat Rate 50
0x0415 3 FF03 Status Repeat Rate 100
0x0416 4 FF04 Status Repeat Rate 10
0x0417 5 FF05 Status Repeat Rate 25
0x0418 6 FF06 Status Repeat Rate 25
0x0419 7 Reserved 100
0x041A 8 Reserved 100
0x041B 9 Reserved 100
0x041C 10 Reserved 100
0x041D 11 Restricted N/A
0x041E 12 Restricted N/A
0x041F 13 Restricted N/A
0x0420 14 Digital Throttle Silence Timeout Motor #1 50
0x0421 15 CAN Bus Message Silence timeout 100
0x0422 16 Reserved 100
0x0423 17 Digital Throttle Silence Timeout Motor #2 100
0x0424 18 Reserved 100
0x0425 19 Reserved 100

Example

Change Status Message FF03 repeat rate to 400 milliseconds

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  15  28  (0x28=40 decimal)
Response:   1CEF9080 46  00  (00=Success)

Change Digital Throttle Silence Timeout Motor #1 to 250 milliseconds

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  20  19  (0x19=25 decimal)
Response:   1CEF9080 46  00  (00=Success)

Reset Status Message FF00 to the factory default value

Write 0xFF to timer 0
Command:      10EF8090 46  04  12  FF
Response:     1CEF9080 46  00  (00=Success)
FF00 status is sent every 2.55 seconds.
Read Timer 0: 
Command:      10EF8090 45  04  12  1
Response:     1CEF9080 45  FF 
Cycle the power
Read Timer 0: 
Command:      10EF8090 45  04  12  1
Response:     1CEF9080 45  0A  (0x0A=10 decimal)
FF00 status is sent every .1 seconds. 

Custom Status Configuration

This applies to version 4.5.0 or later or DSP controllers.

All of the FF02 and FF07 status message bytes can be configured to read any memory location. The read can be done continuously or once after power up. If you want to read a software version the one time read is recommended. For live status you should use continuous reads. However for every continuous read added the time required to update all of the status data will increase by 10 milliseconds. This could create enough of a delay to make real time control harder.

Each custom status byte is comprised of the memory type or 'Command' 0-5 and the address 0x00-0xFF. To make a read one time only set Bit 3 of the command byte.

Status Byte Command
Storage
Address
Storage
FF02: Byte 0 0x042B 0x042C
FF02: Byte 1 0x042D 0x042E
FF02: Byte 2 0x042F 0x0430
FF02: Byte 3 0x0431 0x0432
FF02: Byte 4 0x0433 0x0434
FF02: Byte 5 0x0435 0x0436
FF02: Byte 6 0x0437 0x0438
FF02: Byte 7 0x0439 0x043A
FF07: Byte 0 0x043B 0x043C
FF07: Byte 1 0x043D 0x043E
FF07: Byte 2 0x043F 0x0440
FF07: Byte 3 0x0441 0x0442
FF07: Byte 4 0x0443 0x0444
FF07: Byte 5 0x0445 0x0446
FF07: Byte 6 0x0447 0x0448
FF07: Byte 7 0x0449 0x044A

Example #1

Make first 3 bytes of the FF02 status message show the motor code version from Low RAM addresses 0x0A-0x0C with a one time read.

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  2B  08  (Command: Read Low RAM one time)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  2C  0A  (Address: Read address 0x0A "Major Version")
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  2D  08  (Command: Read Low RAM one time)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  2E  0B  (Address: Read address 0x0B "Minor Version")
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  2F  08  (Command: Read Low RAM one time)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  30  0C  (Address: Read address 0x0C "Patch Version")
Response:   1CEF9080 46  00  (00=Success)

After a power cycle the FF02 status for version 1.7.8 would look like

10FF0280 01 07 08 00 00 00 00 00

Example #2

Make last 2 bytes of the FF07 status message show the digital pot and digital buttons values from the motor Low RAM 0x7A-0x7B with a continuous read. This can be used to verify that a '0x50' command is being sent properly (See Digital Throttle).

                     FC  MT  ADD DATA...
Command:    10EF8090 46  04  47  00  (Command: Continous read of Low RAM)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  48  7A  (Address: Read address 0x7A Digital Pot)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  49  00  (Command: Continous read of Low RAM)
Response:   1CEF9080 46  00  (00=Success)
Command:    10EF8090 46  04  4A  7B  (Address: Read address 0x7B Buttons)
Response:   1CEF9080 46  00  (00=Success)

Immediately the FF07 status might look like

10FF0780 00 00 00 00 00 00 40 DF Assuming that Digital Pot = 0x40 = 64 = 25% PWM Digital Buttons = 0xDF (Reverse bit (5) is active low)