circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 99, October 1998
Networking with DeviceNet—Part 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

CHIP SETUP

The 82527 has 15 mailboxes for CAN messages, each with 15 registers. Setting up a mailbox requires telling it what its message identifier is and if it is send or receive. Done properly, your program only gets an interrupt for a message directed to your device.

The 82527 also has a group of registers that control message filtering, interrupt masking, data rate, and sample timing. There are some tricky ones that set the sample point within a bit time as well as the limit on how much that sample point can jump around.

There is a tradeoff—you want to let it jump as much as possible to accommodate oscillator tolerance, and you also want the sample point to be close to the end of the bit time to accommodate long cables. But you can’t allow it to jump so much that it goes past the end of a bit time.

After a lot of calculation, I ended up sampling at 87% of the way through a bit time, with the jump limit (SJW) equal to 12% of a bit time. That accommodated the worst-case cable length, with a jump width still large enough to handle crystal errors of about ±0.2%, which is plenty for any crystal. The Intel 82527 Architectural Overview provides information for this calculation.