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?
Will an AVR MEGA162-16PU get the job done?
- GoingFastTurningLeft
- Posts: 163
- Joined: Wed Sep 06, 2006 7:33 pm
- Contact:
-
- Posts: 458
- Joined: Thu Feb 05, 2004 1:01 am
- Location: Minneapolis, MN
- Contact:
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.
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.
- GoingFastTurningLeft
- Posts: 163
- Joined: Wed Sep 06, 2006 7:33 pm
- Contact:
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
Thanks guys! Can't wait to get crackin on this thing!
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
Thanks guys! Can't wait to get crackin on this thing!
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.
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.
Who is online
Users browsing this forum: No registered users and 25 guests