0

Choosing a MCU
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Choosing a MCU

by bman22 on Thu Mar 19, 2009 12:03 am

Well, i have been quite rapidly progressing in my knowledge of avr. I still have quite a ways to go, but the 2313 just can't do what i am trying to do. I am wondering if there is any MCU out there that has an almost identical setup (in terms of I/O pins, pinout, etc...) as the 2313 with more ROM. I looked at some of the ones available on mouser, and they have quite a few in the attiny series that have enough rom, but they all have all the ADC. If the ADC's can be used as a regular input, it should work fine, but i need pretty much all the digital inputs i can get.

If there isn't really anything that can do what i am trying to do, then my question is, does anyone know of a way to pass data between two MCU's. I was thinking that, if i cannot get an MCU with the storage i need, i could set up 2 2313's, with one doing one half of the code, and passing the result to the other. I know this is highly inefficient, but i would really prefer not to have to get a whole new setup just to try and run a rather simple peice of code.
bman22
 
Posts: 75
Joined: Mon Dec 22, 2008 2:38 am

Re: Choosing a MCU

by westfw on Thu Mar 19, 2009 1:17 am

but they all have all the ADC. If the ADC's can be used as a regular input, it should work fine

Most microcontrollers with ADCs can use the pins as normal digital IO as well (for instance, you can use all the "analog inputs" on an arduino as digital inputs or outputs.) There are some exceptions: the LQFP package of the ATmega168 has 4 more pins than the DIP version, and two of those are used for analog inputs that can't do anything else.
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Choosing a MCU

by Amberwolf on Thu Mar 19, 2009 2:26 am

Well, you can still use the ADC's as digital ins after a fashion--you just make the code so that it reads them as a 0 if the input is below your known logic low threshold, and a 1 if it's above the logic high threshold. A bit more complicated than a simple digital input read, but not by much, I'd think.

Of course, since I don't know programming very well, I could be wrong.
Watch me build an electric bike from assorted junk!
Alternative Energy Sources for the Home from Recycled Junk
A subsidiary of Cybernetic Necromancers, Discorporated:
"We Bring Dead Things To Life"
Amberwolf
 
Posts: 310
Joined: Wed Oct 08, 2008 2:42 am
Location: Phoenix, AZ, USA

Re: Choosing a MCU

by zener on Thu Mar 19, 2009 2:46 am

You can even use an analog input to sense 3 or 4 (or more) different switches. You have them pick voltages off of a divider. Car makers do this for steering wheel switches for example, so they have less wires to deal with. Is digital IO your only issue? You could shift them in from a 74HC597. See page 2 of this pdf:

http://www.circuitcellar.com/library/de ... 9cdpdf.pdf

zener
 
Posts: 4429
Joined: Sat Feb 21, 2009 2:38 am

Re: Choosing a MCU

by bman22 on Thu Mar 19, 2009 4:51 pm

Ok, well is there any special code to deal with the digital on the analog pins, and, are there any with the same general pinout as the 2313, especially with the power pins, if not, i just need one with 20 pins. I really don't know what to look for, so some help would be great.
bman22
 
Posts: 75
Joined: Mon Dec 22, 2008 2:38 am

Re: Choosing a MCU

by chelmi on Fri Mar 20, 2009 11:10 am

This page on the Atmel web site is very useful when you look for a MCU

http://atmel.com/dyn/products/param_tab ... ection=ASC

Chelmi.

chelmi
 
Posts: 53
Joined: Wed Nov 19, 2008 12:09 pm
Location: Canada

Re: Choosing a MCU

by mtbf0 on Fri Mar 20, 2009 3:11 pm

using an adc pin for digital i/o works just the same as using any other pin for dgital i/o. set the pins in the data direction register, then read th PIN register or write the PORT register.

nothing to it.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: Choosing a MCU

by bman22 on Fri Mar 20, 2009 4:37 pm

could some one make a suggestion?
bman22
 
Posts: 75
Joined: Mon Dec 22, 2008 2:38 am

Re: Choosing a MCU

by westfw on Fri Mar 20, 2009 8:51 pm

According the parametric search at digikey, the only AVRs with 20 pins and more flash than the 2313 are the ATtiny461 and ATtiny861, but those have two less IO pins than the 2313...
You can't just jump to the 28pin parts? Lots of choices there...
westfw
 
Posts: 1568
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Please be positive and constructive with your questions and comments.