Author Topic: the most reliable low-end microcontrollers  (Read 25689 times)

0 Members and 1 Guest are viewing this topic.

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 6054
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: the most reliable low-end microcontrollers
« Reply #25 on: May 20, 2012, 04:19:08 pm »
Interesting things to consider:

Do I need to consider the software aspects as well? It seems most microcontrollers are used in automotive systems so once I have some working software is that it?
Almost equally important as hardware. Software will be very important when dealing with electrically harsh environments. For example, noise on power may case the device to reset or trigger unexpected interrupts - in this sense you need to recover gracefully from these conditions without blowing up stuff along the line or "locking up" - the so-called exceptions. Typically larger CPUs have specialized hardware to deal with exceptions (the x386's or R4's previously mentioned, but there are others).

Also, keep in mind that any CPU (complex or simple) is programmable using plain C language, therefore the core software (your main algorithm) can be easily portable across processors. The hardest is the software used to program each processor's individual features - mostly the peripherals. To reduce the efforts for this second scenario, watch out for the availability of example code from manufacturers and/or developers to program GPIOs, ADCs, PWMs, etc.

This should be really basic stuff where a microcontroller will just be replacing a few chips to make better use of space or add that little function that would otherwise require lots of chips.
I don't know about 386's, but R4's (like the TMS570, for example) have built-in flash and RAM and therefore keep you from having to add tons of external devices. A clock circuit and the bypass capacitors are all you need to have the device up and running - similarly to a microcontroller.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27872
  • Country: nl
    • NCT Developments
Re: the most reliable low-end microcontrollers
« Reply #26 on: May 20, 2012, 05:22:55 pm »
For automotive their is a set of C programming rules called MISRA. These rules are intended to avoid many C pitfalls in order to create robust software.

In my own software I use a lot of range checks in functions intended to be called by other modules. This helps to make sure an error doesn't spread like an oil stain. A bad parameter causes something to not work instead of crashing the program for an unknown reason.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #27 on: May 20, 2012, 05:30:08 pm »
guys I am not looking at engine management here or anything complex like that. Just controlling various devices in response to push buttons or other switches in the system for example pressure switches. If the system is to reset that should not be too much of a problem obviously it can't keep resetting perpetually. Given the small amount of power required by the microcontroller and associated electronics it should be relatively easy to protect it from spikes and load dumps. The problem my company have had in the past is that they have not bothered at all to try and deal with these things. It is not something that has ever been discussed with the customer. Most of the problems my company have are down to poor communication.

In the very distant past we were cleverer, there is an air conditioning system we supply to a military end-user. The first thing in the system is a series of 10 movs in parallel. They obviously forgot why they use these, and these days don't bother any more. The reason these were putting I am told is because of the spikes coming off the alternator in the vehicle. I am guessing that with a 450 amp system there can be some powerful spikes floating around.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #28 on: May 20, 2012, 05:53:42 pm »
Yes, a clean power supply is a very important thing. think of old Jaguars, a lovely exterior, but with a fuel consumption second to none, and electrics by Lucas, the prince of darkness.

100v plus spikes with every plug firing, 5V of alternator noise on the supply, battery voltage of 6V during starting and load dump transients of 400V are vety common. You need to at least have on the power input a series resistor ( a polyfuse as well will be better), a reverse voltage diode, a transient suppressor diode and then an automotive rated 5V regulator with watchdog output. That, along with some electrolytic and ceramic bypass and reservoir capacitors, gives a clean power supply to the micro, and a reset input that will handle brownouts properly. A separate power relay supply with only basic overvoltage protection ( 40v transient suppressor and polyfuse) will then be used to drive compressor clutches from the battery supply.

All inputs need at least a pull down resistor, a series resistor and a pair of catch diodes to  a overvoltage protected bus, basically a diode isolated 5V rail ( fed from the main rail by a 1A schottky diode) with a 5.6V 1W zener across the rail, then a resistor to the micro input. This will survive any automotive voltage applied to it aside from the coil voltage. No direct outputs from the micro, at least a power transistor as a buffer, with a catch diode to the input rail if needed, and a transient suppressor across the transistor as standard, a 40V MOV and a 100V rated transistor works well here.

All basic protection, adds a little to board space, but the saving in warranty returns will be considerable. You can make a model for each one and repeat as needed, a common BOM will work wonders with bulk buying and dropping per unit cost. About the only leaded items are the 1W zener and the MOV's, the rest are available as SM parts, and you can use SM parts for the MOV's if you parallel 2 lower rated devices as well.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #29 on: May 20, 2012, 06:05:14 pm »
Yes when I did do some testing for them they were finding it hard to believe that 400 V could come off of a compressor clutch coil. So I told the technical director, my oscilloscope may have been fooled but the shock I felt in my fingers when I held the PCB of the thermostat under test was unmistakable. In this case it was due to stupid design and a lack of back EMF diodes. Prior work back EMF diodes are a new thing apparently, although some people are pretty sure they were used in the past. In fact I found on some older projects a standard part on the parts list for relays are Relays with back EMF diodes built in. But that's progress. I'll be heading straight back to the dark old days, and then bringing us up to date.

