Summary of Contents for B&B Electronics RS-232 to J1939 Converter CE 1939STB
Page 1
RS-232 to J1939 Converter CE Model 1939STB Documentation Number 1939STB4600 International Headquarters B&B Electronics Mfg. Co. Inc. 707 Dayton Road -- P.O. Box 1040 -- Ottawa, IL 61350 USA Phone (815) 433-5100 -- General Fax (815) 433-5105 Home Page: www.bb-elec.com Sales e-mail: orders@bb-elec.com -- Fax (815) 433-5109...
Introduction 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.
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.
Description 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”...
Physical Description Length: Width: Height: Serial Connection: SAE-J1939 Connection: Power Connection: Temperature: 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 B&B Electronics Mfg Co Inc –...
Communication directed to the device Format: Message header 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.
Control Byte 3 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 Bit 7 Bit 6...
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.
Internal Functions 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.
RS-232 Baud Change 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.
Page 12
RS-232 Baud Rate Change - cont’d. 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.
Page 13
RS-232 Baud Rate Change cont’d. Baud Change; Parity, word length, stop bits. Byte 5 (UB3) UB3 sets the LCR register on the UART Bit 7 Bit 6 Bit 5 Divisor latch break parity Bit 7 = 1 allows baud rate divisor to be changed. 0 baud rate change is blocked.
Page 14
RS-232 Baud Rate Change cont’d. Bit 2 stop bit works in conjunction with bits 1 and bit 0. Bit 2 * Setup default value. Bits 1 and 0 set the word length. Bit 1 * Setup default value. B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104 B&B Electronics Ltd –...
External Commands The SAE-J1939 format is based on the CAN extended data frame. A detailed breakdown of the data frame is shown in Appendix The arbitration field is changed to conform to the SAE-J1939 message frame. The message frame must be broken down further before it can be sent to the 1939STB.
Message Header Setup Before a message can be sent to the SAE-J1939 bus, the message header must be configured to direct the data correctly. The following table shows the bytes that must be set to direct a message to the SAE-J1939 bus. The first two bytes are for the start of message.
Message Information Table 22. J1939 Message Information Message Information The message information controls the action of the message. It also contains the header information that will be sent out on the J1939 bus. The bytes that control the message and are not transmitted to the bus are grayed in.
Byte 5 Bit Function Sets the message valid Sets the message invalid Transmit interrupt set Transmit interrupt not set Receive interrupt set Receive not set Interrupt has occurred No interrupt pending NOTE: The dark gray (white letters) should be set to this value when sending a new message to the 1939STB.
Byte 6 Bit Function Bit 7 Remote Pending Transmit Request Message lost/ CPU update New data in message slot NOTE: the dark gray (white letters) should be set to this value when sending a new message to the 1939STB. RMTPND Bits 7 and 6 Remote Pending (used for messages that are to be transmitted).
Page 20
NEWDAT Bits 1and 0 Indicates if new data has been written into this slot by either the bus controller (receive messages) or the controller (transmit objects). Byte 11 Bit Function Number of data bytes (0 to 8) Message direction: Transmit Message direction: Receive Extended identifier must be 1 Bit not used set to 0...
SAE-J1939 Control Header Bytes 7 though 10 are the bytes that set the header information (“Arbitration Field” in the following table) for the SAE-J1939 bus. The areas shown in Table 27 in dark gray are set by the CAN specification and are NOT modified by SAE-J1939.
Byte 7 (Shown in Table 29) Bits 7, 6, and 5 of byte 7 set the J1939 priority bits. Bit 7 is the MSB. Bit 5 is the LSB. To code a priority value = 6 set bit 7 = 1 bit 6 = 1 bit 5 = 0. Bit 4 is the reserved bit - the J1939 specification sets this bit to zero.
Byte 8 (Shown in Table 30) Bits 7, 6, 5, 4, and 3 of Byte 8 along with Bits 2, 1, and 0 of Byte 7 make up the first part of the PDU (Protocol Data Unit). The first 8 bits are the PDU format.
Bytes 9 and 10 (Shown in Table 31) Bits 7, 6, 5, 4 and 3 complete the PDU. Bits 2, 1, and 0 of byte 9 and bits 7, 6, 5,and 4 of byte 10 are the Source Address for the converter. Each Source Address MUST be unique. SAE J1939-81 describes address management and allocation in detail and should be consulted before connecting to a J1939 bus.
Byte 11 Table 32. J1939 Message Information Message Information Table 33. J1939 Message Control Message Information Byte 11 Byte 11 is not sent to the J1939 bus and is coded as follows: Table 34. Byte 11 Bit 7 Bit 6 Bit 5 DLC Data Length Code Number of bytes 0 to 8 in the data payload.
Data Field The next 8 bytes are the data field and can have from 0 to 8 bytes used. This is the data payload. Table 35. J1939 Message Frame Arbitration Field Identifier Identifier (11 bits) Extension (18 bits) 11 bits 18 bits The remaining fields are handled by the controller and are not accessible through the converter.
Reception of Data The 1939STB sends data to the RS-232 port and onto the PC using a 16 byte format. The first byte of the message is 42hex. The next byte is the Function byte. The next field displays the SAE-J1939 header. If an internal message is received then this field is filled with zero.
Page 32
Function This is used to show where the message came from. Refer to Table 37. If the Nibble 2 is set to 0, then the message is from the J1939 bus. If Nibble 2 is set to 2, it is an internal message (for example, Vendor ID). Nibble 2 Bit 7 Bit 6...
Internal Messages Table 39. Message Received from the SAE-J1939 Bus Func J1939 Address Table 39 shows the data received from the J1939 bus highlighted in gray. The bytes (C,80,00,40) are the J1939 priority, reserve bit, data page, and PDU. The data field contains the data payload of the message and be from 0 to 8 bytes.
Software The program included with the 1939STB is a Visual Basic program that allows the transmission and reception of simple messages from the SAE- J1939 bus. The source code for the program is included on the disk to aid in program development.
Page 35
This screen is divided into two parts. The upper half of the screen allows the user to fill out the individual bytes that configure the 1939STB. The lower part of the screen displays data received from the 1939STB. 1939STB4600 Manual B&B Electronics Mfg Co Inc –...
Message Transmission (sending data to the 1939STB) The transmission window is divided into three rows. The first row is the internal header information. The second row contains message control information. The third row is the data payload sent with the information. The first row has 4 bytes.
Saving Message Information To save a configuration: “the byte data” Click on File at the top of the page. When the box opens click on Save. When the next box opens select a directory where the file should be stored and name the file.
Page 38
Appendix A. The Extended CAN / SAE-J1939 Message Frame Arbitration Field Identifier (11) bits Priority PDU Format (PF) (3 bits) (8 bits) Cont The table above shows a comparison between the SAE-J1939 message frame and the extended CAN message frame. The bold line separates the upper and lower parts of the table.
Page 39
Priority PDU Format (PF) 3 Bits 8 Bits Byte 7 Byte 8 * R1 is the reserved bit. ALL messages should set the SAE reserved bit to 0 on transmit. The frame above represents the J1939 frame and shows how the data is coded, to be entered into the frame. The bits marked with an X are set by the controller and are NOT settable by the user and can be ignored.
Page 40
Appendix B. Example This example uses the SAE “Electronic Axle Controller #1” (EAC#1). The specifications are as follows: Transmission Repetition Rate: 500 ms Data Length: 8 bytes Data Page: PDU Format: PDU Specific: Default Priority: Parameter Group Number: 61,446 (00F006) hex Source Address: 249 (off-board diagnostic / service tool #1).