[solved]programming the EESAVE fuse of attiny84 while having arduino as isp

hello. i wanted to program the EESAVE fuse bit of the attiny84 . so can i do it using arduino uno as isp?
will it make the chip unreprogrammable ?(just aking)
will i be able to reset the bit using the uno itself (main question#3)? because if something goes wrong...
:frowning:
if eeprom is empty till now i mean i have not used it , not even touched or even read it, will chip erase still reduce the write cycles of eeprom(main question#2)?
will the uno even be able to SET the fuse bit?(main question#1)?
well i am just a newbie but still i cant bear to see the eeprom being erased EVERYTIME I UPLOAD A SKETCH :frowning: but i wanted to ask someone before i did anything wrong and possibly locked myself out of my attiny.. or permanently damaged it.
thanks! :slight_smile:
(sorry if i am asking too many questions)

so can i do it using arduino uno as isp?

Yes.

will it make the chip unreprogrammable ?

No.

will i be able to reset the bit using the uno itself (main question#3)? because if something goes wrong...

No. You have to do it over ISP. Nothing wrong will happen. Do not worry. UNO has EESAVE programmed by default.

if eeprom is empty till now i mean i have not used it , not even touched or even read it, will chip erase still reduce the write cycles of eeprom(main question#2)?

Yes. Chip erase do not affect the EEPROM if EESAVE is programmed,

will the uno even be able to SET the fuse bit?(main question#1)?

To itself? No. Like in previous question.

I am bit confused by your questions. Anyhow, you can program ATtiny84 EESAVE without worries. Arduino as ISP is like any other ISP programmer, just slow a bit. You can set/reset EESAVE as you need and also other fuses. Just remember if you set the MCU for external clock use then it must have any, otherwise the MCU will not start until clock signal will be provided.

Here is some reading I'm recommending:

thank you so much.
i was asking this in main question #2 - if the eeprom is empty, (i thought that) there would be nothing to erase (in the eeprom ) while a chip erase is being performed right? so would chip erase still reduce the number of cycles the eeprom can be written?
sorry for being unclear

btw thanks for the link.

Honestly, I'm not sure about erasing mechanism but probably yes, it counts. However, EEPROM is durable 100k cycles, while FLASH only 10k.
EDIT: Each erase cycle definitely counts if EESAVE is not programmed, as there is no way how to distinguish whether EEPROM is empty or not. Same with flash memory.

ok. i will use any online calculator for calculating the hex number for the fuses including the eesave fuse (i do not want to calculate it myself because the rstdsbl always scares me! and any error could be fatal) i am setting the fuses today, and thanks a lot for the response. :slight_smile:

guess what!? 3 of my 4 attinies had the fuse set successfully
what i did is this-
in the boards.txt i set the high fuse byte to 0xd7
burnt bootloader
uploaded 1 sketch
disconnected power
uploaded another sketch
uploaded 1 more sketch after some time.
aaaaannnnnnd ALL the steps were successful!!!!!!!!!!!!!!
and all the sketches were working! yay.
just wanted to get it confirmed if setting the fuse byte to 0xd7 really does set the eesave fuse(just confirmation)
the fourth one didnt fail
the thing is- it is smd . so i thought i would do it later.
an extract from the file after the modification-

ATtinyX4.menu.clock.internal1.bootloader.low_fuses=0x62
ATtinyX4.menu.clock.internal1.bootloader.high_fuses=0xd7
ATtinyX4.menu.clock.internal1.bootloader.extended_fuses=0xff

the path is-
c:\users\user\appdata\local\arduino15\packages\attiny\hardware\avr\1.0.2\boards.txt
please tell if anything is wrong
thank you so much! ;D

Yes, EESAVE is programmed.
Maybe this could be interesting for you:

https://www.engbedded.com/fusecalc

All the above is certainly very educational in understanding fuses etc.

Unless I missed it, quite possible, you did not explicitly specify whether you are using the Arduino IDE or which ATTiny core you are using. You did specify using an UNO as ISP.

When using DrAzzy's ATTinyCore the menu options allow you to specify whether you want to retain the EEPROM when uploading or not. That will set the fuses as required without you having to make any changes to the boards.txt file (very easy to mess things up).

Just for interest, the settings:

ATtinyX4.menu.clock.internal1.bootloader.low_fuses=0x62
ATtinyX4.menu.clock.internal1.bootloader.high_fuses=0xd7
ATtinyX4.menu.clock.internal1.bootloader.extended_fuses=0xff

does, as @Budvar10 rightly stated, set the EESAVE flag to retain the contents.

However, the low_fuses setting of 0x62 sets the internal clock to 1MHz. A setting of 0xE2 will at least set it for internal 8MHz. Most other settings will need and external crystal.

Willem.

Presumably he is using the damellis core, which is not actively maintained, poorly optimized for these parts, and does not expose a large amount of functionality.

thanks for the replies, i am using the Arduino IDE and i.......umm ....didn't know the difference between different cores...the thing is that i was unsuccessful in manually downloading the core files of any microcontroller and getting it to work even after many attempts, probably i messed up in creating the hardware folder and putting the files in it or something else.. i was an absolute newbie (still i AM a newbie though) so i got impatient and tried to download the files from a boards manager by inputting url in the preferences box as shown in a tutorial that i watched . it worked for me. so .. i actually didn't know the difference .. now i understand... thank you so much for telling! :slight_smile:

and i did actually want internal 1mhz, because i want to operate it between 1.9-2.4v (two of the attinies are 84v-10pu and two of them are 84a-ssur so they can work on the voltage at the particular clock setting) . but thanks for telling .