Escolar Documentos
Profissional Documentos
Cultura Documentos
PC Interface
for the CAN Bus
with new software
Design by R. Lock
Hardware
The circuit diagram is very similar to
the project described in the Novem-
ber 1999 edition of Elektor Electron-
ics — the main difference is the soft-
ware which will run on the PC.
The SJA1000 is once again used as
the CAN Bus Controller (the
Before any piece of equipment is designed to most Notebook PC′s would not be PCA82C200 can also be substituted).
connect to a PC, the main question that able to accommodate it. Using the Its function was fully described in the
needs to be answered is: how will the equip- serial interface is also a possibility November 1999 edition of Elektor Elec-
ment talk to the PC? We could pass the data but is relatively slow, so the parallel tronics, and a datasheet can be down-
through a plug-in card, connecting to the printer interface seems to be the loaded from the Philips website at:
PC′s motherboard but this would mean that best bet to handle the high data rate www.semiconductors.philips.com
5V 5V 5V
10k
C3 C4
K1
10µ 100n
2 3 4 5 6 7 8 9 25V 1
C9
R15 R17
K3 6
390Ω
10k
R11 100n Ub
390Ω 2
1 R12 22 18 12
390Ω 8 7
14 R10
390Ω 11 7 2 3
2 6
1 2 3 MODE EN AN Ub
WR 7 IC2 8
15 5 CLKOUT 6 3
RD OUT CA C11 4
3 3
ALE 4 6N137 1 R22 9
16 IC1 20 NC NC
100n
R2 23 RX1 R19 5Ω6 5
4 390Ω AD0 19
390Ω
R1 24 RX0 5 D1 R24
17 390Ω AD1 3
120Ω
R3 25
5 390Ω AD2 14 5 6
R4 26 TX1 VREF CANL
18 390Ω AD3 13
R5 27 TX0 4 IC4 12V
6 390Ω AD4 RXD
R6 28 PCA82C200 Ub 1
19 390Ω AD5 TXD PCA
R7 1 SJA1000 D2 JP1
7 390Ω AD6 8 82C250 7
R8 2 9 RS CANH K2
20 390Ω AD7 XTAL1 R18
C10
390Ω
8 R21 2 12V 1
16 X1 R20 R23
390Ω
21 INT 6
100n
10k
17 10 5Ω6
9 RST XTAL2 2
4 8
22 IC7f CS 7
R9 1 2 3 16MHz 1 4
10 12 13 NC NC 3
390Ω 1 C2 C1 IC3
23 8 21 15 3 6 8
CA OUT
11 5 4 3 2 4
22p 22p
2 6N137 7 5V Ub
24 AN EN 9
12 5V IC6 5
5
25 5V D3 7805 1
50mA
13 R25 1 4x 4k7 R16 5V VIN
5V 7
1N4004
56k
V+ R13
IC5 C7
5V
4k7
IC7a IC7b IC7c IC7d IC7e C5 C6
1 3 5 9 11 NMV
14 9V 0505SA 5 100µ 10V
C8 1 1 1 1 1 470µ 220µ 0
IC7 IC7 = 7404 25V 10V
7 2 4 6 8 10
1µ 10V 2
000039 - 11
Figure 1. Circuit diagram of the CAN Bus Interface for PC parallel ports.
Although the PCA82C200 and write lines of a microcontroller. In plying power for the bus side circuitry), any
SJA1000 are pin-compatible, voltage this application it is necessary to nasty voltage transients induced in the CAN
divider R14/R15 is only needed for generate and read these signals bus cabling will be prevented from damaging
the PCA82C200. If you are using the using software on the PC to control the sensitive interface control circuitry and,
SJA1000 it is better to connect the the state of the parallel ports sig- eventually, your precious PC. If however you
RX1 input directly to ground by omit- nals. The data register of the parallel consider the likelihood of such damage to be
ting R14 and replacing R15 with a port (Pins 2-9 of K3) are connected to small then it is possible to omit the DC-DC
wire jumper. the multiplexed data/address bus of converter and link the +5 V connections at
Some of the hardware of the con- the SJA1000, while control signals the input and output sides of the board, and
troller must also be configured by read, write and ALE are generated do the same for the two ground connections.
the software. The internal compara- by the port signals (Autofeed, Init Jumper JP1 allows the 120Ω terminating
tor, for example, needs to be Printer and Select Input). The resistor to be connected across the two wires
bypassed by setting the CBP (bit 6) acknowledge line (pin 10) is used by of the CAN bus. This jumper should only be
of the CDR register. The line drivers the SJA1000 as an interrupt source used for stations at either end of the bus —
are also configured by writing 1AHEX to the PC. none of the stations in between should have
to the OCR register. Because the CAN bus is optically the jumper fitted. In practice, using this
The SJA1000 is designed to be coupled to the control circuit via IC2, jumper can be a bit awkward if equipment is
connected directly to the read and IC3 and IC5 (a DC-DC converter sup- frequently added or removed from the bus. In
those cases, it is better not fit the resistor to
the board but instead connect it between pins
7 and 2 of a free sub-D plug, which then acts as
Features a bus termination device. This method
ensures that there will never be more than
– Interface for PC parallel port in bidirectional EPP Mode two termination resistors connected to the
– CAN Bus connection via 9-way sub-D connectors bus, (important if you don’t want to overload
– 120 Ω bus termination resistor connected optionally the drivers) and they will only fit at the ends!
– CAN-Controller SJA1000 or PCA82C200
The wiring of the 9-pin sub-D bus connec-
– Bus coupling via Transceiver PCA82C250
– Opto-isolators and dc-dc converters for complete electrical isolation tor is not defined in the CAN standard. As
– 9-12V power supply from conventional mains adaptor opposed to earlier Elektor Electronics projects
related to the CAN bus, in this project we not
DataByteCount= 8*DLC.3 +
4*DLC.2 + 2*DLC.1 + DLC.0
Changing the input filter controlled by two 8-bit registers: the pared with the values contained in these reg-
Acceptance Code Register (ACR or isters. The AMR tells the controller which bits
When a message is received on the Reg 04 in the menu) and the Accep- in the received identifier are relevant. A ′0′
CAN bus interface, an input data fil- tance Mask Register (AMR or Reg 05 indicates that it is relevant while a ′1′ indi-
ter ensures that only the data frame in the menu). The 8 most significant cates that it is not relevant. For a message to
following a correct CAN bus identi- bits of the identifier contained in the be stored, all relevant bits in the received
fier will be stored. This filtering is received CAN message are com- identifier must match their respective bits in
+ D3
JP1
D2
K1
R22
H1
R13
0
IC6
IC4 R23
D1
R24
R20
K3 C6 C10
IC5
C11 R21
C5
R19
R2
R1
R12 R26 IC3 IC2
C7
R10 1
R3 R18 R17
COMPONENTS LIST R4 R14 R15
C9
R5 000039-1
R6 R16 C8
Resistors: R7
R11 K2
R1-R12,R17,R18,R19,R21 = 390Ω R8
R25
R13 = 4kΩ7 IC1 C4
R9 1-930000
R14,R15,R20 = 10kΩ ROTKELE )C(
R16 = 56kΩ
IC7
R22,R23 = 5Ω6 C1
C2 X1
R24 = 120Ω C3
R25 = 4-way SIL arary 4kΩ7
R26 = 8-way-SIL array 4kΩ7
Capacitors:
(C) ELEKTOR
C1,C2 = 22pF 000039-1
C3 = 10µF 25V radial
C4,C9,C10,C11 = 100nF,
5 mm raster
C5 = 470µF 25V radial
C6 = 220µ 10V radial
C7 = 100µ 10V radial
C8 = 1µF 10V or solid MKT
raster 5mm
Semiconductors:
D1,D2 = zener diode
12V 400 mW
D3 = 1N4004
IC1 = PCA82C200 or SJA1000 *
(Philips)
IC2,IC3 = 6N137 (Toshiba)
IC4 = PCA82C250 (Philips)
IC5 = NMV0505SA (Newport,
Farnell #589 810)
IC6 = 7805
Miscelllaneous:
JP1 = Jumper
K1 = 9-way sub-D plug (male),
PCB mount.
K2 = 9-way sub-D socket
(female), PCB mount.
K3 = 25-waySub-D plug (male),
PCB mount
2 solder pins
X1 = 16 MHz quarz crystal
Disk, order code 006004-1 (DOS-
Interface and source code in C)
PCB, order code 000039-1
Figure 4. Track layout and component overlay of the PCB designed for the CAN Bus Interface.
[2] Philips
SJA1000 Stand-alone CAN con-
troller DATA SHEET
On Project Disk #006004-1: www.semiconductors.philips.com
CAN_UK6 CPP C source code in English
CAN_PAR6 EXE DOS Program in German [3] Bosch
CAN_PAR6 CPP C source code in German CAN Specification version 2.0
CAN_UK6 EXE DOS Program in English Robert Bosch Gmbh, Stuttgart
COPYRI~1 TXT Copyright notice
CONTENTS TXT This text [4] DIN ISO 11898
DIN, Beuth Verlag, Berlin