We’re rewarding the question askers & reputations are being recalculated! Read more.
7

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 length of this delay depends on your selected clock source, and is somewhat configurable with the fuses. According to your code, your MCU is clocked at 8 ...


5

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 won't stay at that level for long. Having said that, 200 µA current sounds like a lot. You should be able to get it down to 6 µA. Perhaps post your schematic? ...


4

!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) { servo.write(60); } else { servo.write(100); } flip = !flip; delay(650); } Or, get rid of the delay altogether: uint32_t ...


4

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 "20 MHz version". By selecting the appropriate clock option in fuses you can run at 20 MHz (or higher). From the datasheet: High Frequency PLL Clock ...


3

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 switched off. Set the output to LOW to pull the gate down and enable the MOSFET. Be sure to "stop" your Serial connection and set both TX and RX pins to INPUT to ...


3

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 have pending. That way, there is only one master, and it only asks for data when it's ready (that is, not receiving from some other device.) One purpose of a ...


3

I have no idea why they haven't used a fixed pull-up, but the pull-up is only done when the controller wants to read the sensor for only about 120us. If you want to get a good resolution in the resistance measurement, the resistance of your pull-up should be in the same range as the resistance of your sensor. If your sensors have low resistance, this ...


3

Try replacing the lines #define DATA_1 (PORTC |= 0X01) // DATA 1 // for UNO #define DATA_0 (PORTC &= 0XFE) // DATA 0 // for UNO #define STRIP_PINOUT (DDRC=0xFF) // for UNO int buttonPin = 11; //button pin variable, 11 on the Arduino with #define DATA_1 (PORTB |= 0X01) // DATA 1 // on PB0 #define DATA_0 (PORTB &= 0XFE) //...


3

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 signal into some kind of RS-485 signal for twisted pair cables. The crosstalk between SDA and SCL should be avoided at all times. Don't put SDA and SCL into wires ...


