Forums

Faster LIN or simpler CAN or ...? PIC16 or Cypress FX2LP or ...?

Started by Bill Davy November 18, 2005
To support various modules inside a machine.  The likely architecture is a 
front end PC talking USB 2.0 to a Cypress FX2LP in the machine.  That then 
splits the control work out to various nodes (spinner, motor, shutter, 
laser, etc), connected by a bus.



a) CAN involves me in checking each message was received once and only once. 
There's not a lot of space in the Cypress for that sort of thing.



b) We could use LIN but it seems jolly slow.  Would mean a nice simple 
processor in each node with a little programming and offering some 
flexibility.



c) We could use a modified form of I2C but that means no intelligence at 
each node (and no programming, which is quite a good thing, in some ways).



Can I do LIN master in the Cypress FX2 (8051 based with a couple of UART's)?

Is there a reasonably standard way for doing LIN slave?  I'd prefer 8051 
based (so I can go on using the Keil compiler) or PIC16 (which we have also 
used).

Any other thoughts (but not too innovative - this is a development project)?



tia,

    Bill


Philips 80c51 Micro - LIN application note

http://www.semiconductors.philips.com/acrobat_download/applicationnotes/AN10115_1.pdf

http://www.semiconductors.philips.com/acrobat/literature/9397/75011339.pdf


"Bill Davy" <Bill@SynectixLtd.com> wrote in message 
news:dlkm3j$37m$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
> To support various modules inside a machine. The likely architecture is a > front end PC talking USB 2.0 to a Cypress FX2LP in the machine. That then > splits the control work out to various nodes (spinner, motor, shutter, > laser, etc), connected by a bus. > > > > a) CAN involves me in checking each message was received once and only > once. There's not a lot of space in the Cypress for that sort of thing. > > > > b) We could use LIN but it seems jolly slow. Would mean a nice simple > processor in each node with a little programming and offering some > flexibility. > > > > c) We could use a modified form of I2C but that means no intelligence at > each node (and no programming, which is quite a good thing, in some ways). > > > > Can I do LIN master in the Cypress FX2 (8051 based with a couple of > UART's)? > > Is there a reasonably standard way for doing LIN slave? I'd prefer 8051 > based (so I can go on using the Keil compiler) or PIC16 (which we have > also used). > > Any other thoughts (but not too innovative - this is a development > project)? > > > > tia, > > Bill > >
Bill Davy <Bill@synectixltd.com> wrote:

> a) CAN involves me in checking each message was received once and > only once.
Why would you need to know that? Think about it for a moment: CAN was expressly designed for exactly this purpose: controlling lots of not-too-intelligent little gadgets spread all across a larger machine (a car). And people seem to have no serious problem using it for just that. So what makes your application different? And if you have to do it, why do you assume it would be hard? Just let your CAN slaves send ACK replies to each command, or send their status unrequested, on a regular time basis, so the master always knows what all its slaves (think they) are doing. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
Bill Davy wrote:

