Author Topic: Help choosing microcontroller (CAN Open Safety project)  (Read 3527 times)

0 Members and 1 Guest are viewing this topic.

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Help choosing microcontroller (CAN Open Safety project)
« on: March 12, 2020, 02:33:11 pm »
So I am hoping to get personal experiences of what MCU to choose.

I'll start with the requirements:
32bit
128Kb ram+
128Kb ROM+
up to 100Mhz
20-25 digital inputs
20-25 analog inputs
~5 analog outputs
~5 digital outputs
CAN bus connectivity
High reliability

It would be used with the CAN Open Safety stack so speed and reliability is important but don't want to go in the range of frequency where EMC may become high risk.

Would like to get some suggestions together with why it should be considered. Such as compiler, programming and debugging, bootloader availability etc.

Ideally analog inputs would be rated up to 5VDC.

Already looked at STM32F103 range but came across many negative feedback of various issues. Although it is cheap and there quite few projects in the net. Not sure if PIC/Atmel would be considered unless there is great argument.

Thanks in advance  :)

 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2867
  • Country: us
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #1 on: March 12, 2020, 03:33:39 pm »
I don't think there's any MCU that meets all of your requirements, particularly on the analog IO.  20-25 analog in and 25-30 digital IO is doable, although the analog will depend a lot on your sample rate and resolution requirements, but I don't think you're going to find anything with 5 DACs built in, let alone good ones.  Maybe some DSPs?  I would strike the analog out from your MCU requirements and plan on using an external DAC.

In general, you probably want something in the ARM family, as that gives you a lot of options in the capabilities you want, and good toolchain and debugging support.  ST, NXP, Atmel/Microchip are probably the most accessible (all very popular among DIY crowd, so lots of examples online), maybe TI and Cypress as well, but I think their portfolios are smaller than the other three.  They all have parametric search, so you can easily narrow down the offerings to a short list based on your most critical requirements.  Your memory size and clock speed requirements probably put you mostly in Cortex M4 territory.  Maybe M7 as well, but note that the jump from M4 to M7 comes with more traps, including caches and memory access reordering that can be frustrating to figure out, especially for a beginner.  ST, Atmel, and Cypress at least have their own IDEs that are basically install-and-go, and dev boards with built-in debuggers are readily available.  You also have the option of building up your own environment using arm-gcc, gdb, and editor or IDE of your choice. 

Note that while analog inputs may be 5V tolerant, this does not necessarily mean that they can read analog voltages up to 5V.  Typically you can only read up to the voltage of Vref, although some parts may have built-in scaling to extend to 2x Vref--although even here, this probably does not mean that they can read voltages above the analog supply voltage.  That's not a big deal, though, because you can just use a voltage divider which provides some input protection as a bonus, and you generally want a bit of RC filtering on ADC inputs anyway.  ST parts tend to have lots of 5V tolerant IO, though be away not all IO pins on a given part may be 5V tolerant.

Many manufacturers have bootloaders available, many even have them baked into the MCU from the factory.  These generally do not provide for encryption, though, so be aware that if this is something you release you may have to send your firmware in the clear. 

Regarding EMC, you're already going to be in the territory where that matters.  It's not clock frequency that matters, it's the edge rate.  Even a 1Hz square wave can be an EMI problem if the edge rate is fast enough.  Good layout and slew rate management is essential for EMC.  Many ARM parts especially in the M4 and up range allow you to configure the drive strength of the digital IO, so using the lowest drive strength that will do the job is best for EMC.  Any signals that need high drive strength will benefit from careful layout and termination as necessary.  (It's not a bad idea to design in series resistors (at least) at the source end of high speed signals; you can always fit 0R resistors if they turn out to be unnecessary.)

Finally, what do you mean by "High Reliability"? Manufacturers make MCUs by the millions, so it's a pretty well dialed in process for the most part, as long as you follow good design practices you should be fine with just about anything.  If this is something safety critical, well then you're in challenging terrain.  You cannot build a reliably safe system (or even just a reliable system) just by buying "high reliability" parts.  There are a lot of factors that go into both safety and reliability, and not all of them are trivial to analyze and verify.  If you want to share some information about what exactly you're trying to accomplish I'm sure you will get lots of input here.
« Last Edit: March 12, 2020, 03:39:38 pm by ajb »
 

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #2 on: March 12, 2020, 04:07:26 pm »
Thank you for the swift reply ajb.

The reason of having many analog inputs is mainly because of each control having a redundant output. So i.e. 8 hall switches will have 16 analog outputs in the range of 0.5-4.5VDC. The resolution is I assume pretty low as the signal range (0.5-4.5vdc) gets converted into digital values (range 0-255). Dividing the output voltage is not an issue at all, as you pointed out, it will help with filtering too.

I was expecting that ARM will be suggested but probably I am more concerned of what's the best package in terms of toolchain, programmer in circuit etc. Although I wouldn't consider M7 as the price-per-functionality is bit over the budget and I already know of some potential challenges I'd like to avoid.

Ideally I would like to go with chip that comes with bootloader but at the same time there must be option to update it if needed.

Analog output would only be required for things like buzzer which I believe would not be a challenge for majority of MCU's.

I may have used wrong words. With reliability I meant wider range of storage and operational temperatures, not subject to vibration and moisture.
 
