Go Down

Topic: ATMEL ATTINY85 - How to switch clock to 128 kHz or less? (Read 749 times) previous topic - next topic

mpcz

How to switch clock to 128 kHz or less? (target = minimum consumption).
I have Arduino IDE 1.8.2 + programmer with ATTINY44 + MPU TINY85.

http://www.ispshop.cz/index.php?main_page=product_info&cPath=78&products_id=647

I need to activate clock 128 kHz or less on ATTINY85 (or other mini ATMEL).
Is it possible to activate 128 kHz on this configuration?
Thank you for your help.
mpcz , 02.oct.2017

BJHenry

This would probably be a good way to start...

mpcz

BJHenry: thanks, yes, that's beauty ...
In my IDE there is no choice board: ATTINY ....
Need more installation? How Please?
Thank you.
mpcz, 02.oct.2017

hansibull

MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

DrAzzy

Unfortunately, my core still won't get him support for 128khz operation - I don't have any speeds lower than 1mhz in the list.

With some ISP programmers, there are issues with programming when the target chip is running at a very low speed, because the programmer needs to enter a low speed mode, and this mode isn't well exercised (due to very limited interest in low clock speeds) and doesn't work correctly on some programmers (and in some cases, it depends on the firmware version on the programmer - for example, in some versions of the USBAsp firmware, it needs to get told to use low speed mode by avrdude, in others it uses a jumper on the board, and in others it auto-detects it... I think, at least - I haven't played with low speed mode). It's a mess, and the use cases for such low speed operation are limited - usually you can get comparable power consumption with proper use of sleep mode and a higher clock speed.

ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Johnny010

This is already sounding like an XY problem.

What are you actually trying to achieve...like the end goal?

 


mpcz

Support for IDE ATTINY85 / 128 kHz was successful.
Unfortunately, the delay () command does not work. Here the program is blocked.
Is command "delay()" in 128kHz mode operational?
Thanks, mpcz, 02.oct.2017

p.s. (target = minimum consumption, no current peaks over 300 microA).

DrAzzy

Support for IDE ATTINY85 / 128 kHz was successful.
Unfortunately, the delay () command does not work. Here the program is blocked.
Is command "delay()" in 128kHz mode operational?
Thanks, mpcz, 02.oct.2017

p.s. (target = minimum consumption, no current peaks over 300 microA).
What core are you using?
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

BJHenry

Unfortunately, my core still won't get him support for 128khz operation - I don't have any speeds lower than 1mhz in the list.

With some ISP programmers, there are issues with programming when the target chip is running at a very low speed, because the programmer needs to enter a low speed mode, and this mode isn't well exercised (due to very limited interest in low clock speeds) and doesn't work correctly on some programmers (and in some cases, it depends on the firmware version on the programmer - for example, in some versions of the USBAsp firmware, it needs to get told to use low speed mode by avrdude, in others it uses a jumper on the board, and in others it auto-detects it... I think, at least - I haven't played with low speed mode). It's a mess, and the use cases for such low speed operation are limited - usually you can get comparable power consumption with proper use of sleep mode and a higher clock speed.


Your core is the only one I have installed and is what I used for hat screenshot- or do you mean that the frequency isn't well supported even though it is on the list?

Smajdalf

Note that often you get more power savings by fast clock and using sleep as much as possible.
On 8-bit (i.e. Uno) use "byte" instead of "int" if possible - it is faster and saves resources!

mpcz

Hello,
I have a question:
what consumption in microA has ATMEL TINY85 or similar running at 16 kHz, 3 or 5V?
All unneeded off. Important, NO sleep mode!
Please, only verified data.
Thanks, mpcz, 07.10.2017

uxomm

what consumption in microA has ATMEL TINY85 or similar running at 16 kHz, 3 or 5V?
16kHz?
Do you really mean 16 Kilohertz? Or do you mean 16MHz (Megahertz)?
Let' assume it is 16MHz.

The question is not to answer easily.
There are two types of ATtiny85. The "normal" ATtiny85 and ATtiny85V
See the working range (form the datasheet):
Quote
ATtiny85V: 0 - 4 MHz @ 1.8 - 5.5V, 0 - 10 MHz @ 2.7 - 5.5V
ATtiny85: 0 - 10 MHz @ 2.7 - 5.5V, 0 - 20 MHz @ 4.5 - 5.5V
You may notice: it may not work with 16MHz at 3 Volts.

And even if it does not really make sense, I made some measurements with ATtiny85 and ATtiny85V lying around. Just to get an idea of the consumption.
With an empty sketch like this:
Code: [Select]
void setup() { }
void loop() { }

And nothing connected but a decoupling cap (100nF).

Here are the results:
ATtiny85
1MHz* @ 3V: 1.0mA
1MHz @ 5V: 3.6mA
8MHz @ 3V: 3.7mA
8MHz @ 5V: 8.1mA

ATtiny85V
1MHz @ 3V: 0.9mA
1MHz @ 5V: 2.7mA
8MHz @ 3V: 3.6mA
8MHz @ 5V: 7.5mA

Maybe not exactly the answer you asked for, but...

----------------------
*) all clock speeds are internal clock
Always decouple electronic circuitry.

mpcz

Thank you for your response.
I have TINY85, internal 128kHz (kilohertz), divided clock at 16 kHz, about 300 microA.
I have the same, very short code on PIC 16FXXXX. Consumption of 25 microA (not sleep!).
Does anyone have a setup procedure for ATTINYxxx for similar consumption? (minimal clock, off all unnecessary, minimal frequency accuracy requirements).
Thanks.
mpcz, 08.10.2017

Smajdalf

ATTiny should have <200uA current consumption with internal 128kHz without prescaler even at 5V. Are you sure everything (including BOD, ADC etc.) is properly disabled? If using Arduino core a timer is probably running to keep millis. Also make sure all pins are either Vcc or GND (or digital buffering is disabled via DIDR0).
Also try to make something timed (blink a LED) to confirm you are not running from the 8MHz oscillator. If you have prescaler 8 (to get 16kHz from 128kHz) it would mean 1MHz running from main oscillator. Typical power consumption @1.8V@1MHz is 300uA.
But all of that are Datasheet values, I don't have Tiny85 except for Digispark board. And there are the LDO and USB voltage translator increasing current drain.
On 8-bit (i.e. Uno) use "byte" instead of "int" if possible - it is faster and saves resources!

uxomm

As mentioned already: You need a "special" programmer to program the ATtiny with low speeds (like 128 kHz). Not every programmer can do this. I have 3 different ISP programmers and none of them can work with 128 kHz. But cases for low speed operation are pretty limited.

See also answer #4

And: http://gammon.com.au/power

Always decouple electronic circuitry.

Go Up