Another MCU?

Hello,

I'm working on electronic module for motorcycles, now I've got working prototype with atmega328p MCU, but I'm looking for something different.

Best one would be with 12-bit ADC, and that can run without external crystal (less emited noise).

I've found SAMD21 (same as on arduino zero), but that's tricky to upload bootloader since I don't want to get programmer.

Anyone has example of MCU that will comply with my needs?

My needs:

  • "automotive" MCU,
  • 12-bit ADC,
  • at least 2 external interrupts,
  • EEPROM for 50 ints,
  • programmable in arduino ide,
  • can run without external crystal,
  • 3.3V will be nice, but that is not a must,
  • I2C.

I think that's all.

Chinese guys created an “improved” clone of Atmega 328 - LGT8F328P
It has 12bit ADC, can run witgout cristall on 32MHz, has extra timer, no fuses, embedded DAC etc. But otherwise compatible.
Datasheet (google translated) - https://www.electrodragon.com/w/images/b/b6/LGT8F88P_LGT8F168P_LGT8F328P_translated.pdf
You can by an “arduino” board - https://raliexpress.com/item/KEYES-LGT8F328P-UNO/32967207992.html

This board has the same MCU - https://ru.aliexpress.com/item/WAVGAT-Pro-ATMEGA328P-328-ATMEGA328-5-16-arduino-Nano-Micro/32954774902.html

One more board - LILYGO? TTGO XI 8F328P-U Development Board For Nano V3.0 Promini Or Replace Sale - Banggood USA sold out-arrival notice-arrival notice

I don't have a recommendation for you...

Best one would be with 12-bit ADC

What are you measuring? i.e. You can get more "range" by switching between the default 5V and internal 1.1V reference.

and that can run without external crystal (less emited noise).

The ATmega chip can run from an internal oscillator, but I don't know if you'll get less elecomagnetic noise. And compared to an ignition system on motor???

I've found SAMD21 (same as on arduino zero), but that's tricky to upload bootloader since I don't want to get programmer.[/quote]Yeah... That's one of the big advantages of the Arduino over a "random" microcontroller.

Automotive-qualified and Arduino don't go together. You may as well ask for medical life-support and Arduino. You will get the same answer.

However if your application is not going to be controlling the brakes or steering then limiting yourself to things that can be programmed in Arduino IDE is not too difficult.

Have a look at the Teensy series. The Teensy 3.2 will probably do what you want.

However if your application is not going to be controlling the brakes or steering then limiting yourself to things that can be programmed in Arduino IDE is not too difficult.

I'm not going to control any of main safety devices in car, only cutting ignition :slight_smile:

By "automotive" MCU I meant that they are recomended by manufacturer, because they comply with AEC-Q100.

As You can see on Microchip website:
ATSAMD21E15 - recommended for automotive designs,
ATSAMD21E15L - not a word about recomemdation for automotive.

I'm going to sell that product, thats why I'm worried about compliance etc.

DVDdoug:
What are you measuring?

The ATmega chip can run from an internal oscillator, but I don't know if you'll get less elecomagnetic noise. And compared to an ignition system on motor???

I'm measuring readings from in-amp which reads strain gauge bridge. That's why every bit counts for me. Range is 0-3.3V, then I can't go for 1.1V.

When it comes to emited EMC noise I've read that internal oscilator generates less noise than external, then I'd like to throw away external and run only off internal one.

Right now I have 5V regulator on board and then 3.3V for OLED display, and it would be best solution if i can throw away 5V regulator and run with only 3.3V, but doesn't atmega328p have problems with running on 3.3V and internal clock? That's why I'm looking at SAMD21.

Here, in Poland I can't get teensy 3.2 chips, since I don't want to use boards, just chips...