« Last Edit: March 12, 2020, 04:09:05 pm by bulletbolt »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30436
  • Country: nl
    • NCT Developments
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #3 on: March 12, 2020, 04:12:57 pm »
Look at NXP. The LPC series ARM controllers have CAN and automotive temperature ranges but they also carry a large range of automotive grade parts from formerly Freescale. NXP's LPC series have a very good & easy to use bootloader (and third party software called 'flash magic'). My customers have no problems getting a board updated if necessary.
« Last Edit: March 12, 2020, 04:15:14 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ddavidebor

  • Super Contributor
  • ***
  • Posts: 1192
  • Country: gb
    • Sideband
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #4 on: March 12, 2020, 04:14:13 pm »
check STM32, they offer models matching your requirements and have the best development tools in the industry for free (Atollic truestudio). Also, great pricing and range.
Currently working on the future of Altium library management https://getsideband.com/
Need Altium Designer Libraries? Check out https://getsideband.com/libraries (35k symbols, 34K footprints)
 

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #5 on: March 13, 2020, 09:08:39 am »
Thank you for the replies.

I have gathered few options of what I can potentially use.

The list comprises:
LPC17xx
LPC40xx
LPC546xx
STM32H7xx
STM32F1xx
STM32F4xx

I will likely have to use ADC for analog inputs but hoping my digital inputs will be able to feed straight into MCU. So should really live with 64-100 pin chip

Now, as for development software, NXP has MCUXpresso and the ST has STM32CubeIDE. Can anyone point out pros and cos of these two based on personal experience? AFAIK they both are free to use and able to do certain debugging. Only used PIC software before and this is new field for me. Any feedback appreciated  ^-^
« Last Edit: March 13, 2020, 11:47:03 am by bulletbolt »
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 803
  • Country: lt
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #6 on: March 13, 2020, 06:12:02 pm »
If High-Reliability is a hard requirement, then probably you need to look into Automotive series. We're using ST SPC56 and Renesas F1L/F1H in automotive now and both seem to work fine. For small communication and control we also use STM8A.
 

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #7 on: March 16, 2020, 09:11:51 am »
It is not MIL spec requirement but the product will spend 99% of it's time outdoors, in any country in the world. Operating temperature would be in the range of -20 to +80 (considering exposure to hot sun in the middle of the summer), certain vibration level (mainly caused by cheap diesel generators) and some abuse from end user (such as 'woops, hammer slipped out of hand' impacts, although not direct to the PCB)

Your suggested SPC has high pin counts which is something we are trying to avoid, since the PCB is fairly big and may be subject to some bending. Also the price seems to be double compared to STM32F413RG which we have as option 1 at the moment.

But thank you for recommendation, it may be considered for other application.
 

Offline fchk

  • Frequent Contributor
  • **
  • Posts: 430
  • Country: de
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #8 on: March 16, 2020, 11:21:21 am »
For safety, look here:

http://www.ti.com/microcontrollers/hercules-safety-mcus/overview.html

They already have IEC 61508 SIL 3 and ISO26262 ASIL D certifications, and they are version qualified for -40 to +125 degC.

This should be quite a safe way to go. All memory is ECC protected, the two cores run in lockstep mode, there are qualified self-diagnostic software modules, and much more.

fchk
 
The following users thanked this post: bulletbolt

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #9 on: March 16, 2020, 12:33:14 pm »
That's really good, thank you!


TMS570LS0232 seems to have lots of potential in this case, plenty of features and priced very well.

How about implementation? TI toolchain etc?
 

Offline fchk

  • Frequent Contributor
  • **
  • Posts: 430
  • Country: de
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #10 on: March 16, 2020, 01:55:18 pm »
That's really good, thank you!


TMS570LS0232 seems to have lots of potential in this case, plenty of features and priced very well.

How about implementation? TI toolchain etc?

There is a Launchpad for quick tryout:

http://www.ti.com/tool/LAUNCHXL2-TMS57012
https://uk.farnell.com/texas-instruments/launchxl2-tms57012/eval-board-tms57012-hercules-launchpad/dp/3009875?st=LAUNCHXL2-TMS57012

Code Composer ist free since version 7:
http://www.ti.com/tool/CCSTUDIO-SAFETY

fchk

 

Offline bulletboltTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #11 on: March 16, 2020, 02:17:09 pm »
What about in circuit programmer?

I spent some time in TI website but could not find any information. Do they not have own tool? Or it's all done via direct USB?
 

Offline fchk

  • Frequent Contributor
  • **
  • Posts: 430
  • Country: de
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #12 on: March 16, 2020, 03:12:16 pm »
Segger JLINK is supported.
And they have their own:

Highest Performance with realtime trace, very expensive!
http://www.ti.com/tool/TMDSEMU560V2STM-UE

Faster:
http://www.ti.com/tool/TMDSEMU200-U

Cheaper:
http://www.ti.com/tool/TMDSEMU110-U

The Launchpads have their own XDS110 onboard.

You won't need more then an XDS200.

fchk

PS:
http://www.ti.com/tool/HALCOGEN
« Last Edit: March 16, 2020, 03:15:29 pm by fchk »
 
The following users thanked this post: bulletbolt

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5404
  • Country: nl
Re: Help choosing microcontroller (CAN Open Safety project)
« Reply #13 on: April 02, 2020, 02:28:46 am »
As of analog inputs...
One way to make a rudimentary ADC is with a RC circuit:

1. Set pin to output low, and discharge capacitor.
2. Set pin to input and wait until it goes high, measure time.
3. Set pin to output high, charge capacitor.
4. Set pin to input and wait until it goes low.

Bit of math magic to deduce an input voltage.
You can also do this with 2 pins. One pin just measures, and the other charges and discharges the capacitor via a resistor. and then deduce input voltage from the assymmetry of the logic input.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->