jams: Curious in Colorado

jams
Posts: 8
Joined: Sun Jan 14, 2018 4:28 am

jams: Curious in Colorado

Post by jams » Sun Jan 14, 2018 10:25 pm

Hello everyone,

I'm a retired scientist and inventor-type who focuses on small, inexpensive sensor packages for some environmental and automotive applications. I have no formal training in electronics, but thanks to the Arduino world I've been able to implement a few of my ideas. Microchip Technology, Inc. threw a big wrench into that though, when they recently stopped production of Atmel's "automotive-rated" version of the atmega328p MCU after buying out Atmel. I used that 328p in a replacement electronic control unit that I've designed for some older collector-type cars. Unfortunately, I haven't been able to find any other automotive-rated MCU that are 100% compatible with the Arduino IDE. This happened just as I was about to license that design to an aftermarket parts company. Bummer.

My search for an alternative MCU has led me to the STM8 series (the STM8A in particular - another option is the PIC series). Digging deeper regarding how hard it would be to switch to the STM8 from the atmega328p in turn led me to this site and, in particular, the discussions of "sduino (by tenbaht)" and "stm8sduino (by dannyf)". As a non expert in MCU engineering and programming, it's pretty scary to see what's involved in stepping outside the Arduino world, in terms of needing to switch to a different IDE, to not be able to rely on existing libraries, and to face the idea of converting C++ to C code, etc. I'm basically a cut-and-paste programmer who knows enough to revise and adapt other people's code but struggle in writing complex routines from scratch (unless it's in Fortran - yes, I'm that old!) The efforts underway to bring the STM8 into at least some aspects of the Arduino ecosystem therefore have given me a bit of hope. (In fact, I just came across another project today along these lines - https://github.com/gicking/STM8_templates).

My intent now is to learn from and perhaps contribute to the sduino/stm8sduino efforts. I've installed the sduino tools developed by tenbaht (Michael), and have got a few basic things to run on an STM8S103F3 board using the modified Arduino IDE, but I'm running into problems communicating with a couple of external devices I use that talk via I2C and SPI. I also don't know what will be involved in ultimately moving from the STM8S to the automotive-version STM8A. I've therefore got a long way to go before I can revise my automotive ECU board.

Of course, just about the time I get all this figured out, an automotive-rated MCU that's 100% arduino compatible will hit the market! But I'm (mostly) enjoying the learning process re. the STM8.

Jim

stevestrong
Posts: 2061
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: Curious in Colorado

Post by stevestrong » Sun Jan 14, 2018 10:46 pm

Welcome Jim.

Btw, have you considered to switch to STM32?
I do not know anything the STM8 can do better than STM32, which is more powerful and, most important, is better supported here in this forum.

jams
Posts: 8
Joined: Sun Jan 14, 2018 4:28 am

Re: Curious in Colorado

Post by jams » Sun Jan 14, 2018 11:09 pm

Yes, I've considered the STM32 but as far as I can tell, there doesn't yet appear to be a version that has the automotive AEC-Q100 rating. The automobile application that I have involves putting the microcontroller into an environment (within the engine bay) that subjects my board to relatively high temperatures and a lot of electromagnetic interference, so the AEC-Q100 rating is something that I probably shouldn't move away from. There's an STM32 version that is rated up to 125 deg. C operating temperature, but it's still lacking the full automotive certification.

User avatar
mrburnette
Posts: 2207
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Curious in Colorado

Post by mrburnette » Sun Jan 14, 2018 11:36 pm

Jim,

Were you using the atmega328P in 5V or 3.3V mode?
Moving to the STM32Fx series would move the SNR to 3.3V signaling - this could be an issue if you designed for 5.0V and operate with a high noise-floor.

Ray

jams
Posts: 8
Joined: Sun Jan 14, 2018 4:28 am

Re: Curious in Colorado

Post by jams » Sun Jan 14, 2018 11:50 pm

Ray,

Yes, I was running the ATMega328P using 5V. I hadn't thought about whether the MCU's operating voltage would have an effect on sensitivity to EM noise. That might be one advantage to going with the STM8 vs. STM32 or another 32-bit chip since the STM8 can operate at 5V.

For this automotive ECU of mine, I encase the electronics within copper mesh to essentially create a "Faraday cage" to help minimize the EMI problems. Without that protection, the ECU won't function in any reliable way. (The electromagnetic noise in these older (late '70s through early '90s cars is really significant.) My circuitry does use a 3.3V chip (a thermocouple interface chip), so I step down the voltage for that chip.

Jim

zmemw16
Posts: 1681
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Curious in Colorado

Post by zmemw16 » Mon Jan 15, 2018 12:06 am

maybe the first few of google with 'controlling emc for older cars' might suggest some other avenues ?
srp

jams
Posts: 8
Joined: Sun Jan 14, 2018 4:28 am

Re: Curious in Colorado

Post by jams » Mon Jan 15, 2018 12:16 am

Yes, there's a lot of info. out there on EMI mitigation - I've incorporated some of that into my design and have done some basic things such as adding filter circuitry and ground planes on my PCB. And that may be another reason to stick with an 8-bit MCU at relatively low clock speed. A problem with trying to address the electromagnetic noise is that there's so much going on within the engine bay (ignition system, alternator, possible variations with RPM, different mounting locations depending on car model, etc.) that it's hard to pinpoint what frequencies are most prevalent. For example, I found that wrapping the ECU in copper foil didn't work as well as using the copper mesh shielding.

zmemw16
Posts: 1681
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Curious in Colorado

Post by zmemw16 » Mon Jan 15, 2018 12:20 am

how much of these signals could be gathered or communicated optically ?
almost certain to increase cost though, pick or choose carefully as well.
srp

User avatar
mrburnette
Posts: 2207
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Curious in Colorado

Post by mrburnette » Mon Jan 15, 2018 12:26 am

zmemw16 wrote:
Mon Jan 15, 2018 12:06 am
maybe the first few of google with 'controlling emc for older cars' might suggest some other avenues ?
srp
Faraday shielding is perfect if the shield is perfect, but "perfect" does not occur in deployment. I have done some work with an experimental aircraft with a Rotax engine. Faraday shielding and aggressive bypassing has been shown to work adequately.

Google search for best practices...

For the aircraft, I selected the AVR Mega at 5.0 Volts.

Ray

jams
Posts: 8
Joined: Sun Jan 14, 2018 4:28 am

Re: Curious in Colorado

Post by jams » Mon Jan 15, 2018 12:46 am

zmemw16 wrote:
Mon Jan 15, 2018 12:20 am
how much of these signals could be gathered or communicated optically ?
almost certain to increase cost though, pick or choose carefully as well.
srp
It probably wouldn't be practical for this case, since it would need adding cabling through different locations in the cars. Cost is a factor too. Plus, it seems like the noise isn't affecting the incoming or outgoing signals but instead hammers the ECU directly. I'm certainly no expert in this area though.

Post Reply