Can connect to BabyO but program mode fails

I can connect to babyO168 but when entering program mode, it fails

Im using WINXP sp3
connections are good, programmer found on usb - COM4
AVRISP - auto connection ( connects with no errors)
program window
Main tab - ATmega168 , frequency 28.8mhz
Program Tab
flash - PulseMotorCtrl.hex 13k ( click verify it says a problem occurred )
eeprom - PulseMotorCtrl.eep 1k ( click verify it says hex file empty )
ELF file PulseMotorCtrl.elf 29k

FUSES
there is a ? mark on SPIEN ( i don’t know what this is )

please advise

dave

You will need to power the Baby Orangutan and ensure that the programming cable is connected with the right orientation. I also advise that you use complete sentences when asking for help, tell us which programmer you are using, and describe all of your connections in detail.

-David

David

sorry about the short hand

I am using the USB AVR programmer pololu.com/catalog/product/1300. the Baby O is being powered by a 3volt power source and the green light shows solid. The programmer data cable is connect with pin one (red) orientation. the programmer is then plugged into my PC, and its green light shows solid. The usb driver installed with no problems and no hardware conflicts according to the hardware manager, and the programmer shows up as a usb device using COM port 4. I can establish a connection within AVR Studios to the Baby O with no errors. The error shows up when i try to [PROGRAM] or [VERIFY]

Thank you please advise

Dave

Hello.

Why are you powering the Baby Orangutan at 3V? This is almost certainly your problem. The Baby Orangutan runs at 20 MHz, which requires a VCC of at least 4.5 V according to the AVR spec (it might still run alright out of spec, but we don’t recommend it). But running at 3 V leads to other problems as well. One is that the programmer will not program when the target voltage is below a certain value. This threshold is configurable (see the programmer user’s guide), but 3 V is below the default. Also, the AVR spec says the voltage on the pins should not exceed VCC + 0.5V (3.5 V in your case), but the programmer operates at 5 V, so that would be another way you’re operating out of spec. Finally, 3 V is below the minimum operating voltage for the motor driver on the Baby Orangutan, so it might not work well.

Can you try supplying between 5 and 13.5 V to VIN and see if that lets you program it?

It sounds like you are establishing a connection between AVR Studio and your programmer, but from what you describe, there is no communication going on between the programmer and the Baby Orangutan.

- Ben

Ben,

I switched to a 9volt source and still the same results as above.

I can connect to the babyO but,
when i [PROGRAM] [VERIFY] [ERASE] [READ SIGNATURE] i get this

Reading FLASH input file… OK
Entering programming mode… FAILED!
Leaving programming mode… OK!

please advise

dave

You keep saying this, but what is it based on? When you bring up the AVR ISP dialog in AVR Studio, you are communicating with your programmer, not the Baby Orangutan. The only time the programmer communicates with the programmer is when you get the message “entering programming mode…SUCCESS”. Only trying to program, verify, read device signature, erase device, or read the fuses or lock bits (this happens automatically when you open the fuses tab and since AVR Studio couldn’t read the fuses it put a ? next to the SPIEN fuse bit) initiates communication between the programmer and the Baby Orangutan. You haven’t yet demonstrated any successful communication with the Baby Orangutan.

Can you post a picture of your setup so we can see how everything is connected? If possible, could you also post a close-up picture of your ISP header solder joints?

- Ben

In AVR4Studio the tab project - configuration options allows you to select the processor for which you are programming.

When you connect to the selected programmer there are 8 tabs, the first one main has to be set for the device you want to connect to.

If you change the processor type in project it will not be changed in the programmer and writing the program to the device will probably fail.

This took me quite some time when I moved from the Baby-O ATmega168 to the ATmega328P.

If the power of your device is disconnecte during programming you may lock yourself out.

Try a different processor, of the behaviour is the same your programming setup is not good, if it works there is a chance that you locked yourself out of the one you cannot program.