> To support various modules inside a machine. The likely architecture is a > front end PC talking USB 2.0 to a Cypress FX2LP in the machine. That then > splits the control work out to various nodes (spinner, motor, shutter, > laser, etc), connected by a bus. > > > > a) CAN involves me in checking each message was received once and only once. > There's not a lot of space in the Cypress for that sort of thing. > > b) We could use LIN but it seems jolly slow. Would mean a nice simple > processor in each node with a little programming and offering some > flexibility. > > c) We could use a modified form of I2C but that means no intelligence at > each node (and no programming, which is quite a good thing, in some ways). > > Can I do LIN master in the Cypress FX2 (8051 based with a couple of UART's)? > > Is there a reasonably standard way for doing LIN slave? I'd prefer 8051 > based (so I can go on using the Keil compiler) or PIC16 (which we have also > used). > > Any other thoughts (but not too innovative - this is a development project)?
How about an SPI bus ? Some of the receivers, such as control pins can be as simple as a shiftregister '595. Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net
In article <dlkm3j$37m$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>, 
Bill@SynectixLtd.com says...
> a) CAN involves me in checking each message was received once and only once.
Just design your higher level protocol so it doesn't care if the same message is received multiple time. IE send motor speed absolutely not a speed increment. Set a relay state rather than a toggle etc. Then you can just forget anout the fact that a message can show up multiple times. There are times where you have to care (mostly when abusing CAN to send large amounts of data) but most control messages can be set up so that it doesn't matter.
> b) We could use LIN but it seems jolly slow. Would mean a nice simple > processor in each node with a little programming and offering some > flexibility.
It's been a while since I looked but doesn't LIN have the same possibility as CAN of receiving the same message multiple times? Robert
Bill Davy wrote:
> To support various modules inside a machine. The likely architecture is a > front end PC talking USB 2.0 to a Cypress FX2LP in the machine. That then > splits the control work out to various nodes (spinner, motor, shutter, > laser, etc), connected by a bus. > > > > a) CAN involves me in checking each message was received once and only once. > There's not a lot of space in the Cypress for that sort of thing. > > > > b) We could use LIN but it seems jolly slow. Would mean a nice simple > processor in each node with a little programming and offering some > flexibility. > > > > c) We could use a modified form of I2C but that means no intelligence at > each node (and no programming, which is quite a good thing, in some ways). > > > > Can I do LIN master in the Cypress FX2 (8051 based with a couple of UART's)? > > Is there a reasonably standard way for doing LIN slave? I'd prefer 8051 > based (so I can go on using the Keil compiler) or PIC16 (which we have also > used). > > Any other thoughts (but not too innovative - this is a development project)?
Look into the 80C51 9 Bit mode : that sits between CAN and LIN in speed, and is simpler than LIN to code, as you use the inbuilt HW support. You can use CAN transceivers, on a 9 Bit UART datastream. i2c has the poorest noise immunity. LIN has high immunity, because it is large swing, and slow. LIN has very small payloads, and is really for the last-link usage. CAN is multimaster, and has CRC included, whilst 9 Bit mode is single master, but can use much lower cost silicon. 80C51's with UARTS start well under $1, and in tiny packages, and support data rates higher than CAN. -jg
Bill Davy wrote:
> To support various modules inside a machine. The likely architecture > is a front end PC talking USB 2.0 to a Cypress FX2LP in the machine. > That then splits the control work out to various nodes (spinner, > motor, shutter, laser, etc), connected by a bus. > > > > a) CAN involves me in checking each message was received once and > only once. There's not a lot of space in the Cypress for that sort of > thing. > > > > b) We could use LIN but it seems jolly slow. Would mean a nice simple > processor in each node with a little programming and offering some > flexibility. > > > > c) We could use a modified form of I2C but that means no intelligence > at each node (and no programming, which is quite a good thing, in > some ways). > > > > Can I do LIN master in the Cypress FX2 (8051 based with a couple of > UART's)? > > Is there a reasonably standard way for doing LIN slave? I'd prefer > 8051 based (so I can go on using the Keil compiler) or PIC16 (which > we have also used). > > Any other thoughts (but not too innovative - this is a development > project)?
Control stuff feom a PC and use of USB throughout? No Central CPU, just some Hubs. AT89C5131 is 8051 with USB Run a Fast USART : TXD,RXD,SCLK (driven by master) over RS485. This is supported by AVRs and AT91 ARMs. You would need a resonator with each node, but the speed is higher. There are free GNU compilers /AVR Studio for the AVR. ARMs up to 32 kB (AT91SAM7S321) compilers are quite often free of charge (Code restriction <= 32 kB). I think You would enjoy AVR or ARM programming over 8051/PIC. Most do.
> > > tia, > > Bill
-- Best Regards, Ulf Samuelsson ulf@a-t-m-e-l.com This message is intended to be my own personal view and it may or may not be shared by my employer Atmel Nordic AB
We use SPI bus quite a lot but the limiation that it assumed the data
arrived to designation,  more like datagram. It can be dangerous if
there is fault within the SPI bus CAN bus includes protocol that verify
the data and send response if damaged, more like telephone (ie you get
feedback from other end). The other benefit that it use fewer line than
SPI bus.

PIC is very popular, it used everywhere due to excellent technical
support, training package, forum and lot of sample program they
developed. It very cheap to setup as well. There are limitation in
debugging, you cannot monitor local field variable (within C), only the
global field variable.