I have attached a scope capture that shows the situation with the ATtiny13A.
Yellow=RESET
Green=Vcc (highly expanded scale)
Blue=SDO (serial data out from the target)
Magenta=SCI (ignore for now)
The issue seems to be the fairly lazy way that RESET makes its way from 0 to 12V. For whatever reason, the slow rising edge of RESET, coupled with the zero startup timer fuse setting (LFUSE=0x62) is causing the 13A to either never properly enter or drop out of HVSP mode by the time I am able to read fuses.
Interesting, this issue affects more than just LFUSE=0x62 on the 13A, and it affects more than the 13A as well. Every part I have tested (ATtiny85, 13A, 2313, ATmega168) experiences the same issue if the fuses are configured for a (14CK + 0ms) startup timer and a fast (greater than 128KHz at least) internal clock. On the 13A, LFUSE=0x61 and 0x62 seem to cause the problem, other fuses I have tested don't.
This is a problem.
I have always known that the DC-DC converter ramps up fairly slowly, and until now this has never been an issue. Risetime is a tradeoff with ripple on the 12V supply, and since I had never seen an issue, I designed the supply for minimum ripple and what I considered to be a "reasonable" risetime, since having a fast edge didn't seem to matter. In fact, Atmel doesn't spec a risetime or any other timing requirements on RESET that I can find in any of the datasheets I have looked at. I have submitted a support request to see if they will give me a recommendation or spec on what the risetime is supposed to be.
Based on my testing this week, I can safely say that all Rescue Shields that I have made to date, including both version 1 and 2, suffer from this issue, and apparently after almost 2 years you are the lucky one to uncover it.
So what do we do now?
The options at this point seem to be:
1. Modify the VCC/RESET sequencing in the Arduino sketch so that when VCC goes high, RESET is already somewhere in the middle of it's rise to 12V. This is definitely a hack, but it seems to work for the ATtiny13A at least. I have not tried it on any of the other parts.
2. Rework DC-DC converter design to "speed it up" at the expense of ripple in the output voltage. There are a couple ways to do this, both with and without changing the layout of the PCB. Unfortunately, the ways that require PCB changes seem to give better results.
3. Keep existing DC-DC and add a passgate or switch external to the DC-DC that would switch the RESET signal very quickly. This will give the fastest edge but would definitely require a PCB respin.
While I'm waiting to hear back from Atmel I am continuing to test various solutions and workarounds. I'll keep you posted with my progress. I'm away from the lab over the next week, so what I don't finish by tomorrow evening will have to wait until I get back on 12/30.
You can test solution 1 yourself pretty easily by changing this part of the code:
Code: Select all
// Enter programming mode
digitalWrite(VCC, HIGH); // Apply VCC to start programming process
delayMicroseconds(100);
digitalWrite(RST, HIGH); // Apply 12V to !RESET thru level shifter
to this:
Code: Select all
// Enter programming mode
digitalWrite(RST, HIGH); // Apply 12V to !RESET thru level shifter
delayMicroseconds(60); // May need to play with this value to get consistent results
digitalWrite(VCC, HIGH); // Apply VCC to start programming process