I dig deeply into programming algorithm of ATtiny2313 and it wasn't that hard. Basically, you need to pull the RST pin down (so the user code doesn't run) and enter command to invoke the programming mode. Then you can issue any other command - to read, erase or write FLASH. In fact, all commands are simple 4-byte SPI transactions.
For now I wrote simple programs to exercise the AVR ISP interface and enter programming mode
Here you can see succesfully returned "Enter programming mode" command; and the same thing on logic analyser
Notice the 0x53 on MISO line - it is alive!
Now I can read out the device ID, for example.
Great! Now I'm going to implement read, erase and write commands; then I can couple it with SD card read/write functions and FLASH programmer part of Pavapro should get closer to reality.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.