Oh, one very important thing you never mentioned and I forgot to ask: have you ever successfully programmed this Baby Orangutan before? If so, with what?

- Ben

Erick i will of course try those things, I am sure I have never disconnected while in programming mode or
programing upload.

Ben, Yes I have programmed this before a few times successfully , but with a different PC, same or simular connections.

Ben, here are screen shots and photos of my connections on BabyO
may you can make something of it.

http://culser.com/project/atmega.htm

Thank you both

Dave

Dave,

The programmer in that photo is definitely not the USB AVR programmer. You should be able to see for yourself that it is not the same device as the one you linked to. You have the older Orangutan USB programmer (product #740). Details like this are extremely important, so please take care to give us accurate information if you want us to be able to help you. It is also extremely relevant that you were originally able to program the board and now can not. Is it not obvious to you that we should be focusing on figuring out what changed between when it was working and when it stopped working?

If you were able to program the board before, your connections to the programmer are probably good. Did anything odd happen the last time you successfully programmed it, or did it just work on one computer and not work on another? Is there a program on the board right now, and, if so, is that program running? Did you ever program the board while it was running at 3V?

Can you go back to the previous PC and see if you can still program the board using your old setup? In short, we need to figure out if you have damaged/corrupted the AVR on your Baby Orangutan or if the problem is with your setup. Since your new computer can clearly talk to the programmer and since your programming connections are probably good, it’s seeming more likely that you damaged the board somehow.

- Ben

Ben,

The other PC is history, gone.

There was nothing odd that happened the last time i programmed the BabyO.
I programmed it many times, and test it many times with no problems. If the baby0 can preserve programs
for long periods of time, i would say yes, there should be a program on board, ( i have not tested it )

Its been almost 2 years, I can’t remember if i used 3volt or 9volts, i am simply not sure.

Can using 3volt harm the babyO?

All setting that you see in the photos are default after clean a install, the only setting i had to change was
in the General Settings to choose the type of robot “ATmega168”. Which was not selected for some reason.
All software “.c” and “.aps” was saved and preserved from the previous PC. I remember having to choose
"ATmega168" upon the creation of each program/project on the old PC. For some reason this setting
was not preserved from the old PC.

If this is so maybe I need to regress back to the older driver for this older programmer, or
do you know if you current driver is universal? The current driver I have is "PololuUSBInstaller.exe"
dated copywrite 2007 verision 2.0.0. Maybe is the drive?

Is there a possibilty my program is compiled too large? in my first post i did specify the sizes of the hex eep files

Dave

The driver installation file is the correct one for your programmer, and it sounds like you have them installed correctly. You said everything looks ok in the device manager, and you have the green USB status LED on. If your drivers weren’t installed correctly, you would not be able to bring up the AVRISP dialog box at all because AVR Studio would not find the programmer.

The problem also has nothing to do with your program size. Program size would not affect your ability to read the device signature, perform a chip erase, or read the fuses. Either there is a bad connection between your programmer and the board, or the microcontroller on the Baby Orangutan is in an unprogrammable state (either from having its fuses corrupted or from damage to the MCU itself from a bad connection).

What external components did you have connected to the board while it was powered at 3V? Since 3V is below the minimum operating voltage for the MCU on the board (when running at 20 MHz), programming it at this voltage could potentially corrupt the MCU. If this has happened, we will need to replace the microcontroller. If you’re interested in having us take a look at it in person, please contact me directly at ben at pololu dot com for an RMA number.

- Ben

There is another catch, in the programmer dialog you have to browse to the file to be loaded, if you forget this it will retain the last file you tried to load and if this is corrupt you will repeat failing to install.
I got trapped in this situation when I copied my project to solve a bug and I could not fix it until I found out I was repeating loading the old file.

I use blinkLED now to prove my installation is right. (available in the LV168 resources)

Even with the latest programmer software that prevents the processor to be loaded when there is no power it can happen that you corrupt the processor. I lost a processor when the battery went flat during programming. Now I use a 5V NiMH battery with a voltage spy.

Since then I always have a spare board in stock so it cannot hurt the progress of my project.

Once it is locked you cannot do anyting else but returning it to pololu.

Ben,

As shown in the photos, No external motors or servos were connected, just the leads are soldiered to the baby O.

I have requested an RMA to have my babyO reset if possilbe, if you find my babyO is damaged I can alway purchase another.

Also I do have a spare babyO never opened, my plan was to perfect my project then duplicated it.

Question about the new babyO - does the new babyO328 have a low voltage safty provision to prevent
corruption?

The Baby Orangutan B-328 does not have any special protection against corruption. Since your programmer is directly connected to the AVR’s programming lines, such protections wouldn’t be feasible on the Baby Orangutan.

However, our new USB AVR programmer is designed to abort programming if the target voltage is low or unstable, which makes it much less likely that the MCU will be corrupted. We have not had any reports of corrupted AVRs from people using our new programmer. The programmer you have also monitors the target voltage, but it does so with a digital I/O line, which limits its effectiveness. Unfortunately, the very act of programming an AVR is enough to weakly power it and make the target voltage read “high” to the Orangutan USB programmer. The USB AVR programmer uses an analog line to measure the target voltage, so it can more quickly detect problems and stop programming.

I recommend you upgrade your programmer to our newer version if you want better protection against accidental corruption of the AVR due to power issues. If you buy an Orangutan combination deal, you’ll get the programmer for just $12 more than the cost of the Orangutan by itself.

- Ben

Ben,

Always good to have the backup, i will buy the combo.

Purhaps i will still send my old baby0 in if you will allow it, which i have made an email RMA request, I would be interested in knowing the final verdict on what happened.

Do you have extra pins as shown in the photo, or within the order can you include extra pin,
I make + - connector out of them.

Oh also: in the AVR studio, Does the Baby168 and 328 use the same type of robot/link library ATmega168?

thank you

Dave

You can still send us your Baby Orangutan; I sent you an email with an RMA number and return instructions. Code written for the Baby Orangutan B-168 will run on the Baby Orangutan B-328 with little or no changes, but you will need to compile them using the correct settings. Specifically, you need to make sure the device is ATmega328P under Project -> Configuration Options, and you need to link in the libpololu_atmega328p.a version of the Pololu AVR library. You should also change the device to ATmega328P in the AVRISP dialog box.

You can post here if you have any problems getting it to work, but I don’t expect you to have any problems.

- Ben

Ben,

ok thx for all the help, i have turned a new leaf, i will never use 3volt ever again.

ANOTHER PROBLEM WITH MY OTHER BABYO:

I am having yet another connection problem with my #2 baby0168. The red light on the older programmer
is blinking which i believe indicates that the BabyO is getting no power or voltage drop maybe, and the
green light on the old programmer is solid green which means a good connection with the PC.
I am sure I am using at least 6volts to power the babyO ( i tested with a multi-tester ) , yet the red light continues to blink on the old programmer. I also tested continuity on the 6 pin connector on the baby0, all connections seem solid. I am stumped, at a loss. Could a loss of milliamps from the battery be causing this?
I don’t know

Dave

The blinking red light means that the programmer isn’t detecting any target voltage. What voltage do you measure with your multimeter on pin 2 of the Baby Orangutan’s programming header? It’s the pin directly across above pin 1 in the picture below:

Make sure you use the multimeter to measure voltage on the header pin in case there’s a problem with the connection between your header pin and the board. Also, you should make sure that you’re working with a freshly charged battery.

When you tested for continuity, what were your continuity test points for each pin?

- Ben

Ben,

Just to verify, so to test the voltage the test points would be pin1 and pin2 on the header , while powered up from a fully charged battery?

For continuity the test points were solder on the short side of the header to the same pin on the long side,
but i believe this was inconclusive and not accurate.

thank you

Dave