AVR Programming Board Semi-Fail

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

AVR Programming Board Semi-Fail

Post by marke3 »

I'm enjoying using the USBtinyISP and learning more about how the insides of the AVRs work. I thought it would be handy to build a board to program the two kinds of MCUs I play with - Attiny and ATmega. I guessed I could share the SPI lines, reset and GND and just switch VCC between the two. I put in indicator LEDs on each side of the SPDT switch so I could check which one had power. Works brilliantly and I somehow got all the soldering right. AVRDUDE happily loaded my first "blink" test program onto a ATmega168 and an LED connected to PB0 blinked as advertised.
Picture 8.jpg
Picture 8.jpg (68.88 KiB) Viewed 1248 times
Then I did the same on the ATtiny13 and away the LED went as expected. BUT so did the power indicator on the other board. When I attempt to blink an LED on any one of the SPI pins of either chip, the power indicator LED on the other (switched off) side flashes in unison with it. I couldn't find any shorts, so I breadboarded the circuit to help understand the problem but the same happens.
Picture 9.jpg
Picture 9.jpg (90.92 KiB) Viewed 1248 times
Any thoughts on what might be going on?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: AVR Programming Board Semi-Fail

Post by adafruit_support_rick »

Is it that lighting the LED causes the power indicator LED to turn off?
Are you using a current-limiting resistor on the LED?

User avatar
marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: AVR Programming Board Semi-Fail

Post by marke3 »

The blue power indicator LED lights up at the same time as the blinked green LED. In the second photo, the breadboard is switched to the ATmega168 and the program is blinking the green LED connected to the SCK pin (white wires). All the LEDs have resisters soldered along one pin.

As the SCK pins are wire together to use the common programming header, it seems when the 168 pin is pulled high, current then passes into the AtTiny and out it's VCC pin and lights the blue indicator lamp to the left.

User avatar
marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: AVR Programming Board Semi-Fail

Post by marke3 »

I just pulled the ATTiny out of the breadboard and gave it 5v at each pin and measured the VCC pin. All I/O pins gave me 4.25v except PB5 - the reset pin - it gave me 2.5v. I guess I just expected the unpowered AVR not to conduct at all, but it does.

I'll try to remember never to assume, right?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: AVR Programming Board Semi-Fail

Post by adafruit_support_rick »

marke3 wrote:I'll try to remember never to assume, right?
I do it all the time!

User avatar
marke3
 
Posts: 205
Joined: Sat Feb 08, 2014 5:24 pm

Re: AVR Programming Board Semi-Fail

Post by marke3 »

... which is how we learn. So I learnt that diodes are useful.
Picture 10.jpg
Picture 10.jpg (287.62 KiB) Viewed 1183 times
A couple of 1N4001's in line with the VCC and it works perfectly.

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”