Failed to enter programming mode

There I was, programming away and just a few steps away from making the ultrasonic sensors work when all of the sudden, the board won’t program. I thought it might be the last example I integrated from someone so I took out that code and still have the problem. I went back to a previous version and still the board does not communicate. I checked wiring, checked voltage levels and everything seems fine. I shut down and restarted the computer and it hasn’t helped. I changed back to WINAVR and tried loading my sample from there that worked when I first started and it failed as well. I tried erasing the module and it won’t do that either.

I did the test to see if I communicate with the programmer and that part seems to check out.

What did I do to the board? And is there a way to recover?

Also, from all appearances the board is not running the code.

Hello.

In order for me to better understand what the problem is, there are a few questions I’d like to ask you:

  1. Specifically which product and programmer are you using? Is it a Baby Orangutan and Pololu USB programmer?
  2. Is there any chance that you tried to program your Orangutan while it was unpowered just before this happened?
  3. Can you tell me your programming setup (e.g. AVR Studio or avrdude?) and the exact error messages you’re getting? For example, if you’re using AVR Studio, do you get an error message when you first open the AVRISP programming dialog or do you only get the error when you attempt to enter programming mode?
  4. Have you tried the troubleshooting steps listed in the programmer’s user guide? Specifically, I recommend your first step be to lower your programmer’s ISP frequency to 4 KHz (you can do this using the “board” tab of the AVRISP dialog, assuming you’re able to use AVR Studio) and try reading the Orangutan’s device signature.

- Ben

  1. Specifically which product and programmer are you using? Is it a Baby Orangutan and Pololu USB programmer?
    Yes, the Or. Jr. and the Pololu USB Programmer
  2. Is there any chance that you tried to program your Orangutan while it was unpowered just before this happened?
    At the beginning of the evening I tried programming without power and knowing the note about unpowered programming I was afraid I may have screwed it up at that point but after that it was on the whole time and I had programmed it several times before the error occurred.
  3. Can you tell me your programming setup (e.g. AVR Studio or avrdude?) and the exact error messages you’re getting? For example, if you’re using AVR Studio, do you get an error message when you first open the AVRISP programming dialog or do you only get the error when you attempt to enter programming mode?
    I am using AVRStudio. (but the problem also exists using WINAVR) I click on the toolbar for AUTO connect and it connects to the programmer then I click on either start or the button next to auto in the toolbar and it indicates it cannot enter programming mode.
  4. Have you tried the troubleshooting steps listed in the programmer’s user guide? Specifically, I recommend your first step be to lower your programmer’s ISP frequency to 4 KHz (you can do this using the “board” tab of the AVRISP dialog, assuming you’re able to use AVR Studio) and try reading the Orangutan’s device signature. I looked at the help and tried doing the erase but it won’t erase. Instead it tells me it won’t enter programming mode. I have not tried changing the baud rate to 4 KHz. I will not be back until Wednesday but at that time I can give it a try…

You said that it doesn’t look like the board is running your code; at what point did it seem to stop running the code? Was it running your code after your last successful programming? When it first failed to program, did it fail instantly (e.g. did it give you the message “Entering programming mode…FAILED”) or did it fail in the middle of the programming (e.g. Entering programming mode…SUCCESS, Leaving programming mode…FAILED")? Lastly, did your program use any of the SPI (i.e. programming) pins as I/O lines? Is there any chance you could have burned one out by using it as an output and shorting it to something?

My suspicion is that somehow a fuse bit got flipped somewhere in a way that is currently disabling your Orangutan. This can sometimes happen if you program the Orangutan while it is unpowered, but it seems like it can also sometimes very rarely happen from out of the blue with AVRs. If the fuse that got changed resulted in lowering the AVR’s clock frequency, you should be able to connect to your Orangutan and fix the problem by lowering your programmer’s ISP frequency. If the problem is more complicated than that, we will probably need you to send the Baby Orangutan back to us for repair or free replacement.

- Ben

When it quit programming is really hard to say because I did not pay that much attention to the error message the first time it happened. It has happened before and I shut down my computer and rebooted and then everything worked fine. The code I was running has pins c0 and c1 hooked to a scorpion HX through the servo connectors. Pins C3,4 and 5 are hooked to the data line on the Parallax PING))). I have been successfully controlling those lines until the last code change. I basically copied in the following code but changed the B pins to C pins. I first ran it with mask set to 1 which didn’t do the job. I then changed it to 8 and after making that change I had the problem. Now, when I power up the controller, the polling of the sensors does not take place (they have leds indicating when active and the interrupts do not happen (I turn/off LED at D1) indicating to me the controller is not processing my code.

ISR(PCINT0_vect)
{
    unsigned char newPinB = PINB;    // get new state of port B pins
    unsigned char changedBits = pinB ^ newPinB;    // if pin has changed, the corresponding changedBits bit will be set
    pinB = newPinB;    // save the new state of the pins

    unsigned char i, mask = 1;
    for (i = 0; i < 8; i++)
    {
        if (changedBits & mask)
        {
            if (pinB & mask)
            {
                // handle pin PBi change from low to high
            }
            else
            {
                // handle pin PBi change from high to low
            }
        }
       mask <<= 1;
    }
}

I will assume what you say about the fuse has happened but I won’t be able to test it until Wednesday night at the earliest because I am on the road. I will post my results then.

Thanks for your support.

Joe

Did you remember to change the name of the ISR to PCINT1_vect? If not, that might explain why you weren’t getting results. That wouldn’t be responsible for your inability to program your Orangutan, though.

Yes, I changed the ISR.

I tried programming at a slower clock rate and it did not fix the problem.

I used AVRStudio. I connected and on the main page I changed the ISP settings to 4. I hit erase and it would not enter programming mode. I then tried at 6xx with the same results.

I saw in a different thread someone talking about adding an xtal to the clock pins. Is that an option here?

The Baby Orangutan already has an external oscillator connected to the XTAL pins.

I know I said earlier this sounded like a fuse problem, but it could also be the result of damage to the chip. Were you doing anything to it just before it died that might have caused anything to fry? Also, how are you powering your Baby Orangutan? Is there any chance this could be a power issue?

- Ben

I am using the 5V output of the Scorpion HX from robot-power.com to power the board. I have 12 volts going into the Scorpion and the servo connectors source the 5V. As a possibility, I verified the battery did not discharge enough and even charged it up again just to be certain.

As I mentioned in an earlier post, I wrote a program to it then I modified to the code to include the latest suggestion I received and it would not upload. No chance of wires moving, no chance of power not being on just one minute worked then the next it didn’t.

I tried uploading a picture here as an attachment but I guess the attachment section is for something else because it errored saying I couldn’t do that.

At this point I think we will need to examine the board to figure out what’s wrong with it. Please email or call us to obtain an RMA number and instructions for returning your Baby Orangutan for free repair or replacement.

- Ben

OK, I called and got an RMA # (38098). It should be arriving in Vegas in a few days.