Selecting an appropriate uC for sensing application

Thread Starter

flote21

Joined Mar 19, 2016
6
ello guys!

I want to ask your opinion about which uC is suitable for my application.

The requirements should be:
1) possible to execute a fail safe bootloader or Uploader through UART or SPI or I2C. I want this process should be robust to avoid errors like these:
- Communication break.
- New firmware is corrupt by the time it arrives at the bootloader.
- The power gets interrupted during the boot process.
- What if the bootloader has a bug and craps on itself.
For this reason a simple bootloader is not enough, i need some kind fail-safe mechanism to garantee the right loading process.
2) the uC itself should be very robust to hazard environment. The uc is going to be placed it near of high power IGBTs bridges and a lot of current and high voltages will drive near of it. So I need something so robust like and FPGA.
2) the uC is going to be focused mainly for voltage, temperature and current monitoring. So I will need around 20 embedded ADCs and 2 Embedded DACs.
3) I prefer something from microchip because I already know the IDE. It is free and the support is very good. But I am very open to other manufacturers....

Thanks in advance.
 

Papabravo

Joined Feb 24, 2006
21,225
I don't know that any of the microchip products makes use of a bootloader. So your choices are limited to parts that do use a bootloader. The failsafe nature of the bootloader process is entirely up to you when you write the bootloader. Have you written this type of thing before? It is way more complex than you might imagine. I would study the Zmodem protocol for an idea of how you might do such a thing.

https://en.wikipedia.org/wiki/ZMODEM

If power is interrupted during the boot process, there is nothing you can do except start over when the power returns. If you are updating the bootloader itself you must be able to store the complete image before updating the working image.

Can't help with a bootloader that has a bug.

There are virtually no uCs that are specifically hardened for a hazardous environment. It is up to you to isolate them from their environment. What is it you think is so robust about an FPGA?

I doubt you are going to find a part with 20 ADC's, some of them will need to be external. Don't know of many with embedded DACs

All that said -- Good Luck with your search.
 

dannyf

Joined Sep 13, 2015
2,197
which uC is suitable for my application.
What you are trying to do can be incredibly difficult - depending on what you mean by some of the words you have chosen.

My suggestion would be set low enough a goal so that you can achieve achieve it. Once you have sufficient experience, make incremental improvements.
 

tracecom

Joined Apr 16, 2010
3,944
The PICAXE 40X2 meets some of your requirements. It is a PIC18F45K22 with a bootloader code in EEPROM. It has more than 20 ADC inputs and one DAC output. Beyond that, you'll have to check for yourself.

edited to change DAC input to DAC output
 
Last edited:

Picbuster

Joined Dec 2, 2013
1,047
ello guys!

I want to ask your opinion about which uC is suitable for my application.

The requirements should be:
1) possible to execute a fail safe bootloader or Uploader through UART or SPI or I2C. I want this process should be robust to avoid errors like these:
- Communication break.
- New firmware is corrupt by the time it arrives at the bootloader.
- The power gets interrupted during the boot process.
- What if the bootloader has a bug and craps on itself.
For this reason a simple bootloader is not enough, i need some kind fail-safe mechanism to garantee the right loading process.
2) the uC itself should be very robust to hazard environment. The uc is going to be placed it near of high power IGBTs bridges and a lot of current and high voltages will drive near of it. So I need something so robust like and FPGA.
2) the uC is going to be focused mainly for voltage, temperature and current monitoring. So I will need around 20 embedded ADCs and 2 Embedded DACs.
3) I prefer something from microchip because I already know the IDE. It is free and the support is very good. But I am very open to other manufacturers....

Thanks in advance.
A boot loader with error control is available from microchip depending on the microchip model.
Alternative:
make a boot loader in the protected pic area (not to be erased see microchip application notes)
load the new program in memory or when to big in external mem or usb/ sd
polynomial checksum when ok
store load in execution area chip.
checksum check false redo
ok run program.
 

Thread Starter

flote21

Joined Mar 19, 2016
6
Hi guys!

Thank you so much for your replies!!

I like the option of the PIC18F45K22. I will have a look deeply which options are avialable. I have been also having a look to some application notes from microchip respecting to the bootoloader and I found and AN1310:
http://ww1.microchip.com/downloads/en/AppNotes/01310a.pdf

But I dont't know if this app note is kind of fail-safe bootloader or it is just a simple bootloader...what do u think?

Thanks in advance!
 

Picbuster

Joined Dec 2, 2013
1,047
I have no time to read it all but.. the first impression is a simplified one. However you can use this as a base to start from.
Problems:
* space where to put the 'new' code
* when using the block by block method( due to space issues) an error will force a block retransmit and could create an endless loop when error is persistent. The boot loader should go after N retransmits into a SAVE halt condition avoiding unwanted outputs to peripherals.
( it is form of fail save it works or comes to a halt. acceptable? you have no choice)
 

Sensacell

Joined Jun 19, 2012
3,448
- Place the Bootloader in a write-protected area of memory.
- Make the BL always run first at reset, so you can recover from bad uploads.
- Test the hell out of it, nothing you can do if there is a bug in the BL code.
- Be wary of config bit settings- you need to live with the ones used for the BL for all time.
- Be prepared for a very steep learning curve, implementing a BL is the Everest climb of UC programming.
 

Microzod

Joined Mar 23, 2016
1
Although not Microchip(Not yet anyway but they will own Atmel soon enough) Atmels ATXmega A1 family have 2 internal dual-channel 12-bit DACs(1MSPS) and two 12-bit ADCs(2MSPS) multiplexed to 16 channels(I think it was 16...), they can be programmed in the same manner that the ATmega series is programmed though there are a new concept that is new and quite effective.

I made the switch from using Arduino to Atmel Studio and XMEGA which I have enjoyed very much, XMEGA is great and can be a big step up from ordinary ATmega. For one thing the new Event System is cool but also you get DMAs(Direct Memory Access) and other cool things. External Interrupts on every pin isn't something I complain about...
 

ISB123

Joined May 21, 2014
1,236
Although not Microchip(Not yet anyway but they will own Atmel soon enough) Atmels ATXmega A1 family have 2 internal dual-channel 12-bit DACs(1MSPS) and two 12-bit ADCs(2MSPS) multiplexed to 16 channels(I think it was 16...), they can be programmed in the same manner that the ATmega series is programmed though there are a new concept that is new and quite effective.
Hopefully Microchip won't destroy Atmel with their bad development tools.
 
Top