A delay of 50ms should not vary across micro controllers even if they are running at slow CPU clock speeds. In other words, clock timers and CPU timers are independent.
I prefer PlatformIO, too. The chip is interesting (we are truly living in the future) . I see it as more of a device for wrangling sensors or other input and to pass data to different parts of a larger system.
Te attiny85 is a lovely processor, and I have used it a lot. However.....it is too expensive. One can get an arduino pro mini for just a little bit more
The delay being way longer - just did a rough counting and it seems my suspicions are correct: Each cycle of blinking takes ~800 ms - 8x slower. This is a common problem when using ATtiny but NOT cause of the core being slow or any other hardware-problem but rather the software: When using an ATtiny you gotta set the clocks correctly which can be done with the arduino-software ("burn bootloader" - counter-intuitively ). The ATtiny, if not configured otherwise, will use an internal clock-rate of 1MHz, while the Arduino-library will assume a default clock-rate of 8 MHz, messing up timings by a factor of 8. Arduino-IDE and the libraries behind it make it easy to use some microcontrollers but that also leads to some rather annoying behaviours like this.
@@slybunda "specs say its 20mhz?" Yes "is this not correct then?" No that is correct - the chip nominally supports 20MHz with external clocks (depending on the variant) But the internal clock defaults to 1MHz (and arduino assumes the 8MHz).
The default factory fuse settings use a prescaler of 8. Check the datasheet for the fuse settings to remove the prescalar. You can also run with an external crystal up to 20MHz. It’s all in the fuses. You also don’t need a boot loader.
Hi Mark, This is neat! Have you considered doing any home automation stuff with the other chips? I just ordered up a Pi Zero (which is the only thing I could find available at this time). Looking at rigging up an IR blaster to control one of the AC units in my house. 😀
Aside from motion lights, I have never gotten too excited about home automation. I do plan on making a motion detector for the office so our secretary will get a tone when someone comes into the lobby of the office.
@@markgunnisonI can relate! It's about meeting unexpected needs. I recently came back from a vacation over Christmas to discover our house was full of mould (common thing here in Portugal). I've bought a humidity sensor as well and wish to run the dehumidifier function on the AC (ideally in all rooms if the first one proves successful) when the air humidity in the room goes above a threshold. It was truly a shock to be honest. Sadly all homes in Portugal are not designed for the rainy season.
Hello, are you still watering now? I want to invite you to try our ImoLaza smart irrigation controller. You just need to provide the most realistic feedback. Are you interested?
Made my own board with an attiny1616, I am so happy that we live in an age where you can just easily design pcs and buy them.
Tiny ship in an ocean of possibilities. Than you for the video captain.
Nice work! Your videos are helping me understand this hobby a little better.
I love to use them to make led's blink with a pb to cycle thru different timing cycles.
One of the very first arduino devices I used was the Digispark usb board that uses the ATTINY85. Loved it!
I'm not sure why I didn't try it sooner. Thanks for commenting.
A delay of 50ms should not vary across micro controllers even if they are running at slow CPU clock speeds. In other words, clock timers and CPU timers are independent.
Per another comment on the video, the Arduino library assumes a different clock speed so it calculates time incorrectly.
I prefer PlatformIO, too. The chip is interesting (we are truly living in the future) . I see it as more of a device for wrangling sensors or other input and to pass data to different parts of a larger system.
Microcontroller != Microprocessor.
true
Te attiny85 is a lovely processor, and I have used it a lot. However.....it is too expensive. One can get an arduino pro mini for just a little bit more
Pretty good video. You're the best. God bless.
Thanks, I'm surprised how many views I got. I wish I had rerecorded the start of the video with better audio :-)
The delay being way longer - just did a rough counting and it seems my suspicions are correct: Each cycle of blinking takes ~800 ms - 8x slower.
This is a common problem when using ATtiny but NOT cause of the core being slow or any other hardware-problem but rather the software: When using an ATtiny you gotta set the clocks correctly which can be done with the arduino-software ("burn bootloader" - counter-intuitively ).
The ATtiny, if not configured otherwise, will use an internal clock-rate of 1MHz, while the Arduino-library will assume a default clock-rate of 8 MHz, messing up timings by a factor of 8.
Arduino-IDE and the libraries behind it make it easy to use some microcontrollers but that also leads to some rather annoying behaviours like this.
Thank you for the information. I was just assuming it was slower. What you said makes a lot of since.
specs say its 20mhz? is this not correct then?
@@slybunda "specs say its 20mhz?"
Yes
"is this not correct then?"
No that is correct - the chip nominally supports 20MHz with external clocks (depending on the variant)
But the internal clock defaults to 1MHz (and arduino assumes the 8MHz).
The default factory fuse settings use a prescaler of 8. Check the datasheet for the fuse settings to remove the prescalar. You can also run with an external crystal up to 20MHz. It’s all in the fuses. You also don’t need a boot loader.
I came to the same conclusion (see 5:30 ...) when I built a gadget for a friend. What do I do with all the 555 in the drawer now?
555s are far cheaper and take a wider voltage range.
Cool.... and tiny.
Nice info! One question which i haven't found on the web, can you reprogram an attiny 85?
Yes, you can use several methods, but the most popular is to use an Arduino Uno and program it via SPI.
Yes, I reprogrammed the chip in the video at least five times trying to get my timing correct. I would assume you can reprogram it thousands of times.
@@markgunnison thanks!
Hi Mark, This is neat! Have you considered doing any home automation stuff with the other chips? I just ordered up a Pi Zero (which is the only thing I could find available at this time). Looking at rigging up an IR blaster to control one of the AC units in my house. 😀
Aside from motion lights, I have never gotten too excited about home automation. I do plan on making a motion detector for the office so our secretary will get a tone when someone comes into the lobby of the office.
@@markgunnisonI can relate! It's about meeting unexpected needs. I recently came back from a vacation over Christmas to discover our house was full of mould (common thing here in Portugal). I've bought a humidity sensor as well and wish to run the dehumidifier function on the AC (ideally in all rooms if the first one proves successful) when the air humidity in the room goes above a threshold. It was truly a shock to be honest. Sadly all homes in Portugal are not designed for the rainy season.
Hello, are you still watering now? I want to invite you to try our ImoLaza smart irrigation controller. You just need to provide the most realistic feedback. Are you interested?
noobs will never use STM32