Summary of the content on the page No. 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
Technical Support e-mail: support@bb-elec.com -- Fax (815) 433-5104
European Headquarters
B&B Electronics Ltd.
Westlink Commer
Summary of the content on the page No. 2
Table of Contents INTRODUCTION ......................................................................................1 SAE Publications..................................................................................1 WARNING!................................................................................2 DESCRIPTION.............................................................................................3 Physical Description .........................................................
Summary of the content on the page No. 3
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. The SAE-J1939 specifications are guidelines. Many manufacturers have proprietary data c
Summary of the content on the page No. 4
WARNING! 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 softw
Summary of the content on the page No. 5
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” 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
Summary of the content on the page No. 6
Physical Description 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 spe
Summary of the content on the page No. 7
Communication directed to the device Format: Table 1. J1939STB Format Message header Message Information Data Payload B B B B B B B B B B B B B B B B B B B 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 8 9 0 8 2 1 0 9 E 0 8 0 4 8 4 4 4 4 4 4 4 4 1 1 F 5 5 7 c 0 0 0 c 1 2 3 4 5 6 7 8 All communications to the device start with a message header (white area). This header is removed from any message sent to the J1939 bu
Summary of the content on the page No. 8
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. Table 3. Bits of Byte 3 Nibble 2 Nibble 1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Byte 3 has two parts, Nibble 1 and Nibble 2. Nibble 2 (bits 4 – 7) sets the control code as follows: Table 4. Byte 3 Nibble 2 Bit Nu
Summary of the content on the page No. 9
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. Table 7. Byte 4 Nibble 2 Nibble 1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 When control byte 3 is set to “ internal commands” (bit 5 set to 1), nibble 1 of control byte 4 h
Summary of the content on the page No. 10
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. 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
Summary of the content on the page No. 11
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. 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
Summary of the content on the page No. 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. UART clock = 7,372,800 Hz Decimal Divisor = Clock frequency (7,372,800) Baud output x 16 If you want a baud rate output of 300 baud: Decimal Divisor = 7,372,800
Summary of the content on the page No. 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 Table 14. Byte 5 (UB3) Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Divisor Set Set Even Parity Stop Word Word latch break parity parity enable bits length 1 length 0 Bit 7 = 1 allows baud rate divisor to be changed. 0 baud rate change is blocked. Bit seven should not be set. The setting and resetting of this bit is handled interna
Summary of the content on the page No. 14
RS-232 Baud Rate Change cont’d. Bit 2 stop bit works in conjunction with bits 1 and bit 0. Table 16. Stop Bit Setup Bit 2 Word length (bits) Stop bit length 0 5, 6, 7, 8 1* 1 5 1½ 1 6, 7, 8 2 * Setup default value. Bits 1 and 0 set the word length. Table 17. Word Length Bit 1 Bit 2 Word length 0 0 5 0 1 6 1 0 7 1 1 8* * Setup default value. 12 1939STB4600 Manu
Summary of the content on the page No. 15
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 A. 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. The format for transmitting data to the 1939STB is shown in the following table: Table 18. J1939 Format Message Header Message Information Data Payload B B B
Summary of the content on the page No. 16
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. Table 19. J1939 Message Header Message Header B B B B 1 2 3 4 81 21 1F 05 The first two bytes are for the start of message. The third byte (B3) containing hex 1F,1 directs the message to the J1939 bus. (F) hex is the number of bytes in the pa
Summary of the content on the page No. 17
Message Information Table 22. J1939 Message Information Message Information B B B B B B B 5 6 7 8 9 10 11 95 E7 0C 80 00 40 8C 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 and 6 are the message control bytes. They work together to control the message. The bit fields are set up in a two
Summary of the content on the page No. 18
Byte 5 Table 24. Byte 5 Byte 5 Bit Function Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 MSGVAL TXIE RXIE INTPND Sets the message valid 1 0 Sets the message invalid 0 1 Transmit interrupt set 1 0 Transmit interrupt not set 0 1 Receive interrupt set 1 0 Receive not set 0 1 Interrupt has occurred 1 0
Summary of the content on the page No. 19
Byte 6 Table 25. Byte 6 Byte 6 Bit Function Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 RMTPND TXRQ MSGLIST/CPUUPD NEWDAT Remote Pending 1 0 0 1 Transmit Request 1 0 0 1 Message lost/ CPU update 1 0 0 1 New data in message slot 1 0 0 1 NOTE: the dark gray (white le
Summary of the content on the page No. 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 Table 26. Byte 11 Byte 11 Bit Function Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 DLC XT DIR D Number of data bytes (0 to 8) Message direction: Transmit 1 Message direction: Receive 0 Extended identifier must be 1