3

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 pins and ground together. Wire reset pin of Digispark to io 5 (D1) of NodeMcu. You should use level conversion, but esp8266 tolerates 5 V TTL (not recommended ...


3

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 high CPU clock it requires 4.5V. The VIN pin is connected to a linear regulator that has a 2V drop-out. Thus the supplied voltage has to be at least 2V about the ...


3

Expanding on my previous comment... I need a way to keep an array of memory ignored by the C initializer You can achieve this by instructing the compiler to store the array in the “.noinit” memory section: int my_array[ARRAY_LENGTH] __attribute__((section(".noinit"))); Your array will end up sitting somewhere between the .bss and the heap (if any), and ...


2

This is normal. Timer0 is used as the clock source for the USI. It's the only internal clock source that can be used. The only other option is to use "software polled" mode where it's up to the sketch (or support library) to manually create the clock signal (less than desirable) by setting a bit in a register at the right time. So you can only use Timer1 ...


2

As Look Alterno stated it would be easier to directly use an LCD display. But if you really want to use the 7 segment display and the ATTiny85 you can use I2C to send the number to the ATTiny. There are libraries, that can use the USI hardware ot emulate a (nearly) full I2C bus. For example my TinyWire library, that I composed from the previous TinyWireM and ...


2

THIS IS NOT AN ANSWER; it's just a very long comment and I was not able to add all the formatting and ideas in the comment I was writing. Please don't consider it as a valid answer. I leave all the low current topics to Nick, since he's doing a great work as usual. I wanted just to give you some ideas for the temperature acquisition and storing. First of ...


2

Have you tried using the Radiohead library? I know you said you tried different versions of Virtual Wire. The RH_ASK class works on a 328p and a nano for sure and they claim a simple Rx program can run on a ATTiny85. They have documentation under RH_ASK regarding the changes you need make to the library. Another possible fix is to edit the Virtual Wire ...


2

I see no reason why you would not be able to light 30 LEDs. ATtiny85 only has 5 pins for use (unless you want to use the reset pin as well in which case hell will cover you). So with charlieplexing you are going to be able to address 20 endpoints. (where each endpoint might consist of multiple LEDs) But beware. You CAN address 20 endpoints but you CANNOT ...


2

This seems to be an X -> Y problem, with X being the missing clock source on your ATTiny, which prevents communication. If you have a second Uno or other AVR device, you can use that to generate a clock signal on any of the digital pins: void setup() { DDRB = 0b00100000; } void loop() { PINB = 0b00100000; } This creates a square(~ish) signal on Pin ...


2

Is it possible to program chips like the Arduino uno's Atmega328P directly with USB serial from your computer? The bare chip? Generally, no. Some chips that include USB hardware also may include a DFU bootloader in ROM. If your chosen chip has this, then yes you can - you just need to wire it up and use a suitable DFU firmware upload program to install ...


1

do I have to duplicate that circuit just for the relay? No, not really, no. Is the ATTINY capable of triggering a 12v relay via ground? The ATTtiny is capable of triggering a transistor - the transistor is capable of triggering a 12V relay. Unless your relay is incredibly high powered and the coil takes (and generates through back-EMF) massive amounts ...


1

I see nothing wrong in your code, except a terrible design decision that forces you to reset the ATtiny every time you want to change its inputs. I guess, then, that the problem is in the way you use it. For example, let's say you are testing the lines of the table one by one. Once you are done with the second line and decide to move to the third, let's say ...


1

Could also use a chip with better resources, such as Attiny2313. 20 Pins, so a little larger than the '85, but you get a real serial port and SPI port.


1

If you search the internet, you mostly find statements, that the fuses will be set right, if you burn the bootloader from the IDE. However I had to set the fuses in an extra call to avr-dude, because the clock divider was still active, setting the clock effectivly to 1MHz, instead of the intended 8MHz. With a command like avrdude -P /dev/ttyUSB1 -b 19200 -c ...


1

It may seem that the current commit of January 2018 from the TinyWire library is corrupt. Try using an older version from 2017, for example this one: https://github.com/rambo/TinyWire/tr...72a13504bbfc4e This solves the problem for me as well. Source: Teensy 3.5 - I2C - ATTiny85-20PU (TinyWireS.OnRequest not triggering!) - Post #11


1

The servo can't move back and forward in 40 milliseconds. It'll be more like tremble between both. Try something like this: // keep sending 0 position for about 400ms for(int i = 0; i<20; ++i) { digitalWrite(PB1, HIGH); delayMicroseconds(1000); digitalWrite(PB1, LOW); delay(19); } // keep sending second position for about 400ms for(int i = 0; i&...


1

bHogan seems to be the original developer of TinyWireM and TinyWireS. Andreas Spiess ("The guy with the Swiss accent") used rambo's implementation of the TinyWire library for his I2C sensor, and rambo on GitHub and bHogan on arduino.cc seem to be the same person... I've also used rambo's TinyWire library, and managed to make it work. Adafruits version of ...


1

I want to transmit I2C data... A little vague. Transmit to what device? How fast is your data rate (100kHz, 400kHz)? Your only transmitting and not reading anything back? What is the idling voltage of your I2C bus (to then ask if you have chosen correct pull-up resistor values for your intended bus speed)? You mention that the Wire library doesn't ...


1

I would suggest to connect one pin of the with to 5v and the other to ground. The Arduino will be able to detect 5v as logic HIGH. The code looks correct except for better programming technique I would suggest to indent you code, this make debugging easier for longer programs: #include "DigiKeyboard.h" void setup() { pinMode(0, INPUT); } void loop()...


1

Using Arduino IDE 1.8, I had a Windows did not recognize USB Device message. I successfully installed the DigiSpark drivers but still the PC was not recognizing the Tiny85 development board. In the Arduino IDE I had initially selected the DigiSpark (16.5 MHz default) as instructed in a YouTube video. I did some more research, someone suggested trying ...


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