ATTiny84 - Looking for writing to flash example

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

 

Last Edited: Fri. Dec 6, 2019 - 12:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Fri. Dec 6, 2019 - 03:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We were asking for runtime self-programming, for the program space code if possible

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, we are looking to provide runtime customization of a specific subroutine, e.g. rewrite do_some_task() for whatever you wanted

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!! 👌🏼

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please mark the solution

great, glad you found it

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will be completing my task and sharing validated reference code next, will confirm at this point

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR109 is written for the ATmega family, I am having difficulties porting this to ATTiny:

 

 

I will look at dawson's reference next.

Last Edited: Fri. Dec 6, 2019 - 07:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi dawson, thank you for this ref!

 

I was not able to get this working, thoughts?

 

Last Edited: Fri. Dec 6, 2019 - 11:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can post up reference code if useful

Last Edited: Fri. Dec 6, 2019 - 11:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Make sure the SELFPRGEN fuse is programmed. If the the EXTENDED fuse reads 0xFF, none of the code examples will ever work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cool, back soon!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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 -

 

   

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Start a debug session and then exit properly, i.e. when it asks if you want to disable debug wire, say yes!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...