alesam:
Chinese guys created an “improved” clone of Atmega 328 - LGT8F328P
It has 12bit ADC, can run witgout cristall on 32MHz, has extra timer, no fuses, embedded DAC etc. But otherwise compatible.
Datasheet (google translated) - https://www.electrodragon.com/w/images/b/b6/LGT8F88P_LGT8F168P_LGT8F328P_translated.pdf
You can by an “arduino” board - https://raliexpress.com/item/KEYES-LGT8F328P-UNO/32967207992.html

This board has the same MCU - https://ru.aliexpress.com/item/WAVGAT-Pro-ATMEGA328P-328-ATMEGA328-5-16-arduino-Nano-Micro/32954774902.html

One more board - LILYGO? TTGO XI 8F328P-U Development Board For Nano V3.0 Promini Or Replace Sale - Banggood USA sold out-arrival notice-arrival notice

Hmm... chinese chip... I'm a bit worried about compliance with any directive...

The m328 will run fine with 3.3V and the internal 8MHz oscillator. It’s 16MHz that’s a problem.

As for noise - are you already doing the separate Vcca, with its low-pass filter?

Samd seems like a good match - why are you avoiding a progragmmer? An mplab snap is only about $15, a pickit4 about $50...

Kamool:
I'm not going to control any of main safety devices in car, only cutting ignition :slight_smile:

You really are kidding, right? :astonished: :astonished: :astonished:

westfw:
The m328 will run fine with 3.3V and the internal 8MHz oscillator. It’s 16MHz that’s a problem.

As for noise - are you already doing the separate Vcca, with its low-pass filter?

Samd seems like a good match - why are you avoiding a programmer? An mplab snap is only about $15, a pickit4 about $50...

MPLab Snap? I've never heard of that, 15$ seems to be a fair price in comparison to atmel ICE 100$...
Can I flash arduino bootloader to SAMD21 with that MPLab Snap? Or maybe STLink?
Meybe easiest way to flash SAMD21 chips is to get Arduino Zero with programming port, de-solder chip, solder my new chip, use programming port, then de-solder that and soler on my custom board?

Paul__B:
You really are kidding, right? :astonished: :astonished: :astonished:

Nope, that's called Quickshifter :slight_smile:

Kamool:
I'm going to sell that product, thats why I'm worried about compliance etc.

Kamool:
MPLab Snap? I've never heard of that, 15$ seems to be a fair price in comparison to atmel ICE 100$...

Since when is $100 a big amount in the development of a commercial product? The cost of prototypes etc. is likely to be a lot more than that already, even if you don't charge for the countless hours you spend on it!

wvmarle:
Since when is $100 a big amount in the development of a commercial product? The cost of prototypes etc. is likely to be a lot more than that already, even if you don't charge for the countless hours you spend on it!

It isn't, but that's money I will have to spend for thing I won't use for something else.
What about idea of buying arduino zero and de-soldering and soldering module when I will need to flash new one?
Programming port works like programmer?

Soldering? WTF? Those boards are not designed to be desoldered cleanly at all. Why don't you get your prototype fully working, then decide on the MCU you want to use for your final product, and move on with that.

Cost of a single programmer should be no issue for a commercial product that would presumably be produced in the thousands if not more. If your market is much smaller than that, your customers will be happy to pay the price for their unique product.

wvmarle:
Soldering? WTF? Those boards are not designed to be desoldered cleanly at all. Why don't you get your prototype fully working, then decide on the MCU you want to use for your final product, and move on with that.

I mean I cound desolder SAMD21 chip from Arduino Zero board, then solder my new one, flash that and then solder that on my custom board.

As I said, I've got working propotyte with ATMEGA 328p, I can bring that to the marked, but in my opinion, more ADC resolution will result in better product. Also 3.3V will eliminate one voltage regulator, so less potential failures.

wvmarle:
Cost of a single programmer should be no issue for a commercial product that would presumably be produced in the thousands if not more. If your market is much smaller than that, your customers will be happy to pay the price for their unique product.

I think it's nowhere near thousands, it's like hundreds.

