CAN bus

A customer wants us to build a box (basically a cinder block bristling with connectors) that includes a CAN bus for control. We'd include ethernet too, for more general use.

Can someone recommend a good chip or chip set to do slow CAN? A good eval kit or equivalent? A good way to make a PC talk CAN?

We'd have an internal uP, one of the ST Arm things.

Reply to
jlarkin
Loading thread data ...

There are USB-CAN adapters available.

You probably already have CAN available on PA11 and PA12, but are shared with USB. What is the exact STM model number?

Reply to
Ed Lee

fredag den 13. august 2021 kl. 17.25.37 UTC+2 skrev snipped-for-privacy@highlandsniptechnology.com:

many of the STMs have CAN all you need is a transciever

many of them also have USB so that's an easy way to make a PC talk CAN

Reply to
Lasse Langwadt Christensen

The low pin count versions probably have USB and CAN sharing pins. But since he wants ETH, probably need a high pin count chip anyway.

Reply to
Ed Lee

It's an STM32F207IGT6. It does have two CAN interfaces. Do we just need a transceiver? Any suggestions?

Reply to
jlarkin

MCP2551

Reply to
Ed Lee

fredag den 13. august 2021 kl. 18.08.40 UTC+2 skrev snipped-for-privacy@highlandsniptechnology.com:

yes you just need a transciever (and possibly a termination resistor) something like a MCP2551 or one of the numerous similar all in SO8 They need 5V, you can get 3.3V transceivers but I seem to remember some claiming they are not fully compliant with the all of the CAN spec. (though not in a way that I've seen matter)

Reply to
Lasse Langwadt Christensen

Yikes, there are tens of thousands available. I would have thought the car chip crisis would have affected that. Maybe they go full-custom.

Thanks

Reply to
jlarkin

There are several possible CAN pitfalls, mainly to do with physical interfaces and protocols. There is low speed fault tolerant CAN and the more common high speed not fault tolerant CAN. There are ISO specs. Then there are protocols, like CANOpen - but there are zillions of them.

The CAN peripheral on the ST chip will probably be OK for anything hardware except CAN FD. I've known people get fussy about clock speeds and want "exactly" the odd speed they are using which may not fit well with the processor clock.

If you need to write code to support some of the complex protocols it's a lot of work.

On the other hand if your customer has a sensible and documented home brew protocol it can be quite simple and problem free.

MK

Reply to
Michael Kellett

I've been told that ST has software drivers for their CAN interfaces, and like their ethernet stuff, it's pretty bad.

We are replacing some old boxes and the customer probably wants them to be drop-on replacements for their old home-made stuff. That sounds awful.

Reply to
jlarkin

We prefer isolated CAN -- one less ground loop to debug. We've used the ISO1050 for years, but it's not FD-compliant and doesn't regulate the voltage on the isolated side. Also, the ISO1050 is out of stock everywhere, natch. But isolating your CAN bus is something to consider.

Reply to
Jim MacArthur

We are doing CANBUS on our newer stuff. Using STM32s, NXP and TI processors. We have a couple guys working on most of the CAN software.

Expect it to take a while to get it right. A single processor is probably a bit easier though than multiples as long as your requirements aren't too high.

At least the address filtering and such is done in hardware

boB

Reply to
boB

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.