Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

46 votes
Accepted

ATtiny85: Power consumption vs clock speed

The datasheet shows that current decreases at lower frequencies. Around 1 mA at 1 MHz running at 5 V. More like 5 mA at 8 MHz running at 5 V. You can save quite a bit by using lower voltages as well, ...
user avatar
  • 35.1k
16 votes
Accepted

_delay_ms() is much slower than expected (by a factor of 6) on TinyAVR 0/1 (ATTiny1604)

Your toolchain is not broken. In the ATTiny804/1604 datasheet, page 77, it shows the CPU clock is divided from the 20/16 MHz oscillator by a prescaler (the ATTiny1614 datasheet shows the same clock ...
user avatar
12 votes
Accepted

When using Arduino Uno as ISP does "Yikes! Invalid device signature" mean a bad connection, bad config, or bad version of avrdude?

I soldered wires to pads to be sure the connection was good, and used those wires for programming from the Uno. Then the programmer worked, without any edits to the command lines as posted in the ...
user avatar
  • 371
12 votes

Optimizing code for ATtiny10

As I stated in a comment, this device would be too small for me to consider programming it using an Arduino core. I would rather stick with the avr-libc and direct port manipulation: #include <...
user avatar
  • 35.5k
9 votes
Accepted

ATtiny85 minimum setup to blink led

This schematic shows a complete connection of a blinking led. Red cable = +5V (pin 8) White cable = Ground (pin 4) Resistor = 1 end at pin 5 (IO 0) and the other in the LED anode (+) Led anode (+) in ...
user avatar
  • 269
9 votes
Accepted

Can you access the EEPROM of an ATtiny with Arduino Code?

The Arduino EEPROM library is compatible with the ATTiny range of AVR microcontrollers as the library itself is built on the standard Atmel AVR avr/eeprom.h 'library' so it is compatible with all the ...
user avatar
  • 1,437
9 votes

What is using up all the RAM in my program?

There is a lot you are missing. Such as: SoftwareSerial is using RAM. The system stack is using RAM. The Arduino core software is using RAM. There's plenty more going on than just your sketch. For ...
user avatar
  • 101k
8 votes
Accepted

How to program ATTiny85 running 3.3V

Since the ATTiny can easily run at 5V I don't see any problem with programming it at 5V levels and then run it at 3.3V. Is that correct? Yes. But if there are any components on the board that can't ...
user avatar
8 votes

ATtiny85 communication with computer through USB

Digispark made a lot of these as part of a "cheap Arduino USB interface" project a while back. This is my Digispark, it's pretty cute: They have a web page here. I got them for about $2 each. The ...
user avatar
  • 35.1k
8 votes
Accepted

Why can't the Atmel ATtiny family delay over a minute?

This is absolutely nothing to do with "why can't the atmel attiny family delay over a minute?". It is all to do with the way that C++ works. See my page about Integer arithmetic and overflow. To ...
user avatar
  • 35.1k
7 votes
Accepted

Is programming the ATTiny85 possible in 1.5?

You can download a version of arduino-tiny for IDE 1.5.x from here.
user avatar
  • 1,343
7 votes
Accepted

Changing pins used in ArduinoISP example

You can't change the pins. ArduinoISP uses the SPI interface on pins 10-13 which is provided by the underlying AVR hardware.
user avatar
  • 2,090
7 votes
Accepted

Wire.h library works on Uno but won't compile for ATtiny85

You get this error, because the ATTiny85 doesn't have full I2C hardware. It only as an USI (Universal Serial Interface). This can be utilized to do the rest of the I2C protocol via software. There are ...
user avatar
  • 13.7k
7 votes
Accepted

How to deep sleep ATtiny/ATmega (to run for years with batteries) but still detect a button press?

ATTINY's are designed to easily do this since they can wake from power down sleep mode by a pin change... Basically you want to... Connect a normally-open push button between an IO pin and ground....
user avatar
  • 1,450
7 votes

Optimizing code for ATtiny10

If the button is pressed by a human and your clock is high enough (MHz range), you can use a trick and get rid of the RNG. You can replace it with a free running counter like this: unsigned char count ...
user avatar
  • 171
6 votes

Ideas for setting I2C device IDs

Put the address in EEPROM. It's still "on the chip" but it can be programmed independent of the flash, and can be changed on the fly if deemed appropriate.
user avatar
6 votes

ATtiny85 minimum setup to blink led

Ignacio Vazquez-Abrams has already outlined the schematics. There must be a C program compiled and uploaded to it, just like an Arduino board would have. There are however some differences ...
user avatar
6 votes
Accepted

Is SoftwareSerial left out for the ATTiny85/84?

Short answer - no. It's not left out, on the contrary. But before addressing to the compiler error you mentioned, a small clarification: I downloaded the hardware from https://code.google.com/p/...
user avatar
  • 1,369
6 votes
Accepted

ATTiny 85 analog input pin number problem

See the analogPinToChannel function. static const uint8_t A0 = 6; static const uint8_t A1 = 7; static const uint8_t A2 = 8; static const uint8_t A3 = 9; ... #define analogPinToChannel(p) ( (p) &...
user avatar
  • 11.1k
6 votes
Accepted

Is the a low memory alternative to SoftwareSerial?

Simplest thing would probably be to edit your copy of SoftwareSerial.h and replace #define _SS_MAX_RX_BUFF 64 on line 42 by something smaller. If your loop() runs fast enough (no delays, no blocking ...
user avatar
  • 35.5k
6 votes
Accepted

Measure Vcc on ATtiny13a?

The code you linked to measures the 1.1 V internal reference using Vcc as a reference. The ATtiny13A cannot do that. It does have a 1.1 V internal reference, but it can only use it as a reference for ...
user avatar
  • 35.5k
5 votes
Accepted

Manchester Library Won't Compile for Attiny85

attiny is missing an option required to allow the Manchester library to function properly on ATtinyX5 devices, specifically definition of __AVR_ATtinyX5__ when a device is selected. In fact, it's ...
user avatar
5 votes
Accepted

Operating / pin voltages ATTiny chips

Yes. As given in the datasheets, normal ATtinyX4/X5 chips can run with a supply between 2.7 and 5.5V inclusive, whereas the low-power versions can run between 1.8V and 5.5V. Mind the speed ...
user avatar
5 votes
Accepted

Is it possible to program an Attiny85 with a USB-to-TTL converter?

Yes, it is possible. Note that the FTDI chip (assuming that is what you have) can be accessed as either Virtual Com Port VCP or D2XX. Where VCP is the traditional method of using them as Serial Ports ...
user avatar
  • 2,433
5 votes
Accepted

Extract .hex from ATtiny45 using Arduino

Assuming the lock bits on the device haven't been set, sure. Simply prepare the Arduino for ArduinoISP, hook up the ATtiny45, and perform a read using AVRDUDE instead of a write (-U flash:r:foo.hex:i)....
user avatar
5 votes

ATTiny85 Interrupt id vs pin when programming with Arduino

You can setup interrupts on the Attiny with some different code, but it works the same way. It's important to note that PIN Change Interrupts are triggered at BOTH Rising and Falling Edge Pins: ...
user avatar
  • 183
5 votes

ATtiny85 minimum setup to blink led

Here is the absolute minimal schematic required to blink a LED beyond power and decoupling: Refer to "Which resistor to use for this LED" to calculate the appropriate value for R1.
user avatar
5 votes
Accepted

Where is the Aref pin for Attitny88

As shown in the detailed information for the ADMUX register in the ADC section of the datasheet, the ATtiny88 has no external voltage reference. Consider using a ATmega8 or ATmega88PB instead.
user avatar
5 votes

Is it possible to reduce the size of this program to 1KB

There are several problems with your program as shown that make a good answer impossible. After I list those problems, I'll then proceed to give an answer, partly good, partly bad. The good part is ...
user avatar
5 votes

ATtiny85 communication with computer through USB

Can an ATtiny85 ic communicate with a computer through USB?if yes,how should be the connection? Have you checked the web? There are many such projects. Here is a link to one: http://www....
user avatar
  • 7,811

Only top scored, non community-wiki answers of a minimum length are eligible