Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

Problem with programming digispark ATtiny85 board with Arduino IDE

i=i++; //increment by one The result of the above statement is not defined. That is, it is not necessarily "i + 1". See: http://en.wikipedia.org/wiki/...
Nick Gammon's user avatar
  • 38.3k
5 votes
Accepted

Attiny85 appears to be drawing 0.2mA current but battery running down more quickly

2.9V doesn't sound too bad. See a datasheet for the CR2032 I found: It looks like slightly more than 2.9V would be the expected voltage for up to 600 hours. 3.2V looks like it is fully charged, and ...
Nick Gammon's user avatar
  • 38.3k
5 votes
Accepted

Can I program a 20MHz Attiny85 with the 8MHz Internal Clock option in the Arduino Software?

I think you have the wrong end of the stick here. The Attiny85 is not a chip that comes in different speed versions. The datasheet mentions that it can run at 20 MHz. That doesn't mean you can buy a "...
Nick Gammon's user avatar
  • 38.3k
5 votes
Accepted

How long does it takes for arduino to reach main()?

The ATtiny85 has a built-in delay counter that keeps the MCU in reset mode for some time after the power is applied. This seems to be intended as a wait for the clock and power to be stabilized. The ...
Edgar Bonet's user avatar
  • 43.3k
4 votes
Accepted

Servo only going one direction till it reach limit

!flip doesn't really do anything and will probably be optimized out by the compiler. You need to save the result: flip = !flip; You can simplify the code a bit: void loop() { if(flip) { ...
001's user avatar
  • 953
4 votes
Accepted

Attiny timer interrupt does not make an interrupt every 1000ms

I see three issues with this approach. The first is that you are using a very low quality, uncalibrated time source. The frequency of the internal RC oscillator is good to within a few percent only. ...
Edgar Bonet's user avatar
  • 43.3k
3 votes
Accepted

Attiny85 route vcc though output pin

What you want is a P-channel MOSFET to control the power. Something with a nice low "logic level" gate threshold. simulate this circuit – Schematic created using CircuitLab R1 keeps it ...
Majenko's user avatar
  • 105k
3 votes
Accepted

ATTiny85 Digispark clones failing USB handshake - how to program them?

I had problems too - SHORT: all about USB-hub or PC's root-hub and extension cables +Luck. My ebay items were going under the name "Digispark Kickstarter ATTINY85 Arduino Micro USB Development Board"...
vR0M's user avatar
  • 46
3 votes

Digispark Serial Port Communication

You may use DigiCDC to virtually create a serial device. It's slow but does the job as mentioned in this article. A serial-echo program would look something like this: #include <DigiCDC.h> void ...
waqaslam's user avatar
  • 131
3 votes

i2c wire length

As @majenko wrote, the I2C bus was not designed to go over wires or into a cable. It is ment for components on the same pcb board. As @mikaelpatel wrote there are bus drives which convert the I2C ...
Jot's user avatar
  • 3,246
3 votes

I2C from two masters (ATtiny85, ESP8266) to one slave (ATmega328)

If you have 1 receive only device, and 2 send-only devices, why not make the receive-only device the master, but have it poll (periodically, repeatedly ask) the slave devices to send any data they ...
jose can u c's user avatar
  • 6,974
3 votes
Accepted

Flashing an ATtiny85 with a NodeMCU?

It can be done. Your Digispark has SPI pins, which are ISP pins. For the esp8266 there is an ESP8266AVRISP library for OTA upload to AVR. You can use the example of the library. You must wire the SPI ...
Juraj's user avatar
  • 18k
3 votes
Accepted

Powering a Tiny Arduino Project

The old circuit will not work as you expect. While the ATtiny85 can run happily with 2.7 to 5.5V in this setup it expects 5V. I assume this is due to the high CPU clock setting. To run stable at a ...
Kwasmich's user avatar
  • 1,513
3 votes

Digispark Micro (ATTINY85) not working on Macbook Pro 2016

Digisparks are known to have problems with USB3 ports (which your USB-C adaptor probably provides). Try using a cheap USB2 hub between the DigiSpark and the adaptor. It's always a good idea to use a ...
JayEye's user avatar
  • 756
3 votes
Accepted

Attiny85, high output impedance, dim leds

The answer to the main problem was that I had used pinMode(mode, number) where the actual syntax is pinMode(number, mode). Presumably modes can be selected by number and the compiler though I wanted ...
user86728's user avatar
3 votes

Attiny85, high output impedance, dim leds

