-
Hello! If no one has the time to help right now or this is too off topic just close this. :) Is my understanding of the general Programming sequence that I got from the Datasheet right and if not where did I take the wrong turn? (I'm using byte indices instead of words so the page size would by 128 bytes, and when I say byte index I mean relative to all the data I want tow write to the flash)
If anyone find's any time to help I'd be grateful! Thx! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
For question like this, please use Discussion. |
Beta Was this translation helpful? Give feedback.
-
Looks like you want Serial Programming. And yes, the datasheet you pointed to is your friend. Page 346ff, in particular the table on page 348. The note (8) for write page does not exist, but I reckon it's a typo for note (6). In the write page instruction you must send the words address of any one 16-bit word in the page (customarily the first word of the page). The page load needs the word address bits within the page. |
Beta Was this translation helpful? Give feedback.
-
You can only program a page (128 bytes) at once: first one loads the 128 bytes of a page using the 2 different load page commands in alternation, then you write the 128-byte page once with write page. Here how avrdude composes the SPI commands for flash:
Good luck with rolling your own. |
Beta Was this translation helpful? Give feedback.
-
Thank's a lot, I got it to work. I'm just gonna share some pseudo code here, for anyone who is as confused as I was when starring at the Data Sheet or the avrdude source code. (Pseudocode is ChatGPT generated from real code, cuz I can not post the former since I don't own it and don't have the time to write it myself.)
|
Beta Was this translation helpful? Give feedback.
Thank's a lot, I got it to work. I'm just gonna share some pseudo code here, for anyone who is as confused as I was when starring at the Data Sheet or the avrdude source code.
(Pseudocode is ChatGPT generated from real code, cuz I can not post the former since I don't own it and don't have the time to write it myself.)