Connect Tech - Xtreme/Multi-I/O - Users Guide
Document: CTIM-00116
Revision: 0.02
0.02
Page 18 of 50
Connect Tech Inc. Proprietary Information
Date: Apr. 14, 2015
CAN Ports (SJA1000)
These commands allow the 2 CAN Ports to be configured with Address and IRQ assignments. The
assignments can also be queried.
Command Operation
Notes
CAN?
Query all the Address and IRQ settings for
both CAN (1 and 2) Ports
Cn?
Query the Address and IRQ settings for a CAN Port
n = 1 for CAN1
n = 2 for CAN2
CnP?
Query the Address setting for a CAN Port
n = (as above)
CI?
Query the IRQ setting for both CAN Ports
CnI?
Query the IRQ setting for a CAN Port
n = (as above)
CD?
Query the CAN Port IO or MEMORY region setting
CM?
Query the CAN decoding mode as BASIC or PELICAN
CSn?
Query the Enable or Disable state of a CAN Ports
n = 1 for CAN1
n = 2 for CAN2
CP=v
Set the Address for a CAN Port
See Note [1] below.
v= Base Address value
See Note [3] below.
CI=v
Set the IRQ for both CAN Ports.
See Note [2] below.
v= IRQ selections:
3,4,5,6,7,9,10,11,12,14,15
CnI=v
Set the IRQ for a specific CAN Port.
n = (as above)
v= IRQ selections:
3,4,5,6,7,9,10,11,12,14,15
CD=v
Set the CAN Port decoding region.
v = ‘P’ for IO region decoded
‘M’ for MEMORY region decoded
CM=v
Set the CAN Port Address decoding mode.
v = ‘B’ for “BASIC” mode (0x20 boundary)
‘P’ for “PeliCAN” mode (0x80 boundary)
See Note [4] below.
CSn=v
Set the Enable / Disable state of a CAN Port
v = ‘E’ to enable the Port
‘D’ to disable the Port
Notes:
1.
When the Address is entered as a single value (ie: CP=0x400), then this is the
Base
Address for the group of Ports,
with the next Port being set Base+0x80 bytes. However, when the Addresses are entered as a comma separated list (ie:
CP=0x400,0x500), then each Port is set to the Address value indicated.
Examples:
o
With CM=B, CP=0x400
CAN Port-1 = 0x400, CAN Port-2 = 0x480 (decoding width = 0x20)
o
With CM=P, CP=0x400
CAN Port-1 = 0x400, CAN Port-2 = 0x480 (decoding width = 0x80)
o
With CP=0x0C0000 (the CM setting is ignored)
CAN Port-1 = 0x0C0000, CAN Port-2 = 0x0C0080 (decoding width = 0x80)
o
With CP=0x0C0000,0x0C2000 (the CM setting is ignored)
CAN Port-1 = 0x0C0000, CAN Port-2 = 0x0C2000 (decoding width = 0x80)
2.
When the IRQ is entered as a single value (ie: CI=5), then this IRQ number is applied to both CAN Ports. However,
when the IRQs are entered as a comma separated list (ie: CI=9,11) then each CAN Port is set to the IRQ value
indicated.
3.
The value specified for the CP= command implies either IO or Memory Space. When the value for the CP command
is a 3 digit IO address in Hex (0x000 to 0xFE0 or 0xF80), the IO Space is implied. When the value for the CP
command is a 6 digit Hex value (0x000000 to 0xFFFFE0 or 0xFFFF80).
See the
IOD
command for setting the IO
decoding width, and the resulting IO address range.
4.
The address decoding mode is used
only
when the CAN Ports are mapped into and IO region (with CD=P). The
SJA1000
must
be set to operate in the mode that matches this address decoding mode (see the CLOCK DIVIDER
REGISTER in the SJA1000 data sheet for details).