I'm not sure what point I will start doing electrics, the first thing they will put me onto is learning the CAD software and I will be a draughtsman mainly, I'm guessing I will be called on for electrics as and when needed. Hopefully I get through the CAD learning quite quickly and have time for Electronics. We don't need a huge amount of electronics were I work, but knowing them they will diving headfirst and get burnt when they do decide to go more electronic. I know that the one and only current electronic design is not turning out as easy as they thought. But then if you have an engineer asking you if a ground pin is an output or an input you don't really need to wonder why.

the guy is going to retire soon I'm guessing I may replace him eventually
« Last Edit: May 20, 2012, 06:08:09 pm by Simon »
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #30 on: May 20, 2012, 06:24:01 pm »
If you are going to drive the clutch directly from the board I would recommend using a relay, and place a MOV across the output, 60V will do, instead of the catch diode. add a snubber and another MOV across the relay coil as well, 10R in series with a 100n 250v polywhateverwillfitthespace will be a good starting value. This will keep the spike to a sane level, but will allow the clutch to drop out fast.  MOV's will have to be leaded big units, to have enough heat capacity to handle frequent switching while not burning the relay contacts. When selecting relays take care with inrush current ratings versus on current ratings.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #31 on: May 20, 2012, 06:27:37 pm »
Usually a decent back EMF diode is all that is needed for a compressor clutch. It is only one and a half amps and is only used "occasionally" as far as electronic timings go. Of course if you don't bother with one, you may be left wondering why you have 400 V at the thermostat that controls the clutch. I think due to the voltage it was jumping across relay contacts before they had the chance to disengage, or possibly jumping the small gap as the relay started to open.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #32 on: May 20, 2012, 06:37:35 pm »
Are you sure it is 1.5A, i have seen many that draw around 5A, some up to 10A on initial engagement. The MOV is a lot better than a diode, it allows a small spark, and allows the coil to disengage the clutch faster, saving wear. The MOV's are available in many voltages, generally choose one of double the battery voltage and place across the contact.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #33 on: May 20, 2012, 06:39:58 pm »
the compressors we use all have a one and a half and clutch. I don't understand how a mov will allow the clutch to disengage faster, surely when you pull the power it disengages, but diodes will just take care of the back EMF in the coil.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #34 on: May 20, 2012, 07:02:52 pm »
The diode allows current to circulate in the coil until the energy is dissipated in resistance and diode forward voltage drop. The MOV has a higher voltage and dissipates the energy faster, and thus the coil drops out faster.

Look on it as faster dissipation of energy. With nothing there the voltage creates an arc across the relay contacts and dissipates the energy that way. Trade speed of opening with voltage spike.

Analogous to a SMPS in many ways.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #35 on: May 20, 2012, 07:08:49 pm »
I see, if the clutch stays in for another fraction of a second that is not a problem. But if as you say a mov will dissipate faster that is good. But the mov will not go off until a set voltage, where as the diodes will immediately catch the negative peak. So I still don't understand how a mov is faster.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #36 on: May 20, 2012, 07:21:33 pm »
The diode allows the current to circulate until it decays, with most of the power dissipated in the coil. The MOV dissipates most of the energy when it switches off. A negative spike on a relay output is no concern, you only have to watch out for excursions above or below the supply rails if you are using semiconductor switches instead of a mechanical relay, as then you might stress junctions that have limited energy handling capacity.

Do an experiment, using a battery and the biggest iron inductor you can find, using the catch diode and the mov respectively, using a mechanical switch. Use a 10x probe and a high volt/div initially so as  not to pop the scope. If you do not have a 60V MOV use a pair of 47V zener diodes back to back instead.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #37 on: May 20, 2012, 07:25:55 pm »
I see, well as the coil can handle that dissipation, it would not be a problem would it? Yes 60 V across relay contacts should not be a problem. But I would rather kill any negative spikes off altogether. If the clutch is controlled by semiconductor surely all the more reason to use a diode?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #38 on: May 20, 2012, 07:36:01 pm »
Depends how the coil is connected. If you are doing a low side switch you just need to have a MOV across the coil connection, and a transistor with a Vce more than the mov rating at the current in the coil. A high side switch will need the diode to prevent the power device being pulled below the negative rail.