You already found your problem. I am answering only to provide some insight on why you were experiencing the symptoms you had. pinMode() takes two integer arguments (two uint8_t to be precise). The ...
Edgar Bonet's user avatar
  • 43.3k
3 votes
Accepted

ATTINY85 and POT

Port PB0 is not an ADC (analog input) pin on the ATTiny85. Available pins of the ATTiny85 (from the Atmel ATtiny 25, 45, 85 datasheet): Choose PB2, PB3, PB4 or PB5 if you need an analog input. ...
StarCat's user avatar
  • 1,651
3 votes
Accepted

ATTiny85 USB Troubleshooting. Device is not recognized when programmer asks to plug in device

From your AVRDude output: avrdude: safemode: Fuses OK (E:FF, H:DF, L:62) It does not appear that you have programmed the AVR configuration fuses. One for thing, E:FF, is extended fuse value 0xFF, ...
timemage's user avatar
  • 5,299
3 votes
Accepted

ATTiny85 won't boot if PIN2 is not pulled high

Well, I've made some headway. I hope to update this with something more helpful though. I don't have a digispark or even the correct Zener diodes to replicate the necessary parts of it. However, I ...
timemage's user avatar
  • 5,299
3 votes
Accepted

Programming ATtiny85 with Arduino-IDE and an 8MHz external oscillator

If you look at the Digispark Schematic you'll see resistors and Zener diodes attached to XTAL1 and XTAL2: These are for the USB D+ and D- signals that the Digispark bit-bangs. I deeply suspect that ...
timemage's user avatar
  • 5,299
3 votes

Digispark Rev.3 Kickstarter ATTiny85 using all 6 pins

There is no such Digispark board as the Rev 3. There was going to be, but there was a mistake, so they went straight from Rev 2 to Rev 4. However unscrupulous Chinese counterfeiters are making "...
Majenko's user avatar
  • 105k
3 votes

Digispark Rev.3 Kickstarter ATTiny85 using all 6 pins

As an addition to Majenko's answer I can report having used many of the "Rev.3" counterfeits, every single one came with chip default fuses thereby reset enabled. You can set the RSTDISBL ...
scitor's user avatar
  • 169
3 votes

How to run a sketch for a period (e.g. 1min) and then attiny85 goes to sleepmode automaticaly?

You can write, at the end of loop(), “if one minute has elapsed, then go to sleep”. In C++, that would be: if (millis() >= 60000) // 60 seconds elapsed sleep_mode(); You will need to include &...
Edgar Bonet's user avatar
  • 43.3k
3 votes

How can i reduce my global variable use? Attiny85

FastLED needs to keep the colors of all the pixel in RAM, so that is using a lot of RAM. To get around this, you could use a strategy that generates the pixel data on the fly as you send it out to the ...
bigjosh's user avatar
  • 1,553
3 votes
Accepted

ATtiny85 won't wake from sleep

I believe your problem lies here: PCMSK |= _BV(INT0); // Use INT0 (PB2) as interrupt pin You seem to have mixed up two sorts of interrupts: INT0 (External Interrupt), which only works on pin INT0 (...
Edgar Bonet's user avatar
  • 43.3k
3 votes
Accepted

How to burn fuses in Digistump ATTiny85 with the Arduino IDE

The first thing to say (already mentionened by @timemage) is that there is a large variety of "Digispark / Digistump" devices, both original, clones using the Micronucleus bootloader, even ...
6v6gt's user avatar
  • 1,053
3 votes

does ATtiny85 handles the size of the libraries mentioned below `<MD_Parola.h>` and `<MD_MAX72xx.h>`

It is very simple to test. Install the ATTinyCore in IDE Install the MD_Parola library in Library Manager. It will install the MD_MAX72xx library too Go to IDE Examples menu, search for the MD_Parola ...
Juraj's user avatar
  • 18k
3 votes

problem conversion value

You will need to build the string yourself. Probably the easiest way is using the sprintf() function which will take a bunch of arguments and convert them to a string based on formatting instructions ...
bigjosh's user avatar
  • 1,553
3 votes
Accepted

ATTiny85 pin definitions

The macros such as PB2 are defined in the avr-libc for accessing the bits of the raw I/O ports, with statements such as PORTB |= _BV(PB2); // set PB2 as HIGH They do not uniquely identify as pin: if ...
Edgar Bonet's user avatar
  • 43.3k
3 votes

Arduino Digispark ATtiny85 conditional logic not working

I am confident I solved the problem and think I know why it occurs. PB1 on the digispark Attiny85 has a built in LED. This LED is still active when I run my code. The LED is dim, but consuming power. ...
jmarywien's user avatar

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