# Which Microcontroller is Best for Simple Automotive Project

#### PaulThompson

Joined Sep 5, 2010
6
Hello All,

I am new to this forum but I am happy to have stumbled upon it. Back in college a couple years back I did a project that involved taking as input the boost (pressure) of a super charger or a turbo charger and at a certain pressure, it would activate a pump and some solenoids to inject an alcohol/water mixture into the manifold. This would lower the combustion temperature in the cylinder and would allow high performance motors to run lower octane fuels or add more timing for more power.

Therefore, what I will need at a minimum is:
- Servo output PWM (to control HB-25 motor controller found here:
http://www.parallax.com/Store/Acces...SortField/0/Level/a/ProductID/64/Default.aspx)
- Minimum 3 standard outputs
- Analog to digital input (Need to read 0 - 5 V from a pressure sensor)

In school I used a Dragon12 MC68HCS12 EVB found here: http://www.evbplus.com/dragon12.html. It was a great board, but it is cost prohibitive. I am looking to build a few of these for my dad and some of his friends as test units.

I am not sure how these would be programmed, but I would like to avoid CodeWarrior and anything that would cost too much for a license for the time being.

The two main questions are:
- Are there any specific boards that anyone can think of that can give me what I need?
- Does anyone know of any other motor controllers that can handle 12 VDC and 12 A continuous current other than the $50 Parallax controller mentioned above? Thanks for the help, Paul #### nickelflipper Joined Jun 2, 2010 280 Which is best? is really the wrong question here. More likely question, how about "I am collecting suggestions for a budget development/prototype board for evaluation"??? People will make suggestions based on their past experience and comfort zones, which will vary widely from Microchip, Atmel, TI, Arduino, Picaxe, ARM, blah... blah... blah. All will work. Lots of free compilers or demo versions available, no need to spend money there. My budget suggestion is the Microchip Pickit 2 Starter Kit. Many of the Arduino boards look attractive. The TI MSP430 Launchpad board for$4.30 will come up, I ordered one two months ago and still not shipped. It's hard to budge when you have something that works to your liking, no matter which side of the fence your on.

Let the games begin.

#### Oupajohn

Joined Sep 6, 2010
3
My immediate reaction is Microchip - chips go for less (mostly far less) than $10, a development board can be had off ebay for anything from$5 to $50, depending on what you want (be careful, many JDM programmers run off RS232, and many new PC's don't use RS232 anymore, so rather go for a board interfacing USB. Microchip gives you a free assembler/debugger/simulator (MPIDE) and in a pinch, if you got a JDM running off RS232, WINPIC800 is a free porgrammer and does a great job. Just punch in WINPIC or MPIDE in the friendly little space on the top of your browser. #### t06afre Joined May 11, 2009 5,934 My immediate reaction is Microchip - chips go for less (mostly far less) than$10, a development board can be had off ebay for anything from $5 to$50, depending on what you want (be careful, many JDM programmers run off RS232, and many new PC's don't use RS232 anymore, so rather go for a board interfacing USB.
Microchip gives you a free assembler/debugger/simulator (MPIDE) and in a pinch, if you got a JDM running off RS232, WINPIC800 is a free porgrammer and does a great job. Just punch in WINPIC or MPIDE in the friendly little space on the top of your browser.
My impression is that if you are so fortunate that you get the JDM programmer up and working the total cost is much the same or more as PICKIT 2 unit. Stay away from the JDM programmer it will only give you grief and frustration

#### PaulThompson

Joined Sep 5, 2010
6
Thanks for the prompt reply, guys. I really appreciate it.

I am going to look into the MicroChip board that @nickelflipper mentioned. I started scrolling through some of the options for chips and there are a ton!

Let's see what I can do.

If anyone can think of anything else, please let me know.

Thanks again,
Paul

#### SgtWookie

Joined Jul 17, 2007
22,221
Instead of using Parallax' motor driver for ~$50/ea, you could look at building your own, starting with the same IC they used in their driver for ~$11:
http://parts.digikey.com/1/parts/577017-ic-driver-motor-h-bridge-vnh2sp30-e.html

You're going to need to make a board anyway; why pay for two? That'll shave ~$35 or so off your projects' cost, just for starters. But, take a good hard look at the way Parallax used vias to wick the heat through to the fan side of the board ... you will need to do something similar with yours. Besides, dealing with the IC directly means you don't have to worry about generating a servo-type control input; you can just feed it a PWM signal directly. You might want to take a look at something in the PIC16F1826/27 or the PIC16F193x series. These are relatively new 8-bit designs that are very cheap (~$2/ea) and have a boatload of features. Make certain to purchase the "I/P" suffix parts; as they are rated for the full automotive/industrial temperature range, the "E/P" parts are not. I requested some free samples of these uC's from Microchip; they arrived a month apart, but they DID arrive, at no cost to myself.

By the way, all PICAXE uC's are based on Microchip E/P uC's, which automatically disqualifies them for automotive environments. Besides, PICAXEs, like Parallax BASIC Stamps 1 and 2x series, run form of tokenized BASIC language which slows them down considerably.

Selection of programming environments is somewhat limited as of yet, but B. Knudsen Data's CC5X (C language) compiler supports them, a freeware version is available, and it will interface with the MPLAB IDE.

Keep in mind that automotive environments are among the most brutal on the planet. Very wide temperature variations, shock/vibration, voltage spikes as high as 60v, corrosive/conductive liquids (battery acid, salt spray on roads in the winter, etc) - be prepared to bullet-proof your board against all of that. By the way, a standard 7805 or LM317 regulator isn't rated for the kind of input spikes you'll get; you will need a better regulator. You will also have to protect the motor driver IC against high voltage spikes.

Last edited:

#### PaulThompson

Joined Sep 5, 2010
6
Wow, thanks for all the recommendations!

There is a lot of info there to process, but I would like to focus on some hardware that I need for the microcontroller. If I were to use any of the PIC16F1826/27 or the PIC16F193x microprocessors, what hardware would I have to use to program it? I see that the PIC16F1826/27 series has anywhere from 18 to 28 pins in different configurations. The PIC16F193x family has 40 pins and requires a different programmer and development board. I think the PIC16F193x would be a little overkill for what I am trying to do at this point, so I think the best option would be the PIC16F1826/27 family.

More specifically, it would be the PIC16F1826-I/P as you mentioned that it would be more appropriate for the automotive environment. Now, what would I need to program/debug this thing? Is there a 'starter kit' for this chip like the one @nickelflipper mentioned earlier in this thread (PICkit 2 Starter Kit)? Or can someone point me to some tutorials that could explain what I would need to get this thing going?

I was extremely spoiled by the Dragon12 development board almost to the point where everything else seems too foreign to work with.

You all are great. Thanks a lot.

-Paul

#### SgtWookie

Joined Jul 17, 2007
22,221
If you design your PCB to include an ICSP header (In-Circuit Serial Programming) following Microchips' recommendations, then you can update the program any time you wish using a PICkit-2 or PICkit-3.

You might consider getting a PICkit-2 Debug Express or PICkit-2 Starter Kit, or a PICkit 3 just to get your feet wet, and familiarize yourself with the development environment in Assembler, C and perhaps BASIC if you find the former too difficult; it comes with a dozen lessons and sample code. It's only ~$50 for either, about the same as just the Parallax driver. You'll need to review the documentation to see what uC's the various programmers will support, and review your needs again to see if you can get by with a lesser uC. You might even get by with a PIC12F683; that's an 8-pin uC with PWM and ADC on board. Two pins are power/ground, 5 of the remaining are I/O, and 1 is input only. You can even program that uC with a PICkit-1, about$35 - but the PICkit 1 is quite limited.

#### PaulThompson

Joined Sep 5, 2010
6
I am having some issues finding the appropriate tools to program, develop and learn about the PIC16F1826 uC. Is there an explorer board that I can plug the uC into and program so that I can take it out and place it into my circuit board to test?

The PICkit 2 Starter kit does not seem to work with the 18-pin uCs and I cannot find a PICkit 3 Starter kit that would allow me to program the chip and move it over to my test circuit.

However, I feel that the PICkit 2 Starter kit would be the best for me at this point and I think the PIC16F690 would be sufficient for what I want to do. Please let me know if anyone feels any different.

I apologize for my noobishness (if that's even a word).

Thanks,
Paul

#### nickelflipper

Joined Jun 2, 2010
280
I agree with Wookie that the PIC16f1826 is a great looking device (just picked one up myself on last order). But as you have found out, the 18 pin device pinouts don't play well with others. The low pin count board (LPC) of the starter kit can address many more devices, 8, 14, and 20 pin.

If a fast internal clock ultimately is required for the project, an equally capable chip that fits the LPC board is the PIC18f14k22. The free version of Microchip C18 would work with that chip, if that's your preference.

Yes the 16f690 should do the job. Pick up a 12f683 and 18f14k22 to have a play with while you are at it. Yet another option, is to pick up some Pickit 2 demo boards to expand the device/pinout range, whereby the 16f1826 and others are back in play. Microchip's a la carte approach to device peripherals, makes choosing a chip a real pain sometimes.

By the way, there is no reason to transfer a chip to and from the test circuit, that is what ICSP is all about. The Pickit 2 has a programming on the go feature, that loads your hex in ROM, and can be transferred remotely without the PC being present.

#### PaulThompson

Joined Sep 5, 2010
6
Thanks, nickelflipper!

This: http://www.microchipdirect.com/ProductSearch.aspx?Keywords=DM164120-4

... is exactly what I was looking for but could not find on MicroChip's confusing site. I am also going to pick up the PICkit 3 to pair up with it.

It looks like the demo board comes with the 16F1827 which I will probably end up ultimately using for my project. Of course for the final version of the project, I will use the 'I/P' version of the uC.

Does the PICkit 3 come with all the necessary software I need to develop and compile code or would I be able to download this software? The reason I am asking is because nothing is really straight-forward on this site.

Thanks,
Paul

#### SgtWookie

Joined Jul 17, 2007
22,221
It comes with an integrated development environment (MPLAB IDE). If you don't want to wait, you can download it from Microchips' website and experiment with it.

Or, just wait for the CD to arrive in the package.

You don't have to order it directly from Microchip. You could also order it from Mouser.com, or other authorized distributor. See their authorized distributor list.

#### nickelflipper

Joined Jun 2, 2010
280
Not familiar with the new Pickit 3, but the now older Pickit 2 has been a real hit in both form and function. You will need to download the latest version of MPLAB IDE, and MPASM (Microchips assembler) too if it's not included in the MPLAB download, I forget. Also any third party demo compilers of interest.

Look in the downloads section of the programmer, and MPLAB pages, on the Microchip site. Check out the User Manuals, guides, lessons etc. which should give a step by step tutorials.

My understanding of the I/P, E/P, H/P designations relates to the temperature ranges the are capable of. I/P industrial range -45C to +85C, E/P extended range -45C to +125C, and H/P High Temperature? -45C to +150C. The electrical input/output specifications appear to be severely derated for the E/P vs. I/P (to meet the higher temperature specs?).

#### PaulThompson

Joined Sep 5, 2010
6
Thanks, guys.

Demo board:
http://www.microchipdirect.com/Produ...rds=DM164120-4

Programmer:
http://www.microchipdirect.com/productsearch.aspx?Keywords=PG164130

This should get me started on my way. I will get all this situated and then start working on the circuitry. For the time being, I am going to use my existing Parallax motor controller then attempt to build my own.

I don't know how long these threads stay open, but I am probably going to have more questions about this project in the near future.

Thank you all for the help.

-Paul

#### t06afre

Joined May 11, 2009
5,934
If it is not to late, I would go for a demoboard that have a chip that can be debugged. The 16f690 chip can not be debugged by the Pickit unit without a "header"
Or you could just pick up the Pickit unit, and build your own trainer on breadboard with the chip you would like to use. That is not hard at all. Every newer PIC MCU with flash based program memory can be programmed with ICSP. And hence they may be programmed with Pickit 3. In the free software MPLAB you can quickly check if your MCU is supported supported by your Pickit. Do not worry about socket size on the demo board etc because that is NOT important with ICSP. However if you build your own system. Remember to read the Pickit manual. It is some some design considerations you have to know about regarding the ICSP interface. It is a simple figure and a half page of text.

#### nickelflipper

Joined Jun 2, 2010
280
The demo board that he is getting has the PIC16f1826, which includes an in circuit debug. There are a handful of 18f devices that would fit the 18 pin board, which also include ICD.

#### t06afre

Joined May 11, 2009
5,934
The demo board that he is getting has the PIC16f1826, which includes an in circuit debug. There are a handful of 18f devices that would fit the 18 pin board, which also include ICD.
Ah I see. That demoboard is almost identical to my old "low pin count" demo board with a 16f690. From a picture it is hard to see any difference