1

I'm using a Digispark, which is basically an attiny85 packaged with a few other things, as an ISP to program attiny85's. The Digispark is loaded with Littlewire and recognized as an USBtinySPI device on the computer. The target attiny85 to be programmed is stacked on top of the Digispark. All pins are connected 1-to-1, 2-to-2, etc. Programming is done from the Arduino IDE. The tutorial I followed can be found here...

http://digistump.com/wiki/digispark/tutorials/programming

The Digispark uses port 3 (USB-) and port 4 (USB+) to communicate with the computer. There are series resistors and shunt zener diodes on both USB connections. The Digispark schematic can be seen here...

https://s3.amazonaws.com/digispark/DigisparkSchematicFinal.pdf

I have been happily programming attiny85's with this setup, but recently hit a snag. On the target chip, if port 3 or 4 produce an output, the computer will no longer recognize the programmer. The computer will immediately connect to the programmer once the target chip is removed from it's socket. The target chip must be messing up communication between the computer and the programmer.

Curious if I was missing something, I compared my setup with Sparkfun's Tiny AVR Programmer. It seems like a more robust programmer. I thought it might have extra components or something, but it's almost identical. It uses an attiny84 with pins directly connected to an attiny85.

After lots of random guesses, I added series 2.2kohm resistors on ports 3 and 4 between the target attiny85 and the programmer. This solves the problem, but seems like a workaround.

Am I missing something? It seems like a programmer should be able to work without worrying about what the pins on the target device are doing. I assumed poorly, that was the purpose behind the RESET pin. Is there a better solution?

1

With the Tiny AVR programmer, the D+ and D- lines are connected to there own input pins on the ATtiny84, see below:

enter image description here

This means that the pins from the target chip do not interfere with the function of these.

Whereas the digistump board has the outputs of the USB connected to pin 3 and 4, these pins are also connected to pin 3 and 4 of the target, as you know,

enter image description here

This means that as soon as you have your outputs active on 3 and 4 these interrupt the function of the USB lines.

By adding the 2.2k you are increasing the resistance before the Zener regulator circuit(thus decreasing the effect of the voltage from the target on these lines) and allowing the main tiny to have 'control' over the bus lines.

This is actual done on the SPI buses as well when a ISP is programming a target, while the target has other SPI chips on the bus, you add series resistors on the SPI bus, as seen below:

enter image description here

The R is usually between 1k - 4k7ohm. So you method is not a workaround, but normal procedure.

Another method to use instead of the resistor would be to cut the traces on the target board for pins 3 and 4, thus preventing it from going back onto the USB line. This is as I see no need to have control over the USB lines from the target.

Am I missing something? It seems like a programmer should be able to work without worrying about what the pins on the target device are doing. I assumed poorly, that was the purpose behind the RESET pin. Is there a better solution?

The programmer only toggles reset when programming, and once the target is flashed with your firmware that uses the same lines as USB and the PC then does not recognize the programmer because of this, the programmer won't be able to issue a RESET to the target, as

  1. the PC can't issue it,
  2. the programmer won't know to do that on its own.
  • I like your idea of just cutting the traces or adding jumpers. The target chip only needs MOSI, MISO, SCK, and RESET, correct? So, ports 3 & 4 aren't even needed. – curtis May 5 '15 at 17:57
  • @curtis - yes only those four(MOSI, MISO, SCK, RST) are used the other two aren't, it would be nice to have the others if one ever wanted, I was thinking of solder jumpers( cut trace, expose a bit of copper on each), that would be possible if there is space as I don't think a standard jumper would fit. – RSM May 5 '15 at 18:21
  • The target board/socket is connected to the digispark with stackable headers, like an arduino. I'll probably just bend the male pins out that I don't want connected. Sweet, this has been bugging me and it makes sense now. I'd upvote your answer, but can't with only 3 rep. – curtis May 5 '15 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.