Another option would be to use an external ADC, eg MCP3201T (12bit, 1 input, 100k sampling rate). Using that with the Atmega328 running at 3.3v on the internal oscillator would practically solve all your problems.

Note that many MCUs do not have built-in EEPROM (eg, SAMD21). So you would need to consider that in your final project.

John_S:
Another option would be to use an external ADC, eg MCP3201T (12bit, 1 input, 100k sampling rate). Using that with the Atmega328 running at 3.3v on the internal oscillator would practically solve all your problems.

Note that many MCUs do not have built-in EEPROM (eg, SAMD21). So you would need to consider that in your final project.

Probably I'll have to go that way... I have some spare ADS1115, and I'll try to use that :slight_smile:

Still... Atmega328p is not automotive, then I'll have to ask in my lab how they test equipment.

Also I've found infomation that Atmega doesn't work well in noisy enviroment (like close to engine with all electronics), and PICs works better... Thn maybe I'll learn how to programm PICs.

Yah, I know that, but there are also ways to use flash memory as EEPROM.

Kamool:
I mean I could desolder SAMD21 chip from Arduino Zero board, then solder my new one, flash that and then solder that on my custom board.

I think we have to conclude that if you had the skill, experience and tooling to do that, you would not be asking such questions on this forum. :astonished:

Kamool:
Probably I'll have to go that way... I have some spare ADS1115, and I'll try to use that :slight_smile:

Still... Atmega328p is not automotive, then I'll have to ask in my lab how they test equipment.

Also I've found infomation that Atmega doesn't work well in noisy enviroment (like close to engine with all electronics), and PICs works better... Thn maybe I'll learn how to programm PICs.

Yah, I know that, but there are also ways to use flash memory as EEPROM.

There are automotive qualified AVRs.

AVRs can be used in noisy environments - you just need to take precautions against the noise causing problems. This is true of other microcontrollers too.

You can also get an I2C EEPROM chip. They're dirt cheap.

Soldering and desoldering a chip to program it is a spectacularly bad idea because the desolder process is likely to destroy it. It also makes development very tedious.

Design your circuit board to include an ISP header.

ATSAMD21E15 - recommended for automotive designs,
ATSAMD21E15L - not a word about recomemdation for automotive.
:
Here, in Poland I can't get teensy 3.2 chips, since I don't want to use boards, just chips...

I'm not sure where you see the "recommended for automotive" designation - I can't find it on either website or datasheet. There's stuff about AEC-Q100 in the datasheet, but I'm not quite sure how to read it.

Are you sure you can get the Automotive versions in Poland? I only see "ATSAMD21E15B" at most actual vendors, and I'm not sure how that fits in. (hmm. Looking at the datasheet more closely, it seems that you'd need an ATSAMD21E15B-xZx chip (where Z is the relevant "AEC Package grade." I don't see that actually available at an US vendors (not even the MicrochipDirect store...)
Also note that the 21E15 varieties of the chip are NOT supported by Arduino, AFAIK.

DrAzzy:
There are automotive qualified AVRs.

AVRs can be used in noisy environments - you just need to take precautions against the noise causing problems. This is true of other microcontrollers too.

You can also get an I2C EEPROM chip. They're dirt cheap.

Automotive AVRs?
Which one I can actually buy?

westfw:
I'm not sure where you see the "recommended for automotive" designation - I can't find it on either website or datasheet. There's stuff about AEC-Q100 in the datasheet, but I'm not quite sure how to read it.

Are you sure you can get the Automotive versions in Poland? I only see "ATSAMD21E15B" at most actual vendors, and I'm not sure how that fits in. (hmm. Looking at the datasheet more closely, it seems that you'd need an ATSAMD21E15B-xZx chip (where Z is the relevant "AEC Package grade." I don't see that actually available at an US vendors (not even the MicrochipDirect store...)
Also note that the 21E15 varieties of the chip are NOT supported by Arduino, AFAIK.

"recommended for automotivE" mark is on upper-right corner of website.
21E15 was just given just as example.