Go Down

Topic: [solved]programming the EESAVE fuse of attiny84 while having arduino as isp (Read 236 times) previous topic - next topic

NetiSasidhar

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...
:(
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   :(  but i wanted to ask someone before i did anything wrong and possibly locked myself out of my attiny.. or permanently damaged it.
thanks! :)
(sorry if i am asking too many questions)

Budvar10


Quote
so can i do it using arduino uno as isp?
Yes.
Quote
will it make the chip unreprogrammable ?
No.
Quote
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.
Quote
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,
Quote
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:

http://ww1.microchip.com/downloads/en/DeviceDoc/doc8006.pdf
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

NetiSasidhar

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.

Budvar10

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.
Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

NetiSasidhar

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

NetiSasidhar

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-
Code: [Select]

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

Budvar10

Arduino clone with ATmega1284P   http://forum.arduino.cc/index.php?topic=277260.0

Willem43

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:
Code: [Select]
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.

DrAzzy

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.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

NetiSasidhar

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! :)

NetiSasidhar

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 .

Go Up