-
Design progress
06/24/2020 at 22:55 • 0 commentsI was able to hack the prototype to insert an N MOSFET between the two Ps and now the behavior of the HV !RESET jumper is correct. It's effectively floating normally, and then has 12 volts switched onto it when the incoming !RESET line is pulled low.
I've also validated that it actually works properly with a real device. I've turned the RSTDSBL fuse on and off several times in a row, verifying that programming doesn't work with the fuse on and the adapter's jumper in the NORM position.
So the boards I've already ordered from OSHPark will work correctly.
For my own part, I intend to just leave the jumper on HV permanently. This does behove you to insure you don't attach the programmer backwards - that would impose 12 volts on Vcc for the duration of the programming attempt, though ground would be hooked to TPID, so that may not be completely tragic.
As soon as I build the next board, this will be added to Tindie.
-
linuxspi support too!
06/23/2020 at 06:42 • 0 commentsI made a mashup of the USBTinyISP TPI patch and the linuxspi driver for avrdude. So now linuxspi can do TPI stuff as well now.
This integrates perfectly with my Raspberry Pi AVR ISP cap, which does level shifting and target power insertion for the Raspberry Pi to act as an AVR ISP programmer. But with the hack on linuxspi and this adapter, it can now do TPI programming as well!
-
Patching AVRdude
06/23/2020 at 04:49 • 0 commentsThe patch for avrdude to add TPI support to the USBTiny was posted to the AVRdude mailing list a few years ago here. That patch is what's in the files section here. It doesn't apply cleanly to avrdude 6.3, but the one .rej file is pretty easy to just do by hand (it's inserting an include for tpi.h into usbtiny.c).
It turns out that's not the only issue.
A chip erase won't reset the fuses in the config section. To do that, you must perform a SECTION_ERASE operation on the config block before performing a write. There's code in avr.c to do this in the function avr_write_byte_default(), but it turns out that that function isn't called when you try to write the fuses on the tiny9. Instead, the method called is avr_write(). So that little block of code that checks whether you're writing the "fuse" memory section or not needs to be copied (and adapted slightly) into that other function.
I'll go fetch a clean source tree of 6.3 and make a new patch that incorporates both of these changes. With that done, you should be able to freely clear and set the RSTDSBL fuse and use the HV jumper position when it's cleared to engage TPI.
-
First build report
06/23/2020 at 00:08 • 0 commentsThe first build was an almost perfect success, but there is one error that must be corrected.
If you jumper the board for the "normal" !RESET line, it works perfectly. Merging MOSI onto TPID through a 330Ω resistor works just fine. Whether it still works on the AC Safety Timer board that has a significant impedance on TPID remains to be seen, but it's functional nonetheless.
The boost converter works correctly and does generate 12 volts from the incoming 5, but unfortunately, the switching circuit to shunt it onto !RESET just presents the 12 volts constantly. The issue is that I neglected the body diode in the "bottom" MOSFET (the one that sends 5 volts out when the ISP !RESET line is pulled low. The body diode will always see the 12 volt pull-up on the second MOSFET and conduct from that 12 volts down to 5, pulling the second gate low(er).
All that said, you can program a Tiny9 with the RSTDSBL fuse set to 0 with the programmer as it is now. You just have to plunge the pogo pin adapter onto the board and press RETURN on the avrdude command line relatively quickly.
The fix is to introduce an N channel MOSFET in-between. Unfortunately, there's no option to use just 2 MOSFETs for this switching arrangement. We need to detect a low input, which requires a P MOSFET, and we need to isolate that with another MOSFET that can detect the high output from that and bring the final MOSFET gate low. That's an N MOSFET. So there has to be 3.
But despite all that, the result ought to work just fine. Now I just have to wait for boards and then it can go into the Tindie store.