Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [attiny]

ATtiny is a family of small, low-power 8-bit RISC microcontrollers from Atmel. Commonly found in smaller Arduino prototyping platform boards and projects.

Filter by
Sorted by
Tagged with
34
votes
1answer
7k views

Why does my AVR reset when I call wdt_disable() to try to turn the watchdog timer off?

I am having a problem where executing a disable watchdog sequence on an AVR ATtiny84A is actually resetting the chip even though the timer should have plenty of time left on it. This happens ...
26
votes
5answers
5k views

Making a battery last a long time in a microcontroller circuit

I'm hoping to power an ATtiny85V for a nice long time on some small battery, probably a coin cell. I've looked into the software side, and my code is watchdog timer driven, has unused analog and ...
17
votes
3answers
19k views

Use AVR Watchdog like normal ISR

I'm trying to wrap my head around the watchdog timer on the ATTinyX5 series. So things I've read made it seem like you could use it for making the program do something specific ever N seconds but ...
17
votes
7answers
35k views

How do I set the clock speed fuses on an ATtiny85 when using an Arduino as a programmer?

I'm following this tutorial, programming the ATtiny85 with an Arduino, using it to play some tones (through a piezo speaker). I'm struggling with getting the tones at the right pitch (I'm creating the ...
16
votes
2answers
980 views

4-bit bus address selection via analog input pin: Monte Carlo simulation shows overlapping address values

I designed a small sensor PCB for my master thesis with an ATtiny44 microcontroller. I need about 200 of these boards for my application and 16 are always locally connected to controller board. The ...
14
votes
2answers
10k views

Serial newbie: why can't I just hook the wires up?

I'm trying to transmit from an ATtiny85 to a PC using Arduino-esque code over a USB-Serial converter without understanding very much of anything. I was shocked and appalled that it did not work. I ...
12
votes
3answers
11k views

What can't the ATtiny do that the Arduino can?

Inspired by this Make Magazine youtube video, I would like to use the ATtiny chips instead of the Arduino for most of my projects. The video author warns that some Arduino functions won't work on the ...
11
votes
2answers
9k views

Program AVR EEPROM directly from C source

When you include the following code in an AVR C source, you can apparently directly program the fuses, without the need for an extra command or .hex file: ...
10
votes
2answers
5k views

Need help understanding AVR ATMEGA / ATTINY timer mirrored output

I am trying to use Timer1 of Atmel AVR microcontroller, either AtMega328 as used in the Arduino, or the ATTiny85, to output two clock signals which are mirror images of each other. The frequency I am ...
9
votes
5answers
13k views

ATTiny13 — avr-gcc Hello World uses over 100 bytes?

I'm trying to write a program for the ATTiny13. My problem is that it has huge size constraints. Well, when making my first Hello World program, it took 100 bytes of program space just to make a light ...
9
votes
1answer
2k views

ATtiny: no support for multiplication?

Is it true that the ATtiny AVRs have no hardware support for multiplication? It seems to work fine as I do multiplication in my code. I've also included math.h and have a couple of sin() and cos() ...
9
votes
3answers
5k views

ATtiny85 power consumption double expected

I'm trying to get an ATTiny85 to run off a battery. I have it clocked from a 16.384 MHz crystal, with the divide-by-8 fuse set. Vcc is 3.3 volts. Figure 22-7 in the datasheet says that at idle ( ...
9
votes
2answers
7k views

How to power an Attiny from AA batteries?

I am working on a project where I would like to power an RGB Led in a ambient light situation. I have prototyped this using an Arduino Leonardo and the led. Currently the project is plugged into the ...
8
votes
7answers
18k views

Measuring 0 - 1MHz ( 0.25Hz resolution) Squarewave using an MCU

I need to measure the frequency of square-wave that can vary between 0 and 1MHz, and has a resolution of 0.25Hz. I havent decided on which controller yet but It will most likely be one of the 20pin ...
8
votes
2answers
4k views

ATTiny85 not working after burning bootloader

I am having a problem with my ATTiny85. I should mention I use Arduino as an ISP to program it. My ATTiny worked fine until I decided that I need to step up the clock speed from 1MHz to 20MHz so I ...
8
votes
2answers
8k views

How can I determine if a microcontroller is damaged?

I have a few microcontrollers sitting in my "junk parts" bin. I think some of them arrived there when, after programming them, they exhibited strange behavior. I've since learned a lot, for example, ...
8
votes
2answers
562 views

Workaround for the obsolete ATTINY15 1.5Mhz clock for FCC exemption?

The ATTINY15's was ideal for designing FCC Part 15 exempt battery powered products since its 1.6Mhz internal RC clock ran just below the 1.705Mhz cut-off. The ATTINY2/4/85 replacement parts come with ...
8
votes
1answer
386 views

While loop optimized away

I have the following code in my microcontroler program: // Wait for ADC conversion to complete while ( ( ADCSRA && _BS( ADSC ) ) == _BS( ADSC ) ) {} ...
8
votes
2answers
811 views

ATtiny13A - Can't generate software PWM with CTC mode

I'm trying to make a remote control RGB LED light using an ATtiny13A. I know the ATtiny85 is better suited for this purpose, and I know I might not eventually be able to fit the whole code, but for ...
8
votes
1answer
4k views

Can an ATmega or ATtiny device signature be read while running?

While programming an ATtiny or ATmega, avrdude prints the device signature, in this example it is an ATtiny. avrdude: Device signature = 0x1e910a Can I read this ...
7
votes
2answers
979 views

Why microcontroller takes many clock cycles to start up with PLL clock source?

I was looking over the ATTiny85 datasheet and noticed on page 26 that with a PLL clock source, the fastest startup time is 14CK + 1K (1024) CK + 4 ms. Am I misinterpreting what they mean by 1K CK, or ...
7
votes
4answers
3k views

ATtiny2313 refuses to be programmed after setting CPU clock to 500kHz

The other day I was writing a program for an ATtiny2313. Once it worked I decided to test it at the various clock speeds that are available and programmed through setting the LFUSE as described on ...
7
votes
1answer
11k views

Backup AVR with avrdude

I'm heavily experimenting with ATtiny AVR's and I can't afford to buy a new AVR for every experiment, so I thought up a backup script. The idea is that I can bring my AVR back to factory defaults ...
6
votes
2answers
364 views

How can I instruct my compiler to use 8 bit bytes instead of 16 bit integers?

I have the following code in my microcontroler program: ...
6
votes
6answers
2k views

WLCSP MCU's - what hardware is needed for programming these tiny chips?

I just received my DigiKey order of some Atmel ATTiny4 MCU's from DigiKey. I wanted to tinker with one of the smallest MCU's I could find, and this was one of them. It is, in fact, so small because ...
6
votes
2answers
8k views

ATTINY85 measuring internal voltage

I'm using an ATTINY85 for a portable application that uses a Lithium-ion battery; therefor I need to monitor the battery voltage so I don't kill the battery. Is there a way to go about this without ...
6
votes
6answers
2k views

Why shouldn't I brute force PWM?

So I've been playing with an ATtiny45, and it occurs to me that I could probably brute force PWM by prescaling a timer to sysclock/64, then running ISR code that manually switches the outputs on or ...
6
votes
3answers
224 views

Capacitor and ISP issue

If I remove C5 I am able to use ISP. However, with C5 on board ISP programming fails... Capacitor is for button debouncing. What is the quick workaround to have ...
6
votes
2answers
2k views

How is this motor on a Romotive controlled?

I have bought a Romo Robot by Romotive. Unfortunately I'm having some technical issues(it does not work, at all) with it so I decided to explore the PCB a bit and see what its made of. I understand ...
6
votes
2answers
6k views

Arduino as ISP for ATtiny

I am attempting to use an Arduino Duemilanove as a tool to program an ATtiny85 from the Arduino IDE. I was using the instructions at ForkRobotics which are ... Upload ArduinoISP sketch to Arduino ...
6
votes
1answer
2k views

Interfacing an ATTiny84 to iPhone from headphone jack

I'm trying to create an adapter and an application for the iPhone that works very similarly to the Square Up card reader. The basic communication I'm trying to achieve: Plug in adapter to phone ...
6
votes
1answer
4k views

Why does my ATtiny13 report wrong device ID?

I am using an Arduino (with ATmega168) as an ISP programmer to program ATtiny13. When I try to do this, avrdude reports: ...
6
votes
2answers
8k views

Calculate exact timer frequency for ATTiny

Trying to wrap my head around these overflow timers for the ATTinyx5 (45 in this particular case). I seemed to have a great handle on it with the ATMega328 but I cannot get it to work the way I want ...
6
votes
2answers
2k views

Problem shrinking Arduino project to ATtiny 85 20MHz

This is a similar problem as this one: Programming an ATtiny 85 with Arduino However the latter question refers to older software/arduino and did not reach a resolution. I'm using Arduino 1.0.1 (...
5
votes
7answers
21k views

Best way to send sensor readings over simple RF connection

I have bought a pair of simple 315MHz TX/RX modules. I want to use these to connect a battery powered ATTiny85 to an Arduino base station. The ATTiny needs to regularly wake up and send a sensor ...
5
votes
1answer
2k views

What does the 'A' trailing letter in Atmel's ATtiny devices mean?

I have both on stock: ATtiny861A-SU and ATtiny861-20SU. But I can not find out any difference between them except 'In-System Programmable via SPI Port' available for 'A' version. Could anyone tell ...
5
votes
1answer
633 views

Strange behaviour of Attiny's ADC

...
5
votes
2answers
473 views

Programming several AVRs with one ISP: which line to break?

Let's suppose that I have two AVRs connected to one ISP connector. To programm only one MCU in this configuration I neet to break one (or mayby several) lines goes to the MCU I don't want to be ...
5
votes
2answers
3k views

Does the internal 8Mhz oscillator in an ATTINY run even if no clocks are connected to it?

If I set up the fuses on an ATTINY so that the system clock uses the internal 128Khz oscillator (sometimes called the "Watchdog oscillator"), does the internal 8Mhz oscillator still run? It does not ...
5
votes
1answer
1k views

Safety of powering 5V circuit of 240V main outlet using adapter

I have created a circuit using an ATTiny that will need constant power. I was thinking of using one of the 240V to 5V USB adapters that come with many phones to power this circuit. Will I need to put ...
5
votes
2answers
4k views

Attiny85 hardware interrupt unreliable, 433 MHz remote

SCROLL DOWN TO SEE THE SOLUTION (UPDATE II) ORIGINAL POST: I am currently building a 433MHz remote with two buttons. The remote is controlled by an Attiny85v(8MHz). Sadly it does not work very ...
5
votes
4answers
520 views

How often do AVR's actually glitch and need a watch-dog reset in the real-world?

Have you ever seen an otherwise happy AVR spontaneously glitch and require a reset? Assuming: a nice stead power supply that stays inside the specified range a correctly sized decoupling cap ...
5
votes
3answers
2k views

ATTiny project resets when plugging in phone

Project I'm not very experienced with electronics and microcontroller-programming yet. I recently (accidentally) bought a couple of ATTiny13A microcontrollers, assuming I could program them using ...
5
votes
2answers
1k views

In search of a component or device that switches multiple lines based on input selection

Okay so the foundation for my curiosity is that in dealing with Arduinos, I found they can be used to program the similar but smaller ATtiny chips. This is the main hookup configuration that some of ...
5
votes
1answer
3k views

AVR Pin Dual Use: Input and Output at (seemingly) the same time

I have been working on a few different versions of a bicycle light control circuit which reads in various buttons and sets various outputs accordingly such as headlight, taillight, blinkers, etc. My ...
5
votes
4answers
6k views

Programming an ATtiny 85 with Arduino

I followed this tutorial and got the following error when trying to compile upload the attiny85 sketch: avrdude: usbdev_open(): did not find any USB device "usb" ...
5
votes
1answer
194 views

ATtiny84 resets on high load

I'm using a ATtiny84 and with three 74HCT595 serial to parallel converters to drive 24 LEDs. Every thing works fine, but when I try to light up more than 10 LEDs at the same time, the ATtiny84 program ...
5
votes
1answer
687 views

ATtiny45 pin change interrupt PB5?

On the ATTiny45 data sheets it states that PB5 can be used as a digital IO pin and I want to use it to trigger a pin change interrupt, my only issue is that it is also the reset pin and the moment I ...
5
votes
7answers
23k views

avrdude error - stk500_paged_write() protocol error

I am using my Arduino Uno as a programmer to program my ATtiny85. I uploaded the ArduinoISP sketch to my Uno. I double checked my wiring, did some googling, but I still can't figure out why I get this ...
5
votes
2answers
8k views

SPI.h for ATTiny

Is there a different implementation of the Arduino SPI library that can be used for the ATTinyX5 series? I assume, partly because I believe the ATTiny SPI is provided via USI... I got the environment ...