PGM02B USB Programmer - To Breadboard

This is odd… I connect to my 3pi robot and all is well.

I put an AT Tiny 13 or an AT MEGA 88P into a breadboard and connect… RED LED continues to blink as if it’s not connected. I’ve been playing with AVR chips over 10 years… all types… so I know how to connect and program them. If I use the old parallel cable I built it works fine. (Trying to use this laptop which only has USB ports.)

… and the 3pi works fine with the USB…

I installed a 7805 voltage regulator with a 9v battery… for a good power indication on the yellow LED I installed on the breadboard… no smoke. I have a pull-up resistor on the RESET pin to VCC (5v). It’s a 470K because I’m out of 10K… yeah I know… got to the store… but still that shouldn’t effect it. (It should work even without one… there is no other connection.)

Here are all the details…

Did I miss something??? :confused:


Hi Jerry.

The blinking red LED means that the programmer is not detecting target power, and it will not let you program an unpowered device because this could corrupt the AVR’s fuses and make the MCU unresponsive (note that the programmer does not deliver power to the target; the target must be powered from another source for the programmer to work). The programmer does not validate any of the other connections, so all I can say right now is that you have an issue with your power connections. If you remove the AVR from the equation and just connect pin 2 to VCC (5 V) and pin 6 to GND (0 V), does the red LED stop blinking? Pin 1 is the red ribbon cable conductor and is marked on the cable connector by a triangle.

- Ben

All my stuff is in storage… so I don’t have my regulated supply, etc… didn’t even have a voltmeter. Went to the store and found an El Cheapo voltmeter. Okay great… took a voltage reading and got something like 1 volt. :open_mouth:

I looked at the circuit… all looked okay… no wire problems… but short story…

Last week I went to Fry’s Electronics and told the salesman I needed a 7805, +5vdc voltage regulator… picked up two… he gave me NTE part number NTE961. I didn’t think much of it… until tonight… I typed it into the online cross reference…

NEGATIVE 5 volt regulator!!! GRRRRRRR! :angry:

Okay so tomorrow I’ll go to Radio Shack and hope they still have a few parts (remember when they had a whole wall of IC’s?)… or I’ll order one from Mouser… and I’m betting it will work just fine after that. Next time I go to Fry’s there is going to be an unhappy salesman… grrr. :angry:

Thanks for the help though…

I’ll post my findings after I get the RIGHT part. (And I installed a 10K resistor to RESET just to be safe.)

Yikes. -5V is definitely out of spec for your AVR and the programmer, so hopefully they’re both still functional!

- Ben

Yes… because it was a negative source it acted like a big diode/resistor or something.

Anyway… I installed a new regulator and got 4.98vdc (close enough!)

This time the programmer acknowledged the chip but I still could not identify it… still works fine on the 3PI. So now I’m thinking that the chip needs an external clock source… normally i would connect up a frequency generator via a resistor, read the chip and change the fusebits to INTERNAL OSC… then roll. But… no function generator… it’s 900 miles away in storage. :confused:

So… I’ll likely program some pin on the 3pi to just sit there and toggle… then feed it to the IC via a 1K resistor. Or… I’ll order some ceramic resonators from Mouser.

I’ll keep you posted.


The AVR’s default fuse settings have it using the internal RC oscillator; does this MCU not have the default fuse settings? Hopefully it will work with an external clock source, but note that it also could have been damaged by the negative voltage.

- Ben

I’m not sure why it will not read the chip.

  1. Stripped the breadboard to only the 7805 regulator, support diode, indicator LED, resistor for LED, capacitor across VCC/GND.

  2. Verified +4.98vdc on power rails, red=+ blue=-

  3. Installed a NEW AT Tiny-13 10PU (Internal OSC type chip, 10MHz)

  4. Inserted color coded solid core 22ga as follows into programmer cable.
    (1) - Yel(a) MISO
    (2) - Red VCC
    (3) - Wht SCLK
    (4) - Yel(b) MOSI
    (5) - Grn RESET
    (6) - Blk GND

  5. Connected as follows to chip

(5) 1—U---8 (2)
() 2--------7 (3)
) 3--------6 (1a)
(6) 4--------5 (4b)

  1. Connected IC-4 to GND on breadboard

  2. Connected IC-8 to VCC on breadboard

  3. Applied 9VDC to 7805, got 5v, programmer stopped blinking.

  4. Told BASCOM to identify chip…

STK500 Compatible Program Set
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500v2_cmd(): failed to read signature
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500_2_ReceivMessage(): timeout
stk500v2_disable(): failed to leave programming mode, got 0x01

Programmed 3pi with BASCOM as follows…

Cls Lcd "OSC Mode" Config Portd = Output Begin: Toggle Portd.0 Waitms 1 Goto Begin

So now it sits there running an output… I turned the 3pi into a function generator / OSC… connected 3pi ground to breadboard ground via expansion connector. Connected 3pi Portd.0 to 1K resistor to AT TINY-13 clock input (pin 2) so that it is being driven by an external clock… again using expansion connector… verified output pulses.

Tried process again… no change.

Did I miss something?

My next step is to build a parallel programmer and try it with my other laptop… I have no clue why the programmer will program the 3pi and not the AT TINY 13 or the MEGA 88… it’s just weird.

And… I tried swapping MOSI and MISO but that didn’t do it either… I’m certain I have it wired correctly.

One thing I should point out is that the Orangutan USB programmer was designed to be a programmer for our Orangutan robot controllers and 3pi robot; we do not explicitly support using it with other AVRs like we do with our newer Pololu USB AVR programmer. That said, I would expect it to work on the ATmega88, and we have used successfully with other AVRs (including the ATtiny2313, I believe).

Where is your indicator LED connected and how are you connecting the support diode?

- Ben

The circuit is pretty straightforward…

A simple 5 volt supply and a chip connected to the programmer via jumpers. The only thing I noticed different in the 3pi schematic was that it had a .1uF capacitor between reset and ground. I’m wondering if that would make a difference? As I said… I tried it with nothing connected to the Tiny-13 Pin-2 (CLCKI) and again with the output of the 3pi via a resistor to clock the pin.

I’ll get a .1uF cap and a 10MHz ceramic resonator (ZTT-10.00MG) on order… but I have never had this much trouble getting a chip to program.

If you see something I missed, please let me know… I’ve programmed thousands of AVRs using a simple parallel programmer… hand built at least 100 of them for school kids… 4 (150 ohm) resistors, 1 (0.0022uF) cap, a D-sub (25) connector and a back-shell.

They all worked fine.

I really want to continue programming but use my new laptop. (No parallel port)


One thing to check is the ISP frequency that the programmer is using. The ISP frequency must be less than 1/4 of the target clock frequency, which would be 1.25 MHz / 4 = 312.5 kHz (since the default fuse settings have the divide-by-8 clock bit set). The programmer can support higher ISP frequencies than this, and these higher frequencies will not work on your ATtiny until you disable the divide-by-8 fuse.

Other than that, I’m out of ideas. It would be good for you to try it using something other than BASCOM; can you see if it works with AVRDUDE or AVR Studio?

- Ben

  1. I went to AVR Studio 4, connected to the 3pi (Mega 168 internally) and told it to “Auto Connect”…It connected.

2 )I set the chip type to an incorrect type to simulate what would happen if I had made a simple error and clicked “Read Signature” … it connected and reported back that the chip type was wrong. This proved it could read and identify at least if it was not an exact match.

  1. I set the chip type to Mega168… clicked “Read Signature”… it reported “Signature matches Device

So we know basic communications and functionality with the software, programmer, and known unit are good… we should be able to identify a chip if nothing else.

  1. I connected the programmer to the Tiny-13, and added a diode between the VCC and programmer VCC so the programmer can detect 5v but not supply it in case that was causing some voltage issue, installed a 0.1uF capacitor between RESET and ground the way the 3pi has in it’s schematic. The programmer frequency is currently set at 115.2 KHz which should be fine even at 1 MHz… this is a 10 MHz Tiny-13 chip.

  2. Set chip type to Tiny-13 on the programmer and click “Read Signature”…

Got message:A problem occurred when executing the command. Make sure that you are using the correct programming method. The current mode is ISP. See the command output for more info.

When I connected I got the following log entries…

Detecting on 'Auto'...
AVRISP with V2 firmware found on COM3:
Getting revisions.. HW: 0xff, SW Major: 0x02, SW Minor: 0x0a .. OK
Getting isp parameter.. SD=0x02 .. OK

After the read signature attempt I got…

Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. FAILED!

Not sure what is going on. I’ll recheck all my connections… and I’ll put together a parallel port programmer to see if I can read/program with that. This is just weird. I may need to purchase a Mega-168 just to see if that works… if so… then it’s a chip issue. If that doesn’t work… then it really becomes a head scratcher.

I should have mentioned in my previous post that the ISP frequencies listed in AVR Studio assume you are using a programmer from Atmel; those frequencies are not correct for the Orangutan USB programmer. Section 5.b of the user’s guide explains how the frequencies listed in AVR Studio correspond to actual ISP frequencies. If AVR Studio says your programmer is at 115.2 kHz, it is really at 625 kHz, which is too fast for your 1.25 MHz ATtiny. Once you disable the divide-by-8 fuse you can program it at this ISP frequency.

Try lowering the programmer frequency to what AVR Studio lists as 57.6 kHz, which is actually 156 kHz. I expect things will work once you do this.

- Ben


That did it.

BASCOM still failed… but when I looked closer there is a check box in the programmer section to disable writing of the ISP frequency. BASCOM just doesn’t go low enough… the lowest it has is 125000

  1. Go to AVR Studio and set the frequency to 57.60 KHz
  2. Exit AVR Studio
  3. Go to BASCOM and under PROGRAMMER be sure the check box IS checked.

Once that is set up… I had no problems reading / writing / changing fuse bits. Now I can concentrate on adding a Mega 88P to the upper deck of my 3pi and building a micro robot arm.

I really appreciate all your help.


That’s great that it’s working now. I’m sorry I didn’t think of the ISP frequency sooner and save you some of this prolonged troubleshooting!

- Ben

That’s okay… this way there is a detailed trail for anyone else having this issue.

I went to the robot group meeting last night and showed off how to program the two chips. I have some kids interested now in building robots… so that’s a good thing.