We are having difficulty writing to flash on the ATTiny84. We have found the following reference:
We have reviewed through Atmel START's contents without success, how can we get started writing to Flash for the ATTiny84?
Check out this application note: AVR109: Using Self Programming on tinyAVR and megaAVR devices
Are asking how to flash your program via isp, or how to write to flash rom from within a program.
if the later, why not use eeprom for nvrom storage?
Click Link: Get Free Stock: Retire early! PM for strategy
get $5 free gold/silver https://www.onegold.com/join/713...
We were asking for runtime self-programming, for the program space code if possible
Are you wanting to write a boot loader? Will not one of the many that already exist not work for you?
See ap note AVR109 for example or if using gcc, see example boot loader provided in doc.
No, we are looking to provide runtime customization of a specific subroutine, e.g. rewrite do_some_task() for whatever you wanted
lol I though balisong42 had recommended AVR106, which I had reviewed already, 109 is just what we needed. Even comes with reference example code, thank you!! 👌🏼
Please mark the solution
great, glad you found it
I will be completing my task and sharing validated reference code next, will confirm at this point
Just out of interest which language are you programming in? If it is the GNU version of C (avr-gcc) then look at: https://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html the example boot_program_page() that shows is pretty much the entire solution of what you would require.
AVR109 is written for the ATmega family, I am having difficulties porting this to ATTiny:
I will look at dawson's reference next.
Hi dawson, thank you for this ref!
I was not able to get this working, thoughts?
I can post up reference code if useful
Make sure the SELFPRGEN fuse is programmed. If the the EXTENDED fuse reads 0xFF, none of the code examples will ever work.
cool, back soon!
How do I switch from DebugWIRE mode back to ISP mode? I will need this to perform the fuse change it appears, I am seeing this now -
Search for 'stuck in debugwire' in the forum. Basically, there's a option on the Debug menu in Studio to exit debugWire. If that fails, there's a command-line tool that should work. And if that fails, you may need to apply 12V to the Reset pin to start an ISP session.
Start a debug session and then exit properly, i.e. when it asks if you want to disable debug wire, say yes!
© 2020 Microchip Technology Inc.