2005-03-28 05:03 PM
2005-03-15 12:51 AM
hI!
I'm working on an application with several controlers : 4 controlers are slaves and dial with a master. The link between master and slave is just to get local information from slaves as local voltage, local temperature, local fault and so on. Call this unit (4 slave and one master) a ''pack''. I have 8 packs in parallel in my application. The masters are supposed to dial together and one of the master will be linked to a PC to give a view of each ''pack'' and of the total network. I plan to use SPI link between the master and the slaves inside each pack and to use a CAN link between the 8 masters. Does anybody have an advise on my choice ? What about use I2C between the slaves modules and the master of a pack? What about use a same CAN network between all the modules (masters and slaves) ? Wich is the easyest link to manage (SPI, I2C, CAN) from a software point of view ? Any idea is welcome Thanks2005-03-15 01:49 AM
whitebull,
the link choice depends on many aspects. According to the price, SPI is the cheapest; then follows I2C and finally CAN. The same relationship applies to the software ease of management. CAN price is balanced by the automatic collision detect, safety and longer transmission distance. If you have already choosen CAN to make the masters talk, in my opinion, two choices are left: - use SPI if there are no noise concerns and the link distance inside each pack is small; - use LIN to lower overall costs. This link type is the preferred one in the car sector where CAN was born. Regards, EtaPhi2005-03-22 04:58 PM
As Etaphi highlighted that transmission distance is a deciding factor. If its very high between Master and slaves, i will recommend to use SCI with RS485 drivers. The software implementation is easy and cost of cabling is same.
2005-03-24 07:57 PM
Hi,
I'm very desapointed by this forum ! Solutions very often comes from discussion. But to get solutions we need discussion ! Many thanks to the two persons who gave an answer to my question. Some more information : The master is very close from it's 4 slaves (20 to 30 cm) inside a pack. The masters of the 8 packs are very close too because the packs are side by side (20cm). The link beetween the first master and the PC is the longer one and could be several meters (10 to 25m). At the moment my choice is for SPI between the slaves and the master inside a pack and CAN between the 8 masters and one of these masters and the PC. In my mind RS485 is an ''old fashion'' protocol not very powerfull to manage ''technical information link''. I'm open to any information making my advise change ! Regards to everybody and specialy to the helpfull guys who answer ! Whitebull2005-03-24 11:41 PM
Hello whitebull!
I agree with you that RS485 is an old technology, but it is rock-solid and works even on long distances (1200 m) where newer technologies (e.g. USB) fail. The RS485 standard defines only the physical layer, therefore it is not a protocol... The CAN specification defines the physical and data layers (OSI Layers 1 and 2). CAN protocol offers access control, collision detection, priorities between messages, and much more... The RS485/CAN situation is similar to the one that exists between the COM and USB ports of a PC. COM ports (RS232) seems to be outdated, but every PC still have at least one... Why? First of all, it works! Then it is simple to implement: every micro can handle it! If your micro has a SCI unit, the realization of a communication link is nearly effortless... When it comes to USB, which seems the state-of-art, you have to use a micro with a USB engine, a library, a DLL on the Windows side... All these aspects add the need of more transistors, more FLASH, more time to develop your application... In a few words ... more costs! CAN is a cool technology (I love it...), but cost reasons modified my initial choice: in my application I now use RS485. This is not a betrayal of CAN, since I implemented in my protocol some beauties of CAN (e.g. the absence of addresses, the message -based communication style, ...) If you feel confortable with CAN, use it! However, I advise you to not choose a technology following the tide. Some legacy (old fashion, if you prefer) technologies are still unbeateable as regards costs, strength and ease of implementation... EtaPhi2005-03-28 05:03 PM
Hi whitebull,
What is the application size/complexity. Since the CAN interface is not avalable in all the micro's, so if choice of communication is forcing you to choose a big size (& cost ) micro, you need to see overall cost. No doubt CAN is latest technology and evolved from different problems seen in communication by the engineers. It is also the preffered choice in automotive/industrial appn because of Noise immunity it can handle. SPI is much simpler interface and prone to noise/errors. A software protection like packet protocol, CRC check may be necessary for critical data. Pls note SPI is available in almost all micro's. Even the small/cheap micro will have this interface. you need to choose depending on different criterion. bye Alok