I am designing a solar spinner which requires a small processor with four digital I/O pins that are configured as outputs. These pins will be used to drive a dual H-bridge which will in turn drive a stepper motor. The ATTiny10 appears to be an ideal choice for this application because it is a low-cost device with 4 GPIOs and all the features I need.
However, there appears to be an issue when I want to reprogram the ATTiny10 because programming requires driving reset pin PB3. In order to configure PB3 as an output, one must blow the RSTDSBL fuse, which ordinarily prevents the chip from being reprogrammed except when a 12V signal applied to reset pin PB3 which, as already noted, is an output. In any event, I had hoped I could solve this with 12V programming but now I am not so sure because I seem to get unpredictable results when I try to reprogram chips that configured PB3 as an output. Indeed, if PB3 is an output, then 12V programming would seem to require yanking that output pin to 12V. But the datasheet indicates that the maximum reset current should be less than 2mA--something quite a bit less than enough to actually reach the 11.5 to 12.5 volts required by the datasheet. Sort of a chicken and egg situation.
Does this mean one cannot actually reprogram an ATTiny10 once PB3 has been configured as an output? My programmer uses a 2N2222 in common emitter mode with a 6.8k collector resistor to provide the 12V reset drive signal. I could change the collector resistor to a smaller value so it would drive PB3 harder than 2mA, but I have no idea how much harder I would need, or if this strategy would even work at all.
Any guidance or insight you can provide would be greatly appreciated.
For the ATtiny13A I've used a high voltage fuse resetter, based on a regular Arduino and a boost converter set at 12V, wired to reset and a transistor. I can't remember exactly which sketch I used, but just followed something I found online. Just do a search with term " fuse resetter" and you'll surely find something.
With regards to using a small and low cost processor: have you considered using the CH32V003? Some time ago I bought a bunch of the SOP8 model for about 10 eurocent each. Cheap enough to lose some when shorting pins during my experiments. I know the ATtiny10 has a smaller footprint, but the V003 has some nice features that the ATtiny doesn't have.
Thanks for getting back to me. On the surface of things the ATTiny10 would be hard to beat--especially since I laid out a board using it. I am trying to make a direct-drive solar spinner for yard art. At 40mA per I/O pin, it might be able to drive some stepper motors directly; certainly with an H-bridge. Consider the following stupidly simple program:
/*
Plug in ATtiny10 and connect programmer. Enable Serial Monitor
Are you trying to program it while PB3 is actually connected to something? That could be a problem...
I built a successful HV programmer (for ATtiny28) where the 12V is connected to reset via a 1k resistor, and it draws minimal current, so I'm surprised that your tiny10 seems to be drawing more than 2mA.
AFAIK, the TPI chips can be programmed with a steady 12v to hold them in "HV Reset/programmable" state.
I can confirm that by connecting a 12V to the RST pin your Attiny10 can be programmed again and/or you can set the fuses. As long as the 12V is applied it will stay in TPI programming mode regardless of the setting of RSTDISBL.
After more investigation, I too can verify I can reprogram an ATTiny10 using my setup, sometimes. The issue seems to be that 12V needs to be applied BEFORE a previously programmed chip fully comes out of reset because, if the ATTiny10 fully resets and then begins running the old stored program that ultimately turns the reset pin into an output pin, then that pin will suddenly become capable of driving 40mA or more, at which time the 6.8k collector will have no chance of asserting RESET anymore.