-
Notifications
You must be signed in to change notification settings - Fork 196
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
add support for ATtiny26, ATmega640, ATmega128x and ATmega256x #284
Conversation
This broke the test |
Ah, yes... apologies - done! |
@@ -122,6 +131,7 @@ async def load_program_memory_page(self, address, data): | |||
data) | |||
|
|||
async def write_program_memory_page(self, address): | |||
await self.load_extended_address_byte(address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: you've verified that this should happen for all devices, and won't lead to issues on those which do not use extended addressing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not actually tried it on all devices, but I have confirmed that according to the datasheet, devices like the ATTiny24 and ATMega168 support this instruction.
I have tested this against an ATMega328p, and I think I could dig out an ATTiny24 (possibly also 85) to try / confirm too if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be nice if you can!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ATtiny85 was fine.
I couldn't find an ATtiny24, but did find an ATtiny26, which A) doesn't support this instruction, and B) needs another fix... push incoming
…8x and ATmega256x
I've reworked this PR somewhat... Extended AddressingFor all devices upto and including 128k, we don't need to use the extended addressing... the natural reach of the base addressing is Unfortunately, for the larger parts, it seems that we need to use the "Load Extended Address" instruction, even for the lower pages... I don't quite understand why, but without it the higher pages don't write properly - so we can't just omit it until we cross into the higher pages. All the parts that I've looked at (including ATtiny85) are documented as supporting this instruction, except the ATtiny26 - there may of course be others. If it would be preferred, then I can add a flag to the database, but I don't believe it's necessary. "Poll RDY/#BSY" InstructionI managed to dig out an ATtiny26, which appears to have an older/reduced version of the protocol. It doesn't claim support for the extended addressing, and it also doesn't support the "Poll RDY/#BSY" Instruction... I've added an TestingThis PR has now been tested successfully on the following devices:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for this wonderful PR!
This patchset adds support for programming ATMega640, ATMega128x and ATMega256x parts
range()
for verification - the chunks appear to be broken into 64K pieces, which may have been masked on parts with smaller memories.The "Load Extended Address" instruction is present in the datasheet for the 328p, and I have confirmed that it doesn't have any adverse side-effects when receiving it... I can't make that claim for other parts, but could probably dig out a couple of other parts...
This has been tested against a 328p, and a 2560.