-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong timings for ATmega328PB and other parts in avrdude.conf #976
Comments
I am a Hardware engineer by trade. |
@stefanrueger feel free to create a PR for small issues like this. They can easily be merged right away. |
Good to know. So, the timings in
Thanks, but no: I have stopped suggesting PRs on a number of small-ish issues for fear of putting too much pressure on the current PR queue and, hence, diluting the limited resources the project has. This issue can serve as a useful reminder, though, for me or anyone else later on.
Whilst the issue is small, the solution is not as easy as it may look: some of the timings are specific for memories, which A good case study illustrating some pitfalls is the history of |
You are not wrong but the table caption probably is: I fully expect tWD_XYZ to mean "unless polling the user must wait at least that time after XYZ", and that is how AVRDUDE uses tWD_ERASE. (Search where WD_ is used in Microchip's MCU datasheets.) |
I added a little spiel to my partdesc branch so that For example, to find memory/part combination with unset wait delays, use
Some of these will be legit and expected (I am guessing BTW, that technique is otherwise useful for debugging. For example,
shows the list of all parts, as AVRDUDE understands them, that have byte EEPROM commands but no paged EEPROM commands (needed in Issue #967). Another example is
that puts all parts with an EEPROM page size of 1 (relevant for Issue #970) on a mouse button for markdown issue reporting. |
I just got two official Microchip boards (AVR128DB48 Curiosity Nano) and ATmega328PB-xmini. avrdude seems to work fine with ATmega328PB. But I will try the updated timing as mentioned by @stefanrueger
|
@stefanrueger I had a look at the ATmega406 datasheet, and its ATDF file (attached below) that I've pulled from the most recent Microchip ATmega pack. To my surprise, I couldn't find any delays as I could in other ATDF files. Perhaps the avrdude.conf file is correct after all? |
I'm not so sure about yoir interpretation. I read it as one table describing the delays to expect when using the polled algorithm, while the other one describes the minimal time you have to wait when not polling. |
You are not wrong, but do we want the programmers to sleep 0 µs for that chip where other chips require O(10 ms)? I would argue it makes sense to put some typical values in just to be on the safe side
If it was expect to wait rather than min wait then I still think that the table captions are wrong: The page before the table says trice must wait at least. Technically tWD_ERASE is not mentioned in the text once, so in programming parlance a variable that is set but not used :), but other Atmel MCU data sheets that I read have WD_xxx as min delay. (I had verified in a couple of them with a text search for WD_ in the pdf.). Another fun fact: Both tables have captions saying typical delay. Only one table has a column heading with minimum delay. So, shoddy writing on part of Atmel/Microchip. |
I will label this as |
@MCUdude You are right re the ATmega406: according to the data sheet it has JTAG programming, but no SPI programming, and therefore no tWD_... delays; looks like neither I am guessing AVRDUDE does not need to know delays for JTAG programming as delegated to the (physical) programmer. |
Just tried the partdesc branch from @stefanrueger under Linux (Ubuntu 20.04) since it does not work for Windows.
|
The following may still be wrong, right?
|
Nope, it's correct. See @stefanrueger answer below. The ATmega406 doesn't have an ISP interface, only JTAG.
I am guessing AVRDUDE does not need to know delays for JTAG programming as delegated to the (physical) programmer. |
I see. Thanks for the explanation. |
While designing a PCB with the ATmeg328PB I noticed that some timings are different from ATmega328P's, eg, chip erase delay is 10.5 ms, not 9 ms.
avrdude.conf
does not reflect that. Also noticed that chip erase delay misses for theATmega406
(along possibly other timings).Not sure these things are still relevant today for some programmers (as they could as well poll to establish the operation is finished).
In my experience, errors are more likely to happen in sections of a project that already have seen a few errors, so if these timings are relevant in
avrdude.conf
it's probably a good idea to review other parameters and parts, too.The text was updated successfully, but these errors were encountered: