0
\$\begingroup\$

I'm looking to buy a ATTiny85 for a school project. We require 4 analog inputs for our LEDs which we're using as makeshift light sensors (this part of the project is sorted). I've read the the pin layout of the ATTiny85 and it says that there are 4 ADC pins however the ADC0 pin is also the RESET pin and so not sure if that means it can't be used as for analog input.

If this can be used then my second question is whether an ATTiny85 can be sufficient for the use of 4 LEDs and 2 DC motors (which I hope can be connected to the digital pins). Id prefer not to get the larger 14-pin version as we are looking to save space.

Is there any ATTinys that have 10 maybe 12pin layouts also?

\$\endgroup\$
14
  • 1
    \$\begingroup\$ According to the list of all ATTinys, ATTiny13 and ATTiny13A are available in 10 pins package. But, unfortunatly 2 pins of the 10 are DNC. So all in all there isn't any ATTiny with 10 functional pins. \$\endgroup\$ Jan 21, 2016 at 22:08
  • \$\begingroup\$ @BenceKaulics Not ones with exactly 10 functional pins, no. But there are ones with 12 functional pins. Also ones that are teensy with 20 pin packages. Tinier than the 85 and cheaper too. Tn841-MMH for example. \$\endgroup\$
    – Asmyldof
    Jan 21, 2016 at 22:17
  • \$\begingroup\$ @Asmyldof the Tn841-MMH can be programmed using arduino though? Not that it's completely necessary but we'd either want to programme using C or arduino \$\endgroup\$ Jan 21, 2016 at 22:24
  • 1
    \$\begingroup\$ Use the ATtiny24/44/84 in the 14 pin DIP package. 12 GPIO, 8 ADC. None of the ADC overlap the Reset. So you'd have 4 ADC, 6 GPIO, that leaves 1 GPIO free, 2 with reset. \$\endgroup\$
    – Passerby
    Jan 21, 2016 at 23:45
  • 1
    \$\begingroup\$ @Kristopher Please do better preliminary research. To check the existence of a ATtiny with a given specification, go to Atmel web site. They have selection filters. \$\endgroup\$ Jan 22, 2016 at 7:04

1 Answer 1

4
\$\begingroup\$

The ATtiny

No Atmel do not have 10 or 12 Pin Tinys (with full features)

The Reset Pin

Using the reset pin as anything else does carry the risk of you becoming unable to reprogram the MCU without the use of HVPP (High Voltage programming)

A poor-mans 2:1 multiplexer can often just be a pair of FETs, so if you have the room for a few external components then that would solve your problem.

Driving Components

As for driving LEDs and motors I will take this opportunity to remind you to make use of suitable drive circuits for these. I would advise against direct drive, especially for the motor (being an inductive load and all). Below is a suggestion for a motor drive. (Components would depend on your needs.)

schematic

simulate this circuit – Schematic created using CircuitLab

Space vs Cost

Saving cost and saving space in electronics are often a compromise, you can get an Atmel MCU in a size that is smaller than a tiny, but you will need a PCB, I would recommend trying a TQFP break board or similar. If you are prepared to move to an SMT package then your space vs function problems will disappear.

If you move to a custom PCB design, you can probably get all of your drive circuitry in SMT packages and squeeze it into a very small space.

A custom board will cost you, although there are cheap sources.

It sounds to me like if space is really that important then you should investigate a solution with SMT parts and a custom PCB.

\$\endgroup\$
5
  • \$\begingroup\$ Mmm, so although it's a reset pin, I can still technically use it for analog input? Also, can you give an example for the 'drive circuits' not sure what you mean by that. \$\endgroup\$ Jan 21, 2016 at 22:22
  • \$\begingroup\$ You can, but it makes you life harder from a debugging point of view. \$\endgroup\$
    – wraithbone
    Jan 21, 2016 at 23:27
  • \$\begingroup\$ The ATtiny20-MMH has 12 functional pins. But it is nearly impossible to place by hand. \$\endgroup\$ Jan 22, 2016 at 2:23
  • \$\begingroup\$ BGA is not fun to place by hand. QFP, SOIC or SOP is quite easy. And QFP is very space efficient compared to in-line packages. \$\endgroup\$
    – wraithbone
    Jan 22, 2016 at 10:05
  • \$\begingroup\$ "No Atmel do not have 10 or 12 Pin Tinys (with full features)" - There are severay attiny's with 10+ pins, see this list. \$\endgroup\$
    – marcelm
    Aug 10, 2016 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.