In a recent ATiny project I have been working on, I find the need to use all 6 IO Pins.
For those that are familiar with the Tiny devices, you know that it only has 5 usable IO Pins.
On a device with only 6 Pins, loosing a Pin HUGE blunder by the designer!!!! (Ok, no more rants).
Sure, there are ways around this albatross, but I didn't like any of them, as they added limitations.
- Use a high voltage programmer. Problem : Requires special hardware and PC software to use.
- Use one of the many BootLoaders. Problem : Same problem as the last workaround.
- Make a Fuse Rescuer. Problem : Requires special hardware, and moving the chip back and forth every time.
I wanted to be able to program and flash the Tiny directly in Studio, and only use my AVRISP, so I came up with a solution...
Self Replicating Boot UnLoader, AKA... Quark Loader!
Strange name, but suitable since this solution isn't technically a Boot Loader as per the usual suspects.
In Quark Load, you are able to program, assemble, and flash without ever leaving Studio.
To the programmer and IDE, nothing seems different, but the result is all IO Pins usable on the Target ATiny.
Normally, the Rest Pin is dedicated to the ISP, so it can only be used as a limited input, but Quark Loader fixes this.
Here are some shots of the hardware, which is basically a "Magic Plug" that fits between your AVRISP and breadboard....
Quark Loader - Concept and required components.
No doubt, the above photos gives away the solution.
The ATiny marked TX intercepts programming from the AVRISP, and then forwards it to the ATiny marked RX.
An ultra small bit of code that is woven into the main program looks for a signal and then transfers the entire Flash Memory.
This is why I call it a "Self Replicating Boot UnLoader".... it unloads its entire flash to the target, esentially cloning itself.
This process happens automatically right after an ISP programming cycle, so to the user, nothing is any different.
Since the RX (Target) ATiny has the RSTDISBL fuse set, it is free to use the normally locked IO Pin.
Quark Loader - Poor Man's PCB.
This project was just a quick hack to get around the stupid limitation of the reset Pin, so it ain't pretty!
I will probably use this thing a lot on ATiny projects, so it deserved at least this much refinement.
Quark Loader - Completed Hardware ready to use.
Since I am using the ATiny-85, this makes the unit backward compatible with some restrictions.
You could program an ATiny-45 for instance, but have to make an adjustment to the INC file to properly report memory sizes.
I made this thing as a solution to an IO Pin problem in my current Quark-85 VGA Project, but it may find a use in other projects.
The ATiny85 on the left has been Liberated, and now has 6 IO Pins!
So the result is that I can now add sound to this project I have been working on... https://www.avrfreaks.net/forum/quark-85-demo-kube-184-x-240-vga-8-colors-tiny85
The locked Reset Pin is now going to become an output for the Sound Generator.
I can continue to program in AS7, using my AVRISP as normal. No strange HV programmer or Boot Loaders requiring one of those Adruiondinno thingys!
Since the code for this beast is interwoven in my Video Engine, I will release it when that project is published.