ATtiny is a range of programmable 8-bit AVR microcontrollers by Atmel.
Questions tagged [attiny]
160 questions
1
vote
2 answers
ATTiny serial communication does not work at 3.3V with ESP8266 (NodeMCU V3)
I am transmitting data from ATTiny85 to ESP8266(NodeMCU v3). I am powering NodeMCU using USB cable.
It works fine when I power up ATTiny using 5V.
However I'm planning to transfer my project to ESP32, which is not 5V tolerant. Therefore I have to…

Akila Uyanwatta
- 543
- 1
- 4
- 11
1
vote
1 answer
TinyAVR 0-Series: Can I use pin-change sensing without entering interrupt handler?
I am evaluating the ATtiny806 running at 20MHz to build a cycle-accurate Intel 4004 microprocessor emulator. (I know it will be a bit too slow, but AVRs have a huge community.)
I need to synchronize to the external, two-phase non-overlapping clocks.…

mcpublic
- 15
- 5
1
vote
1 answer
How to deep sleep an Attiny until an analog value of a photoresistor changes?
for a battery powered project I would like to put an Attiny85 into deep sleep mode immediately after program start and let it wake up only when a sensor value (in this case a photo resistor) changes. Unfortunately I could only find examples for…

Michael Brown
- 137
- 2
- 13
1
vote
3 answers
Attiny85, microsecond timer implemented on timer0 does not count the correct time
There is Attiny85, with an internal clock source at 8 MHz.
I am trying to implement a microsecond timer based on the hardware timer timer0.
What is my logic:
Since the clock frequency is 8 MHz and the prescaler is off, the time of one clock cycle…

Delta
- 127
- 1
- 6
1
vote
6 answers
AVR assembly - bit number to mask
In my ATtiny84a AVR Assembly program I end up with a bit number between 0 and 7, in a register, lets say r16. Now I need to create a mask with that bit number set. To make it more complicated, the timing of the operation must be the same, regardless…

Max Kielland
- 5,627
- 9
- 60
- 95
1
vote
0 answers
ATMEL assembler .DB complains about "misaligned"
I'm using an assebler project in ATMEL Studio 7 (ATtiny84A) and I ran into a strange problem. In a code segment, if a .DB has two bytes it's fine, but two .DB on separate lines gives a misalignment warning.
.CSEG
; one row
.DB 0x01, 0x02
; same…

Max Kielland
- 5,627
- 9
- 60
- 95
1
vote
1 answer
ATTiny85 - Software UART with Timer1
So recently I tried to implement Software UART (TX only) for the ATTiny85. I want to drive it with the internal Timer1.
The timer shall interrupt with the frequency of the Baudrate. Every ISR one bit will be transmitted, until there is nothing left…

vipeout
- 25
- 5
1
vote
1 answer
How do I output a compare match to OC1B in Fast PWM mode on the ATtiny84?
My goal is to output a PWM signal from my ATtiny84 with 1ms high at 50hz. The clock is operating at 1mhz, so I've set the compare output mode such that the output pin should be cleared for 19000 clock ticks and be set for 1000.
The device is…

Koraken
- 115
- 1
- 11
1
vote
1 answer
Trying to get an i2c pressure sensor to send data to an ATtiny85, but the libraries available to me are giving me 'undeclared' error
I am trying to connect an LPS331AP pressure sensor to my ATtiny85, to read the pressure from it. My code works flawlessly on an Arduino Uno, but when making the relevant changes as suggested on multiple forums, I am getting errors that I don't quite…

Adam
- 71
- 9
1
vote
1 answer
why adc always reads 1023 irrespective of input
I am trying to read a analogue voltage using the ADC in attiny85. But the ADC register always read 1023 irrespective of what input is given.
Moreover when the ADC pin is measured with a multimeter it shows nearly 3.1V. I aasumed that it is pulled…

It'sDK
- 23
- 7
1
vote
0 answers
How to perform USB Host fingerprinting?
I have a Digispark board that is powered by an ATtiny85 microcontroller, the bootloader is micronucleus and it implements the USB protocol in software.
I would like to tell apart hosts the device is being plugged into (ideally uniquely, or close…

lle-bout
- 20
- 3
1
vote
1 answer
Why is #define F_CPU have no effect on AVR code _delay_ms_() function?
I am programming an ATtiny85 with MS_Visual_Studio with extension Visual_Micro using an Arduino1.6/1.8 Gemma board definition. The programmer is Sparkfun Tiny Programmer.
Here is the very simple code utilized. ( Thanks to InsideGadgets YouTube…

Fred Cailloux
- 175
- 1
- 7
1
vote
1 answer
Creating an oscillating tone using Arduino, ATTiny85 and a simple buzzer
First a bit of background. I am attempting to make an LED glow and a buzzer produce a tone that sweeps smoothly up and down in frequency, like an air raid siren. I am using an Arduino Uno, connected to an ATTiny85 chip operating at 8hz clock speed.…

Ash
- 9,064
- 3
- 48
- 59
1
vote
2 answers
ATtiny writing arrays with wrong values | Arduino IDE | TinyWireM
its my first question here and I hope I'm not stepping on anyone's tows :-)
Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is…

Christian Döring
- 11
- 3
1
vote
3 answers
ATTiny85 Internal Clock and One-Wire
Is the internal clock on the ATTiny85 sufficiently accurate for one-wire timing?
Per https://learn.sparkfun.com/tutorials/ws2812-breakout-hookup-guide one-wire timing seems to need accuracy around the 0.05us range, so a 10% clock error on the AVR at…

RobotAndy
- 115
- 3