I’m planning to make a stationary network of about 5-10 nodes for a personal project. I’m looking for the best networking technology for the job, and I2C came to my mind first of all. I2C isn’t really made for the distances in question (cable lengths of several metres), so rather than using the Philips “drivers” that can be used to extend I2C range, I’ve decided to take a look at CAN. Using a network of PICs with built-in CAN seems like a great option.
All was fine until today when I discovered that a distributor over here has an irresistable offer for a Freescale ZigBee Developer Starter Kit: 2 identical boards plus everything you need for a demo for 107 Euros. So now another option is a ZigBee network with chips of Freescale (or other, if there are any other all-in-on MCUs).
Am I right in thinking that both CAN and ZigBee cost about the same as far as hardware is concerned, with, maybe, somewhat more complexity in the software on the ZigBee? The application seems to be ideal for both: low data rate, low duty cycle, small packets, guaranteed transmission and error detection, low-latency priority option.
As one deeply involved with 802.15.4 and ZigBee, if you think $20@1ea is OK for a full up radio with protocol stack and a micro with serial port, bridging software already going - where you plug and go, then there you go. Maxstream XBee, SiLabs, several others.
ZigBee is the optional routing software. Not needed if the nodes are immobile and can lbe permanently linked by address to one another.
You don’t need a dev kit if you just use the modules as-is to bridge wireless to serial and link serial to your microprocessor. Otherwise you have to go off into the muck of their microprocessor’s software environment.
But !! if you can run wire and don’t need wirleess, then by all means, don’t use wireless!!!
Is wireless really so much more complex? I was thinking of using the MC1321x as the all-in-one solution, based on the idea that a few inductors and a little PCB space was less expensive than the CAN connectors and cabling… you’re right, it doesn’t need to be ZigBee, more like simply a combined transmitter and MCU.
I’m only thinking in terms of modules when it comes to trying stuff out, for the real thing I plan to use my own PCB designs.
Yeah if you don’t need the wireless and you’re making your own PCB’s, CAN is much simpiler. All you need is the driver chip and a 2 wire cable (4 if you want to transfer power through the same cable as many CAN protocol/standards do like DeviceNet and I think OpenCAN as well.) The CAN controller on PICs is just turn on the CAN controller, set any filters, stuff the header (aka arbitration) bits, and up to 8 bytes at a time in the message, and then set the transmit bit. The controller allows several interrupt conditions: on tx error, on rx error, on retransmitt, on rx complete , and on tx complete (if not those, then pretty close). Also you have many mail boxes (up to 16 on some) that you set the Rx/Tx bit and header bits to determine what mailbox can receive/transmit what. It’s pretty nice, and guaranteed transmission/error detection/retransmittions up to 1Mbit/sec and prioritized communication (via the header bits).
Yeah, I like CAN. I’ve worked with it in several projects (major class project and in industry.)
LIN is another option, similar to CAN but less complex and more suitable for low data rates. It can be implemented in software, apart from the driver chips, unlike CAN.
Thanks guys. I’ve just discovered that a development environment for HCS08 can be a bit pricey and will require Windows, while there is a complete open-source PIC toolchain that I can run under Linux, so I shall stick with the PIC series CAN MCUs. LIN sounds interesting too, but its practical limit of 16 nodes and its low speed might not be enough for me in the long run. Also, LIN doesn’t appear to like unsolicited broadcasts by slaves, if I understand it correctly (all transactions are initiated by the master), and I’m going to use broadcasts a lot.
It’s funny that the 5V operation of the PICs is actually an advantage as well because most of my peripherals use 5V levels…
I’m planning to make a stationary network of about 5-10 nodes for a personal project. I’m looking for the best networking technology for the job, and I2C came to my mind first of all. I2C isn’t really made for the distances in question (cable lengths of several metres), so rather than using the Philips “drivers” that can be used to extend I2C range, I’ve decided to take a look at CAN. Using a network of PICs with built-in CAN seems like a great option.
All was fine until today when I discovered that a distributor over here has an irresistable offer for a Freescale ZigBee Developer Starter Kit: 2 identical boards plus everything you need for a demo for 107 Euros. So now another option is a ZigBee network with chips of Freescale (or other, if there are any other all-in-on MCUs).
Am I right in thinking that both CAN and ZigBee cost about the same as far as hardware is concerned, with, maybe, somewhat more complexity in the software on the ZigBee? The application seems to be ideal for both: low data rate, low duty cycle, small packets, guaranteed transmission and error detection, low-latency priority option.
Any comments will be much appreciated.
CAN is far cheaper than Zigbee for production. If you are considering the cost of the Zigbee components compared to CAN components, CAN is still cheaper and CAN is far simpler to implement than Zigbee unless you are using “add on” self-contained Zigbee units, which makes CAN WAY cheaper.
Another thing to consider, RF is inherently unreliable. There is always the chance that someone will turn on their microwave, new wireless telephone, WiFi network, wireless mouse; the list goes on and on - The 2.4GHz band is littered with users, all stepping on each other.
CAN is a bit complex to set up using PICs, perhaps just as complex with others as well, but it is quite reliable over a decent wire line. We use CAT5e with RJ45 connectors and get multiple km of range with no problems.