A suggestion for the high side you can do with the catch diode is to place a zener in reverse in series with it, this allows the zener to do the dissipation without exceeding the transistor ratings. Zener needs a rating equal to coil energy, the mov is cheaper than a 5W zener, or you can use a TVS diode at a cost in between.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #39 on: May 20, 2012, 07:38:39 pm »
Yes a TVS would be a good idea. But I'm not sure when you would ever see a positive spike, unless of course it was a power surge.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: the most reliable low-end microcontrollers
« Reply #40 on: May 20, 2012, 07:46:47 pm »
In low side switching the spike is always positive going................
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #41 on: May 20, 2012, 09:11:27 pm »
is it? I suppose it is, because the positive side of the coil is tied to the positive power rail and so still has a reference. But the negative side is floating and so the opposite polarity spike on it will go positive way above the power supply positive. But then I reversed diodes will still do the job, because the same logic applies but round the other way.
 

Offline jerry507

  • Regular Contributor
  • *
  • Posts: 247
Re: the most reliable low-end microcontrollers
« Reply #42 on: May 21, 2012, 04:53:57 am »
At page three the answers all seem to focus on designing systems for missile guidance, not simple control panels. Just go with an older PIC and use the internal watchdog timer. If you don't feel safe enough, use an external. Write your code from the ground up to use it, don't add it as an afterthought. Be careful about your inputs, low pass filters, series resistors or ferrite beads, even buttons. There likely isn't a thing you'll be using the micro for that will explode if your micro locks up, so don't be terrified by the doom and gloom people. Just make sure it's easy to reset the unit just in case it does lock up....
 

Offline andersendr

  • Regular Contributor
  • *
  • Posts: 56
  • Country: us
Re: the most reliable low-end microcontrollers
« Reply #43 on: May 21, 2012, 05:36:59 am »
I know some of the Freescale micros have built in multiple CPUs and built in error checking for vehicle control systems.  They will have 4 CPUs, 3 will execute code, while the 4th checks all their results.  Not sure if these are available for sale yet.  It was about a year ago we had a meeting with one of their design engineers and he was talking about this.  FYI, we were evaluating these for use in fire truck/emergency rescue vehicle electrical control systems for use in the USA. 
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #44 on: May 21, 2012, 06:16:37 am »
At page three the answers all seem to focus on designing systems for missile guidance, not simple control panels. Just go with an older PIC and use the internal watchdog timer. If you don't feel safe enough, use an external. Write your code from the ground up to use it, don't add it as an afterthought. Be careful about your inputs, low pass filters, series resistors or ferrite beads, even buttons. There likely isn't a thing you'll be using the micro for that will explode if your micro locks up, so don't be terrified by the doom and gloom people. Just make sure it's easy to reset the unit just in case it does lock up....

That seemed to be the case from the beginning, my main point was missed and most suggestions have been worded as though I was doing something highly critical. As you say this is just running a few basic devices and if the system resets it wouldn't be the end of the world.

I don't know what the scope of arduino is and if I can use it in a commercial design but I'm going to start learning that for myself. Although having read the instructions on the website, I see they have suffered the same pitfall all my Microcontroller language designers seem to which is to explain a complicated Concept and then tell you about the basic elements in that when they should have done it the other way around. Try the page on how to The link and LED while you are doing something else.They never actually explain how to do something else but just some new code. And then you have to go to find out what that new code Means on another page because they should have explained it before they told you how to link the LED.
 

Offline mc

  • Regular Contributor
  • *
  • Posts: 155
  • Country: scotland
Re: the most reliable low-end microcontrollers
« Reply #45 on: May 21, 2012, 11:06:30 am »
I see, well as the coil can handle that dissipation, it would not be a problem would it? Yes 60 V across relay contacts should not be a problem. But I would rather kill any negative spikes off altogether. If the clutch is controlled by semiconductor surely all the more reason to use a diode?

Common automotive practise is you switch the high side with a relay, and don't do anything about the voltage spike at the compressor side. If an elctronic controller is used, then spike protection is built in to the controller to protect it from the relay, and that is usually just a diode. I don't think I've come across any compressor clutches that don't use a relay, as a relay was the easiest way of dealing with the inductive load, as they can handle the high inrush current, and are more than capable of blowing fuses if a fault occurs.
I doubt this will change now, as most manufacturers are moving to variable output/swashplate compressors, which require a PWM supply to control output.
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: the most reliable low-end microcontrollers
« Reply #46 on: May 21, 2012, 11:55:01 am »
Simon,

As you are coming from a hardware background and have said you're not too much of a programmer I would suggest going for something like a PIC chip and program it in assembler. Assembler is a lot closer to hardware compared with C. I think you could relate much more readily to that rather than the virtualised environment of C.

