Help picking the correct microcontroller

quantumkid

Joined Aug 25, 2008
17
I'm just getting started with microcontrollers in general. I have done some work with the 68hc11; I used a decompiler to take apart the code for my car and with the help of others added in some new features. Now I want to move further and use a microcontroller to do so some of the things the ECU cannot do (well...without a lot more work anyway).

I'm planning on using the controller in my car so something that can run on 12v would be nice though if a better controller uses a different voltage I can get a power supply. I need it to be able to monitor the voltage of 10 different sensors so 10 analogue input pins with good resolution in the 0-5v range, output 0-5v on at least 2 pins, and have at least 2 digital pins for a led and a relay signal. It needs to be a least as fast as the 68HC11 (react quickly to changes in sensor data when the engine it spinning at max rpm). Past that I would prefer to start with something I can hook directly to my laptop (serial, USB, or Parallel is fine) to program and as always; the smaller the better. I would also consider one that had a good direct connect version that is larger (for learning and testing) and a smaller version that meets these criteria I could use with an external programmer for a finished project.

I'm not too concerned with how hard it is learning the language; I'm in no rush. Price wise...well I obviously don't want to spend more than I need to. I feel a bit foolish asking this, I know I don't have a simple project in mind and am tackleing a lot. I just want to start with the right microcontroller so I don't invest all my time learning something that cannot do what I want. Thank you.

RiJoRI

Joined Aug 15, 2007
536
Just a comment -- uCs (micro controllers) run at +5v or +3.3V generally. As far as I know, there never were any microcontrollers that ran on +12V. Also, the car's voltage is going to wander all around -- maybe down to 10V or up to 15V, which is a recipe for "toasted controller."

As to the micro itself, I am sure you will get a LOT of answers, mostly in the form of "Micro X is the best!" and "No, Micro Y is better!" You will need to go to the manufacturers' sites, and look at the information there. Microchip (PIC), ATMEL (AVR) are the current biggies, as well as 8051 derivatives, which everyone except Intel makes.

Good luck,
--Rich

quantumkid

Joined Aug 25, 2008
17
Just a comment -- uCs (micro controllers) run at +5v or +3.3V generally. As far as I know, there never were any microcontrollers that ran on +12V. Also, the car's voltage is going to wander all around -- maybe down to 10V or up to 15V, which is a recipe for "toasted controller."

As to the micro itself, I am sure you will get a LOT of answers, mostly in the form of "Micro X is the best!" and "No, Micro Y is better!" You will need to go to the manufacturers' sites, and look at the information there. Microchip (PIC), ATMEL (AVR) are the current biggies, as well as 8051 derivatives, which everyone except Intel makes.

Good luck,
--Rich
Thank for the reply...I didn't know that about the voltage. I figured if the 68hc11 ran on 12v others did as well. 5.5v is fine by me. I'm sure I can come up with something to convert the 12v car voltage.

I'm sure you're right about me getting a lot of the x is better an y. And I do plan on checking out what people suggest. Most of those sites are written for people who know the aberivations and vocab for microcontrollers and since I'm so new I'm affraid I may mistake something like 14 I/O pins ADC for a good fit board only to find that it cannot output (or input) 0-5v with fine enough levels (goes from 1.0v to 1.5v with out 1.1, 1.2, etc), or it isn't fast enough, etc. I know eventually I'll learn all the vocab and as such, but until I do I don't want to make a mistake that will cost me money and time if I can avoid it. Thank again.

Arm_n_Legs

Joined Mar 7, 2007
183
You may like to check out the Atmel AT89C5131 (about USD8). It can simply hook up to the PC USB port for code programming. The downloading programming on the PC side, FLIP, is free from Atmel.

SgtWookie

Joined Jul 17, 2007
22,219
Well, you need to figure out what kind of resolution is required for your ADC. 10 bits (1024 steps) and 12 bits (4096 steps) are pretty common. If you need more than that, you're really going to have to use external ADCs, as the digital environment in a uC is too noisy.

It also takes time to convert from A to D. Generally, the more bits, the longer it takes - at least for the same class of uC. You can get ADCs with lots of bits that are blindingly fast, but they're expensive, and not part of a uC.

Here's an application note on layout considerations for an application with a 12-bit ADC:
While Microchip parts are featured, it is still quite useful as a general guideline. It will help you greatly reduce or altogether avoid a number of pitfalls.

You're going to need a uC that has industrial temp ratings (-40°C to 125°C), because automotive environments are quite severe.

As far as DAC output, quite a few offer PWM output, which can be used in conjunction with an RC network to produce a reasonably constant DC level.

You'll want at least a 16 bit uC. 32 bits would be faster and perhaps a bit easier to perform arithmetic operations.

The better you define your requirements, the narrower your choices become. That's important, because otherwise the number of possible choices out there is truly mind-boggling.

hgmjr

Joined Jan 28, 2005
9,029
If your interested in looking at the AVR 8-bit series of microcontrollers as the basis for your design, here is a link to a post that links to the various AVR related websites.

hgmjr

quantumkid

Joined Aug 25, 2008
17
Looks like this is going to be much more involved than I thought. I guess I had better pick a starter kit for one of the manufactures and go from there, they all have automotive MCU's so eventually I'll be able to do what I am planning. Which of these would be the closest to the 68HC11 language (that is the MCU that runs the car). I'm already somewhat familar with that so something close would be a good place to start. Thanks again.

SgtWookie

