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 ...


3

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 names INPUT, OUTPUT and INPUT_PULLUP are just macros for 0, 1 and 2 respectively. This is why the compiler accepts your code with the arguments swapped. On the ...


2

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" and naturally it came with no Digispark-(c)-right infringing markings from China. I kept my fingers crossed that my items would at least be AVRisp-programable....


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

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

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

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

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 cheap USB hub between whatever experimental device you want to connect and your machine, so that if you wire something up incorrectly you don't end up frying an ...


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 ...


2

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 to set an undefined pin to mode number. TL;DR the correct syntax is pinMode(4, OUTPUT) to set PB4 (pin 3) to output. The problem of higher than expected ...


2

The schematics of the digistump developer board shows that PB3 is connected to +5V over two resistors (1.5 k + 66.5) Ohms. That's the reason for the high current (5V / 1560 Ohm = 0.0032051 A). See the schematics https://s3.amazonaws.com/digistump-resources/files/97a1bb28_DigisparkSchematic.pdf As you mentioned in a reply on my comment above, using PB2 shows ...


2

Unless you connect the ground of your ATTiny to the ground of your USB UART interface there is no circuit for the electrons to flow around. It works when powered from the computer because everything shared the same ground connection.


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 ...


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