0

I set a project-goal for me: to make a very small compiler in Attiny.This compiler should read the code from user and translate it into code;then save it in some portion of the flash and jump there. I know this sounds impossible on Attiny85 but I want test self-programming. I read from various websites that the '85 does not have a "bootloader protection" like Atmga or Uno does. If it's true what are the functions used to write to the flash? (The only function I can thing of that access the flash is pgm_read_byte() but that is only for read).

  • 2
    There's an entire section in the datasheet devoted to this. Have you looked at it yet? – Ignacio Vazquez-Abrams May 15 '17 at 20:54
  • 1
    Maybe you can learn by reading and understanding an ATTiny85 bootloader, such as Micronucleus. – Majenko May 15 '17 at 21:11
  • The datasheet contains a lot of information but I could not find code for writing to Flash (it is a long datasheet and I have no ideea what to look at so maybe I missed it). @Majenko ..yes that was my next step.Thank you. – sergiu reznicencu May 15 '17 at 21:17
  • The datasheet is written from a low-level perspective. If you were working with assembly it would be useful, but when programming in C you would be better with the AVR106 App Note – Majenko May 15 '17 at 21:19
  • You could have a look at AmForth and how it writes to flash. amforth.sourceforge.net – Mikael Patel May 15 '17 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.