Quickest way to get a pulse from an Attiny?

Thread Starter

Linkan

Joined Mar 25, 2017
4
Hi there,
A bit of a newbie question here: I’ve programmed an Attiny to perform a single pulse on power-up, that is, when 3 volt is applied to the chip it simply sets a pin to HIGH (on void setup) and goes LOW during the loop. It works as expected, however, there seems to be a short lag during power-up and I need the pulse to be instant. Does anyone know how long it takes to boot the chip? Would it be a better idea to set the chip to sleep mode and just wake it up to perform the pulse and then go back to sleep? Or are there any smarter ways to do this?
 

MrChips

Joined Oct 2, 2009
30,824
Every MCU has a start-up delay. This is partially because it takes a number of cycles for the crystal oscillator to stabilize.
You may achieve a shorter delay by going to an internal oscillator on the MCU.

What is the maximum start-up delay you can tolerate?
 

Thread Starter

Linkan

Joined Mar 25, 2017
4
Hi MrChips and thanks for your quick response. I'm using the internal oscillator and it's set to 8 MHz. Regarding tolerance, all I can say is as fast as possible :)
The application I'm aiming for is battery driven and I need to conserve as much power I can. I do understand that if the chip would be powered on constantly, I would get a very fast response. Does the sleep function generate lag as well you think? And to clarify, it's an Attiny85.
 

MrChips

Joined Oct 2, 2009
30,824
Did you check the ATtiny85 Datasheet?
There are three startup times for the internal 8MHz RC oscillator.
(0) 14CK
(1) 14CK + 4ms
(2) 14CK + 64ms

The default is option (2).
You need to change your SUT fuse settings.
 

Thread Starter

Linkan

Joined Mar 25, 2017
4
Did you check the ATtiny85 Datasheet?
There are three startup times for the internal 8MHz RC oscillator.
(0) 14CK
(1) 14CK + 4ms
(2) 14CK + 64ms

The default is option (2).
You need to change your SUT fuse settings.
Wow! I totally missed that, that's great. Now I just need to figure out how to set the fuse settings. I'm pretty new to this so any pointers (or code) would be greatly appreciated. Found some info on https://dntruong.wordpress.com/2015/07/08/setting-and-reading-attiny85-fuses/ but I'm not really sure where to set the start time?
 
Top