For example, you want to turn an LED on and off, here is the code:

Turn it on: BSF PORTA,0       ; Bit set PORTA, BIT 0
Turn it off: BCF PORTA,1       ; Bit clear PORTA, BIT 0

The text after the ; are my comments, not part of the code.

So that's the output. Inputs are just as easy with bit test instructions.





 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18022
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: the most reliable low-end microcontrollers
« Reply #47 on: May 21, 2012, 12:04:38 pm »
I tried assembler a long time ago and nearly gave up on MCU's altogether (in fact electronics all together). I'm ok working more abstractly, I was ok with the mikroe basic system but it was buggy.

The problem I have is people explaining a particular language are very good as telling you about something more complex before telling you the basics as though you know them already, and these will be people that are supposed to be teaching you from scratch.

On the arduino page they explained how to blink a led, fine, then they said but you don't want to stop the program with a delay instruction so do this. An explanation then ensued where nothing was clearly explained and a new instruction suddenly appeared from nowhere, there was a link at the end of the page to its explanation but that was not much help after I had spent 5 minutes trying to figure out what the hell they were on about. And after all that they did not actually show you how to do something else while blinking the led which completely defeated the object as you were back to square one and knew how to do the same thing with different instructions. I mean duh ?????????

If you look at the explanation on PWM they made it almost child like, it just does not make sense.

I'm willing to learn but teach me in the right order, if you use unknown concepts to explain a new concept you are explaining nothing at all. I'd rather have a book that goes through it in order rather than hundreds of interlinked pages that send you round in circles. Assembly may well be easy, but I'm yet to find someone who has the decency to teach it properly.
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 796
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: the most reliable low-end microcontrollers
« Reply #48 on: May 21, 2012, 12:22:41 pm »
I tried assembler a long time ago and nearly gave up on MCU's altogether (in fact electronics all together). I'm ok working more abstractly, I was ok with the mikroe basic system but it was buggy.

The problem I have is people explaining a particular language are very good as telling you about something more complex before telling you the basics as though you know them already, and these will be people that are supposed to be teaching you from scratch.

On the arduino page they explained how to blink a led, fine, then they said but you don't want to stop the program with a delay instruction so do this. An explanation then ensued where nothing was clearly explained and a new instruction suddenly appeared from nowhere, there was a link at the end of the page to its explanation but that was not much help after I had spent 5 minutes trying to figure out what the hell they were on about. And after all that they did not actually show you how to do something else while blinking the led which completely defeated the object as you were back to square one and knew how to do the same thing with different instructions. I mean duh ?????????

If you look at the explanation on PWM they made it almost child like, it just does not make sense.

I'm willing to learn but teach me in the right order, if you use unknown concepts to explain a new concept you are explaining nothing at all. I'd rather have a book that goes through it in order rather than hundreds of interlinked pages that send you round in circles. Assembly may well be easy, but I'm yet to find someone who has the decency to teach it properly.

I can understand where you're coming from. I quoted an assembler example to show how easy it was to do something simple. I personally find assembler easier than, say, C because I'm a hardware guy and assembler feels closer to the hardware.

I don't know if other maker's micros are the same, but there are a few gotchas when using pics. It is a must to look for any possible errata sheets to see if there are any odd little things that don't quite work correctly. Also things like remembering that on some of the chips, the analogue option on many of the pins is enabled by default and you have to set the appropriate register to make those pins digital.

Once you've found the gotchas the hard way or the easy way, you're half way there.






 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1673
  • Country: pl
  • Troll Cave Electronics!
Re: the most reliable low-end microcontrollers
« Reply #49 on: May 21, 2012, 09:12:39 pm »
Maybe I can throw some light on the automotive part (i'm a component engineer in company dealing with automotive safety systems).

1) If you're going for really high reliabiliy, I'd consider for example Infineon. They deal mainly with automotive stuff, we use many of their controllers (16&32bit, no ARM though). You can also consider automotive versions of Freescale and Atmel microcontrollers. Atmels are widely known. For Freescale there's CodeWarrior IDE (which i believe is free for commercial use with some code size limitation). Some microcontrollers are even qualified for operation up to 150 *C (although many parameters derate at such high temperature)

2) high side switching with a relay is a past. At least when dealing with DC power. Now smart high-switches are the way to go. They have orders of magnitude better endurance. They are pretty powerful (like 2x4A smart switch in SO14 package)

3) protection diodes are a must when switching inductive loads.

4) since you're doing commercial stuff, you'll probably have to deal with EMC compliance testing (i guess nobody wants ACC to suddenly switch to +40 *C because of some electromagnetic noise in the enviornment)

I regret that I can't talk more specific (NDA and stuff)
I love the smell of FR4 in the morning!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf