|
Issue
99, October 1998
Networking
with DeviceNetPart
2: A Weather Station Application
by
Jim Brady
Start
Can
Chips
Chip
Setup
Real
Time
Message
Flow
Connections
Timers
Analog
Input Point
Identity
Object
Fragmented
Messages
Getting
Physical
Applying
DeviceNET
Software,Sources
CAN
CHIPS
The
next order of business is picking a CAN controller. Table 1 compares peripheral-type CAN controllers.
I went with the Intel 82527 because I like having individual
mailboxes for each message type rather than one big FIFO
for all of them. Its more modular.
The
Siemens parts also work this way. They have 15 or 16 mailboxesplenty
for the DeviceNet predefined connection set, which has
10 connections.
A
FIFO is good if youre concerned with the master
beating your door down with high message rates. But at
some point, your code will run out of steam anyway.
The
82527 has five operating modes. Only mode 3 (nonmultiplexed
asynchronous) makes sense for a PC/104 interface. Id
prefer faster 16-bit transfers, but the 82527 in mode
3 is limited to 8 bits.
The
PC/104 bus has the same timing as the ISA bus, and it
takes a whopping 720 ns for an 8-bit read or write. This
glacial pace is actually good because it doesnt
exceed the rather long cycle and access times of the 82527.
In
mode 3, at maximum clock rate, the 82527 has a 288-ns
access time. If you use a fast bus, you need to accommodate
this slow interface. Intels web site has app notes
for interfacing the 82527 to a various processors.
I
use a PAL to generate the R/W select line and the chip
selects. To make sure the R/W line remains stable at the
end of a bus cycle, the line is latched by an RS latch
in the PAL.
MEMR
sets the latch and MEMW resets it. The PAL design source
file is available via the Circuit Cellar web site. The
only glue logic is a couple of inverters to delay the
82527 chip select to make sure it doesnt go low
until after R/W is valid.
With
no video board in my PC/104 stack, theres plenty
of memory space for the CAN controllers 256 bytes.
I went with A0000.
In
mode 3, the 82527 provides one I/O port. To get enough
I/O for all my switches and LEDs, I added an 82C55A at
memory address A1000. That gave me plenty of I/O lines,
including enough for a four-wire serial interface to the
ADC on my weather-station board.
|