SAE-J1939 is a communication protocol developed by SAE (Society of
Automotive Engineers). The communication protocol is based on the CAN
specification developed by Bosch 2.0 part B (September, 1991).
Before using the Model 1939STB the user should be familiar with the
SAE publications listed below, and follow all the guidelines before
attempting to connect to an active J1939 network.
The SAE-J1939 specifications are guidelines. Many manufacturers have
proprietary data codes developed for their own use. The user must obtain
these codes from the manufacturer of the vehicle. B&B Electronics does not
have access to the SAE-J1939 codes, and cannot provide any assistance in
obtaining these codes. It is the responsibility of the user to obtain and
implement the specific J1939 codes for the vehicle(s) that the 1939STB is
interfaced to.
This Model 1939STB Converter Module allows you to connect
to active SAE J-1939 networks. It is possible that your
transmissions through this converter module could cause
malfunction of the network operation, damage to the software or
equipment, or bodily harm.
Do Not Transmit Any Messages to The Network without a
complete understanding of the operation of the network.
B&B Electronics Mfg. Co. specifically disclaims any
responsibility for damage or injury to software, hardware,
equipment or persons as a result of using this product.
WARNING!
2 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
The 1939STB is an interface device allowing the user to connect a PC to
an SAE-1939 bus via a serial port. The 1939STB conforms to the Physical
Layer specification as set forth in SAE-J1939/11. The 1939STB allows the
reception and transmission of messages over an SAE-J1939 standard bus.
This converter has 14 message “slots” that can be configured for either
reception or transmission. A sample program is provided to aid in the setup
of the interface. Source code is provided and can be found in a subdirectory
under B&B Electronics/J1939/VB6. The Visual Basic program runs under
Windows: however, setup and data transfers can be sent and received by any
terminal capable of serial communications.
The power supply is a wide-range design and will accept a DC voltage
between 10 and 42 volts. The 1939STB has reverse polarity protection.
Power is connected to the 1939STB though a terminal block located under
the snap cover. +DC is connected to the terminal marked “POWER”. -DC is
connected to the terminal marked “GND”.
The serial port on the 1939STB is a 9-pin male connection, configured as
DCE (pin 2 receive// pin 3 transmit). The serial baud rate is user selectable
between 300 and 57600. The stop, parity, and word length can also be
adjusted.
Two LED’s are provided on the 1939STB. One indicates that DC power
is connected to the converter and the power supply is working properly. This
LED will be lit constantly. The second LED is labeled “DATA”. This LED
monitors the function of the converter. After the device is connected, the
LED should flash approximately once every 2 seconds. The flashing LED
confirms that the converter is operating properly and is ready to accept data.
Connection to the SAE-J1939 bus is made by a terminal connection. The
terminal, located under the snap cover, is marked “CAN LOW and “CAN
HIGH”. In some applications it may be necessary to add a terminating
resistor across the CAN high/low terminals. Consult the SAE-J1939/11
publication for details concerning terminating resistors.
The terminals marked “ A” and “B” are not used.
1939STB4600 Manual 3
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
Length: 5.25 in. (134mm)
Width: 2.75 in. (70mm)
Height: 1.00 in (25.4mm)
Serial Connection: DB-9 female, DCE
SAE-J1939 Connection: Terminal block, CAN HIGH/CAN LOW
Power Connection: Terminal block, POWER/GND
Temperature: 0 to +70 degrees Centigrade
Electrical Specification
Input Power Requirement: 10 to 42 volts DC, 1 Watt max.
Meets Physical Layer SAE-J1939/11
Fully compatible with ISO 11898-24v standard
RS-232 driver meets EIA-232-E and V.28 specification
CAN transceiver meets ISO 11898-24 V standard
4 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
All communications to the device start with a message header (white
area). This header is removed from any message sent to the J1939 bus. The
header is four bytes long. Two bytes (B1& B2) are used to confirm start of
frame. The next two bytes (B3 & B4) contain information controlling how
the 1939STB functions. The remainder of the packet is the data payload and
can contain from zero to sixteen bytes depending on function.
Byte 1 Byte 2 Byte 3 Byte 4 Message Information Data Payload
Check1 Check 2 Control 1 Control 2
Table 2. Transmit Data Format
The first two bytes (Check 1 and Check 2) are always set to 81hex and
21hex. These bytes must
precede all data sent to the device. If the Check
bytes are not sent consecutively the message will be rejected. The entire
message must be resent before data can be transmitted to the device. Control
(byte 3 and byte 4) contain information that is used by the converter. This
information is not passed to the J1939 bus. Both control bytes must contain
data (cannot have a value of 00) or the transmission will be rejected.
B
2
0
8
1939STB4600 Manual 5
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
Byte 3 directs the data packet to the proper destination. The setting of
this byte will affect the rest of the message. That is to say changing this byte
changes the meaning of the following data bytes.
Nibble 2 Nibble 1
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Table 3. Bits of Byte 3
Byte 3 has two parts, Nibble 1 and Nibble 2. Nibble 2 (bits 4 – 7) sets
the control code as follows:
Bit Number Value Function
1 Reserved not used Bit 7
0 Reserved not used
1 Reserved not used Bit 6
0 Reserved not used
1 Internal commands (Baud rate, Version number) Bit 5
0 No function
1 External commands (Messages to J1939 bus) Bit 4
0 No function
Table 4. Byte 3 Nibble 2
Nibble 1 (bits 0 – 3) of control byte 3 defines the number of bytes in the
data payload of the message. The byte count does NOT include the message
header (bytes 1 through 4). The message payload is limited to 16 bytes. This
limit allows a complete J1939 packet to be sent or received from the bus.
Byte 1 Byte 2 Byte 3 Byte 4
Check 1 Check 2 Control 1 Control 2
<< Count Number of Bytes for byte 3 nibble 1 >>
Table 5. Transmit Data Format
Message Information Data Payload
Nibble 1 of control byte 3 can be set to any value between 0 and 16
(0 to F hex).
Bit Number Value Function
6 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
1 Number of bytes in data payload (MSB) Bit 3
0
1 Number of bytes in data payload Bit 2
0
1 Number of bytes in data payload Bit 1
0
1 Number of bytes in data payload (LSB) Bit 0
0
Control Byte 4
When control byte 3 is set to “external commands” (bit 4 set to 1), nibble
1 of control byte 4 is used to tell the J1939 in which message slot location (1
through 15) to place the message data. NOTE: Message location number 15
is receive only.
Nibble 2 Nibble 1
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Table 7. Byte 4
When control byte 3 is set to “ internal commands” (bit 5 set to 1), nibble
1 of control byte 4 has the following functions:
Nibble 1 Value Function
0001 Display vender number & version
0010 Set baud rate, stop, start bits
0100 Not used
1000 Not used
Table 8. Nibble 1 Bit Values
Nibble 2 of control byte 4 is reserved for future use and is set to 0.
1939STB4600 Manual 7
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
While most of the information sent and received from the 1939STB will
be transferred to the J1939 bus, the internal function codes allow the user to
set up the serial port, and receive an identity string from the 1939STB. The
identity string may be used to verify that the 1939STB is connected and
working properly.
Vendor String
The vendor string function is sent to the 1939STB as shown in the table
below. This function is strictly internal and can be sent to the 1939STB at
any time whether or not the 1939STB is connected to an active J1939 bus.
The shaded areas are to be set by the user.
Table 9. Vendor String Setup
Byte 3 Byte 4 Byte 1 Byte 2
81 21 0010 0000 0000 0001
81 21 20hex 01hex
Nibble 2 Nibble 1 Nibble 2 Nibble 1
After this is sent to the 1939STB the device will respond with:
Table 10. Message Received from the SAE-J1939 Bus
Function
I
D
42 28 00 00 00 00 00 A
J1939
Address
MC Data
xx xxxxxxxxxxxx
A
See “Reception of Data” for an explanation of codes.
The xx may change.
The included Visual Basic application has a script file, VENDN.CVS,
that can be sent to the 1939STB to illustrate the vendor string function.
A
A
8 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
Setting byte-3/nibble-2 to 2 and byte-4/nibble-1 to 2 causes the 1939STB
to change baud. This function also requires 3 bytes of additional information
bytes 5, 6, and 7. It is important to note that after a baud change the PC must
have its baud changed to match the baud of the 1939STB for communication
to exist. If communication is lost after a baud change and cannot be
recovered, disconnecting the 1939STB from its power source will restore the
1939STB to its default baud rate of 9600 baud, 1 stop bit, 8 data bits, no
parity.
Table 11 shows how an internal command is used to set the 1939STB to a
baud rate of 300, 1 stop bit, 8 data words, and no parity. Byte 3 nibble 2 sets
the internal command function. A nibble value of 2 sets the J1939STB into
the Internal Function mode. Nibble 1 of byte 3 tells the 1939STB 3 bytes will
follow Byte 4. Byte 4, nibble 1 is set to 2 telling the 1939STB to perform a
baud change using the information contained in bytes 5, 6, and 7.
All baud rates are entered as hex numbers. To determine the decimal
divisor use the following formula. The decimal number must be converted to
hexadecimal before entering the number into byte 6 and 7. Baud rates faster
than 57,600 are not supported.