Will an AVR MEGA162-16PU get the job done?

Electronics Computer Programming Q&A
Post Reply
User avatar
GoingFastTurningLeft
Posts: 163
Joined: Wed Sep 06, 2006 7:33 pm
Contact:

Will an AVR MEGA162-16PU get the job done?

Post by GoingFastTurningLeft »

Sorry for the cross-forum post, but I want to get rolling on this project.

This is the first time I've done anything with a microcontroller. Cost is also a factor, so I'm not trying to do anything that requires me investing in a programmer. Not trying to do assembly coding, so something that I can program in C makes things a lot easier.

Basically, I need one pin to output a variable pulse 0-330Hz. I also need to control 5 analog gauges (can get away with lower resolution) and 4 indicator lights. 35

This is the one I've been looking at:
AMTEL AVR MEGA162-16PU -$6.25
http://www.atmel.com/dyn/resources/prod ... oc2513.pdf

40 I/O pins, 1 for the pulsed output, 4 for the indicators, and that leaves me 7 I/O's for each gauge to feed into D/A's, unless I go with PWM control. This whole thing needs to update its output about 30 times a second.

I think this looks like it will do what I want, can someone confirm this?
Engineer1138
Posts: 458
Joined: Thu Feb 05, 2004 1:01 am
Location: Minneapolis, MN
Contact:

Post by Engineer1138 »

It's waaay overkill, but it will work. I'd assume that a 1khz PWM would work to update your analog gauges, so you could even do the PWM in software and use something like a Tiny2313.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba »

You should be fine with just about any microcontroller with enough pins.

for your meters, PWM would work ok. Be sure to use a low pass filter and as high a PWM frequency as you can get. You want that needle to be rock solid. SW PWM might not be good enough but I'd experiment with it first. I'd use a circuit simulator to play with the parameters.

I'd be tempted to use a multi channel serial DAC instead. You don't need high speed and 8 bits would do fine. check maxim for 8 channel serial DACs, there are several that look reasonable. Maxim is pretty easy when it comes to free samples.
User avatar
GoingFastTurningLeft
Posts: 163
Joined: Wed Sep 06, 2006 7:33 pm
Contact:

Post by GoingFastTurningLeft »

Way overkill? Well that's good to know. I didn't see much of a selection when it came to these AVR's.

I might get this to develop this project and get some microcontroller experience, then maybe I'll get a smaller one to dedicate to this and make this my 'experimentation' MCU.

By serial DAC, do you mean from the MCU or directly driven by my computer?

I'm avoiding doing as much as possible in software on the computer side, since this reads data from a racing simulator and I want minimum impact on my framerate :grin:

Thanks guys! Can't wait to get crackin on this thing!
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba »

serial means not parallel. your PC speaks Async and the voltage spec is RS232. No DACs that I am aware of speak that.

A serial protocol is typically I2C or SPI (may be others too). Look at the chip you picked - I believe it has an SPI interface. SPI is pretty easy to use so I'd pick that flavor of serial DAC.
Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests