Programming ATMega8 Orangutan with AVRISP mkII

Variations on a theme. Has anyone been able to program one of the older Orangutans (the ones based on the ATMega8) with the new USB AVRISP mkII programmer? I’m trying to re-purpose an Orangutan at work that I last used over a year ago, but I had to get one of the new programmers.

First off, I had to swap out the Orangutan’s reset pin pull-up resistor (1k) for a 10k just to pass the mkII’s reset pin test. Does anyone have a copy of the original Orangutan quick-start PDF? The current one shows a 10k reset line pull-up resistor already.

Anyway, now the mkII will light up green and happy when I connect it to the Orangutan, but when I try to program it (at any speed) I get a variety of error messages, either that the connector is backwards (it’s not) or that there is a short between MISO and SCK, or MISO and VCC. Unplugging the programmer and checking the pins with a volt-meter these shorts are real, but only happen after I try to program the Mega8. When I cycle power they disappear. What’s going on?!? These errors cycle randomly when I try to program without changing any settings. The mkII user guide specifically says it supports the Mega8!

I know my mkII works, because I have been able to program an ATMega168 Baby Orangutan just fine. I was able to borrow a serial AVRISP, and I can still program my Mega8 Orangutan with it, but the Mega8-O and the mkII just don’t seem to want to work together. Any thoughts?


I just dug up my original Mega8 Orangutan quickstart sheet, and it shows a 10K pull up resistor on the reset line. Actually it doesn’t look like anything has changed but the processor.

I have the resistor I took off the reset line, and it measures 1.00Kohm on my multimeter. It’s a black body with the number “102” on it. Stranger and stranger.


I have the same problem with an older ATmega8 Orangutan, but I can still program it with the old serial port AVRISP.

I checked the pullup resistor on the reset line, and indeed, it is 1K, not 10K as the 2005 quick_start datasheet states–certainly less than the minimum allowed 4.7K. On the newer mega168 Orangutan, the pullup is 10K as advertised.

If replacing the pullup doesn’t fix it, something else must be different on the boards. Possibly something with the LCD and grounding resistors on PB3,4,5?


With the exception of the reset pull-up resistor, the rest of the components match both the old and current spec sheets (well, except for the AVR). Actually there is an extra component, I think it’s a diode, in reverse bias between regulated 5V and ground.

Just to check, has anyone had luck programming an ATMega168 Orangutan with the AVRISP mkII?

I’ve had good luck programming both the ATMega168 Orangutan and Baby-Orangutan using an AVRISP mkII.

Only real kickers I ran into were:

Make sure the compiler, the simulator, and the AVRISP mkII all know you’re programming an ATMega168. (I’ve run into this too many times.

Make sure you have reasonable voltage levels for the device you’re using. (Only tripped me up when I went from a 168-based Orangutan to an AVR Butterfly and back.)

Make sure you have a reasonable transfer rate. I have mine set to 1MHz. This works to program an Orangutan (8MHz) a Baby-O (20MHz) and an AVR Butterfly.

Make sure the code you think you’re loading really is the code you’re loading. Just because you load a new project in AVR Studio 4 doesn’t mean the AVRISP mkII knows you’ve switched to a new .hex file. You have to go in and set which .hex file you want to load.

Make sure your device is powered up! Can’t program a device that’s powered off.

Given these caveats, I’ve had good results using the AVRISP mkII on all three devices.



The 1k pull-up on reset was a manufacturing mistake on some of the early Orangutans; we didn’t catch it because the boards worked with the AVRISP. If you have such a unit, we can replace the resistor for you if you would like.

We’ve been testing all of the m168 Orangutans with an AVRISP mkII without any problems. However, the new LCD used on those units (black bezel) tends to drive the programming lines, so we had to add the pull down resistor on the R/W line. It’s possible that doing a similar thing on the old mega8 version with the silver-bezel LCD will help.

If anyone does have a mega8 unit that doesn’t work with the AVRISP 2, please contact us, and we can fix it or replace it for you.

- Jan

I have the latest AVR Studio service pack, and a proven Mega8 Orangutan program that I’m making little changes to as I go (different beeps, led flashes, just something to let me know that the O was reprogrammed, not just reset). I also have AVRISP marks I and II hooked up on my desk.

I compile my code, plug the serial programmer into the orangutan, power on the orangutan, connect to the serial programmer with AVR Studio, check target device and speed settings, check that I can read the fuses. The hex file path hasn’t changed so I hit program, and it works every time.

I power down the O, unplug it from the serial programmer, plug it into the USB programmer. Power it back up. It starts up twice as the USB programmer runs a reset test. Originally the programmer wouldn’t accept the O, but now that I put a real 10K pull-up resistor on the reset pin they get along just fine, and I see two green lights.

I make a small change to my source code, recompile, and connect to the USB programmer. I check the target device and speed settings (I have tried every possible speed, but right now it’s down at 250kHz). An hour ago when I did this I couldn’t read anything back from the O (fuse states, signature bytes, etc). I have since removed R15-17, the pull-down resistors on PB3-5, and I can now read fuse states and the signature bytes (which match the selected device) and even copy the whole hex file back. When I try to program it now, the program actually gets through! Yay! I do get the following warning:

[quote]Warning: FLASH byte address 0x01f2 is 0x3f (should be 0x38)

There seems to be a short circuit on the ISP connector. The MOSI and SCK lines appear to be short circuited. The operation will be aborted.[/quote]

Well, the program runs, and I can verify and copy back the hex file, but the front buttons are now useless (I did save the resistors) and the error kind of bugs me. I may pull the LCD off tomorrow just for kicks. Any thoughts on why this is happening or a better workaround?


I feel sort of special having one of the “early” Orangutans. I put back R15-R17, and added a 10K resistor between pins 1 and 5 of the LCD and, well, the results speak for themselves:

Thanks a bunch! This Orangutan will continue to serve me well at work, and now I’m even more excited about getting one of the new Mega168 O’s for myself.

Is there maybe a more elegant place on the board I could put a surface-mount 10K?


To answer your question above, there is a sneaky mod on the O-168 board. Note the 4.7K pulldown between pins 5&7 on the LCD header, as shown below.

I believe that I will take Jan up on his kind offer to fix my beloved older O! It is a pain to switch programmers, because AVRStudio4 wants to update the firmware on my serial AVRISP, and it fails every time.

Cheers, Jim