Joined Jul 17, 2007
22,219
Well, if you're insisting on a 68HC11 "lookalike", that pretty much limits you to the 68HC11, 68HC12x (enhanced 68HC11x), and the 68HC16x (16-bit version, mostly software compatible)

But, the whole series is based on the Motorola 6800. If you really want to stick with such legacy architecture, that's your choice. However, if the only tool in your toolbox is a hammer, everything starts looking like a nail.

Look at your requirements from a hardware perspective first. If you limit yourself to a specific architecture right off the bat, you'll find your selection extremely limited.

quantumkid

Joined Aug 25, 2008
17
Well, if you're insisting on a 68HC11 "lookalike", that pretty much limits you to the 68HC11, 68HC12x (enhanced 68HC11x), and the 68HC16x (16-bit version, mostly software compatible)

But, the whole series is based on the Motorola 6800. If you really want to stick with such legacy architecture, that's your choice. However, if the only tool in your toolbox is a hammer, everything starts looking like a nail.

Look at your requirements from a hardware perspective first. If you limit yourself to a specific architecture right off the bat, you'll find your selection extremely limited.
By all means I'm open to learning a new language. I was just wondering if one of the languages for the current MCU's was simmilar in structure and as such. I'm more than open to suggestions for a line of microcontrollers to start to learn on.

quantumkid

Joined Aug 25, 2008
17
I'm going between AVR's and ADUC. There seems to be more out there for AVR's so I would be able to find more support, but the Analog Devices µC I'm looking at seem to be built right for what I'm looking to do. Thoughts?

nanovate

Joined May 7, 2007
666
The AVR would be a better fit to get started on.

The Analog Devices part is good but there is not the same level of support and specific examples out there. But it is a 8052 derivative and so there are lots of examples out there that can be ported to this device. If you go that route then you can also look at the stuff from Silabs.

IF the Analog Devices board does exactly what you need then of course go for that one BUT if you need to possibly make modifications then I'd recommend AVR (XMEGA or MEGA).

hgmjr

Joined Jan 28, 2005
9,029
I agree with nanovate.

I happen to have all the tools (STK500, AVRSTUDIO4 and WINAVR) and I will be more than happy to assist you with any AVR hardware or software questions you bring to the forum.

All you would need to do is post the code and myself, nanovate, as well as other AVR knowledgeable members will assist as much as we can.

hgmjr

quantumkid

Joined Aug 25, 2008
17
Well I decided to go with AVR. I ordered some parts to build up a basic board (I considered a starter board, but I want to learn layout and board design so perhaps I'll get a starter board down the road a bit) and found a couple tutorials to start learning how to program for these. Thanks all the help.

hgmjr

Joined Jan 28, 2005
9,029
Well I decided to go with AVR. I ordered some parts to build up a basic board (I considered a starter board, but I want to learn layout and board design so perhaps I'll get a starter board down the road a bit) and found a couple tutorials to start learning how to program for these. Thanks all the help.
Have you decided what programming tool you will be using?

I would recommend that you go ahead and download AVRSTUDIO4 free from ATMEL's website. You can also download the document that contains the instruction set with section for each of the opcodes along with and explanation of what they do. IF you have any problems finding these item on ATMEL's website just let us know.

The sooner you get started learning the tools, the quicker you will be able to start programming.

You may want to take advantage of one of the prototype boards from www.sparkfun.com to get you something to play with before you start putting your own parts on a board of your own design. $17 plus the price of shipping is a bargin. True of all processors is the fact that the fewer unknowns you have during your learning experience the quicker you will come up the learning curve and the less frustrated you will become when you encounter your first few hurdles be the software or hardware. hgmjr Thread Starter quantumkid Joined Aug 25, 2008 17 Have you decided what programming tool you will be using? I would recommend that you go ahead and download AVRSTUDIO4 free from ATMEL's website. You can also download the document that contains the instruction set with section for each of the opcodes along with and explanation of what they do. IF you have any problems finding these item on ATMEL's website just let us know. The sooner you get started learning the tools, the quicker you will be able to start programming. You may want to take advantage of one of the prototype boards from www.sparkfun.com to get you something to play with before you start putting your own parts on a board of your own design.$17 plus the price of shipping is a bargin.

True of all processors is the fact that the fewer unknowns you have during your learning experience the quicker you will come up the learning curve and the less frustrated you will become when you encounter your first few hurdles be the software or hardware.

hgmjr

I'll go download AVRSTUDIO4 and the instructions sheet and check them out. Funny enough I am going through the www.sparkfun.com Beginning Embedded tutorial. The parts for that tutorial at the site were a bit pricy (and out of stock) so I ordered most from futurlec.com. Once I finish with that tutorial I'll probably pick up a prebuilt dev board. By making myself go through the tutoial and put that bread-board together I know it will make visualizing future boards and how they work much easier.

hgmjr

Joined Jan 28, 2005
9,029
You did not mention which programmer you were going to use to download the hex files from your PC to the target AVR device.

hgmjr

quantumkid

Joined Aug 25, 2008
17
You did not mention which programmer you were going to use to download the hex files from your PC to the target AVR device.

hgmjr
Oops. I bought a AVR-PG2B.

hgmjr

Joined Jan 28, 2005
9,029
Oops. I bought a AVR-PG2B.
AVRDUDE.exe comes along with AVRSTUDIO4 so you should be good to go.

hgmjr

hgmjr

Joined Jan 28, 2005
9,029
I just noticed that you can go to www.sourceforge.net and download avrdude-gui.exe. This means you don't have to run avrdude in a dos window. I think you will like it a lot better.

hgmjr