Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: huevon on May 05, 2010, 04:42:49 PM

Title: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 05, 2010, 04:42:49 PM
Hi everyone
Please accept my apologies if this topic is not at the right place.
I am trying to program the 50$ robot MCU (Webbot Version) but allways get error messages  ??? Already spent 2 days searching the forum and debuging it but without success.

THE HARDWARE

50$ robot MCU with ATmega328p (Webbot's psb layout),  Pololu USB AVR ISP (http://www.pololu.com/catalog/product/1300 (http://www.pololu.com/catalog/product/1300)) with latest firmware. Power supply for mcu 9v battery.


SOFTWARE
OS Windows 7 Professional 64bit
Tried latest versions of: AVR Studio with SP1 and SP2, WinAVR and Pony Prog. All pololu drivers are correctly anstalled. Pony Prog did not run under 64-bit win, so I decided to downgrade all mentioned software to the versions shown in the 50$ tutorial.  

ERRORS
PonyProg and WinAVR can not find the target device

AVR Studio says to check my power supply.
Pololu config editor says VDD went low so programming was aborted.

DEBUGING
I am still wondering why is that message when my mesurements say different?
PCB tracks are checked for shorts and continuity. The voltage regulator works, 5.3v on all regulated pins. All pinouts are correct, checked them for continuity and correct possition when the cable is pluged. From the pololu board to the pins of the mega all is correct and has 0 resistance. I was so desperate and even doublechecked webbot's schematics and ATmega328p pinouts.

Am I missing something or using the wrong ISP Programmer?
Please guys let me know if you have eny ideas for further diagnostics
Thanks

edit:
Changed the mega328p with another one but still get the same error
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Soeren on May 05, 2010, 08:25:36 PM
Hi,

OS Windows 7 Professional 64bit
[...]
Am I missing something or using the wrong ISP Programmer?
Try the same on a computer running XP before doing anything else.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: madsci1016 on May 05, 2010, 09:40:49 PM
I use the Pololu AVR programmer on wondows 7 64bit with AVRstudio with no problems at all, so it's not a "not compatible with OS" bug.

 Do you see both COM ports in your device manager when you connect the programmer?
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 06, 2010, 03:24:53 AM
Hi thanks for replays
Do you see both COM ports in your device manager when you connect the programmer?
Yes I do. I have COM3 and COM4, for COM3 it says programming programmer port. I have tried configurations AVRISP Auto, COM3 and COM4, ponyprog and winavr dont have auto. It's COM3 or 4 but still same results.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: madsci1016 on May 06, 2010, 05:57:23 AM
In winavr, after you plug the programmer in, and open up the connect to programmer, are you selecting avrisp mk I , and auto for the com port? (Not sure on the exact phrasing of the model, I'm not at my computer right now. )
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Admin on May 06, 2010, 06:10:20 AM
Quote
Power supply for mcu 9v battery.
...
AVR Studio says to check my power supply.
Pololu config editor says VDD went low so programming was aborted.
Theres your problem. Measure the voltage while trying to program - my bet is it drops too low.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 06, 2010, 06:35:58 AM
Quote
Power supply for mcu 9v battery.
...
AVR Studio says to check my power supply.
Pololu config editor says VDD went low so programming was aborted.
Theres your problem. Measure the voltage while trying to program - my bet is it drops too low.
Measured the battery: 8v and managed to deliver 1.6A current in short. If you are right and my voltage drops, how powerful syply I have to use? Also I cant measure the drop because will be for very short time before programming is aborted (les than a sec). My ATmega consumes 15.8 mA and measured 3.6 voltage drop between pins 6 and 8 (pin6 and GND). I think that comes from the R1 (the resistor which limits the diode current). However still same result with removed resistor and diode.   
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Admin on May 06, 2010, 07:10:23 AM
Are you sure 1.2A is correct? Is that peak or average? I don't know for sure, but the internet suggests it should only give between 150mA to 300mA, depending on who you believe. Not sure if thats peak or average . . . How much current does the Pololu programmer need? (I'm too lazy to read the manual myself)


Hmmmm another thought . . . I remember several people posting in the past that they accidentally inverted the ISP header connections and took several days to notice . . .
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 06, 2010, 07:42:33 AM
I measured that curent for 10 seconds. Pololu programmer says 10-15 volts 500mA suply. But anyways the IC gets regulated 5.3v output and pololu programmer measures that and if it drops below 4384mV (4.38v) aborts the programming. Even if I build power suply with parameters required by Pololu would probably get same results.

Hmmmm another thought . . . I remember several people posting in the past that they accidentally inverted the ISP header connections and took several days to notice . . .

I searched the forum for similar problems and yes there was a case where the guy had inverted tha ISP header, and he was using AVR MK2. But not in my case, triple checked that. Measured the continuity from the bottom of the pololu board where solder joints are (they are signs vdd, mosi, rst etc) to the pins of my ATmega and everything goes to the correct place.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 07, 2010, 09:26:59 AM
Tried under XP but had same error. Also tried another power suply, no different result. AVR ISP MK2 is on its way.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: madsci1016 on May 07, 2010, 12:31:29 PM
Did you ever try changing the Com port number in windows? It could be a resource conflict. Does the LED start flashing orange when connected to the computer and powered MCU? Or is it stay flashing red?
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 07, 2010, 03:39:36 PM
Did you ever try changing the Com port number in windows? It could be a resource conflict. Does the LED start flashing orange when connected to the computer and powered MCU? Or is it stay flashing red?
Yes I did try changing COM ports as refered in the pololu manual. Changed them from 4 and 3 to COM1 and COM2 then ponyprog automaticaly showed those as avaliable but it didn't work again. AVR Studio shows same error as well. After powering pololu programmer I get GREEN light and RED light flashing, then I power the MCU and RED goes OFF, ORANGE strts flashing. I realy do suspect the pololu programmer because measured the voltage btween VDD and GROUND on the pololu board and has stable 5.3V coming from MCU board. As I understand the programming is aborted by the programmer because it has measured lower VDD when tried entering programming mode (bullsh....) After getting this error RED light comes ON.
AVR ISP MK2 is estimated to be delivered in Monday. I'll keep you guys informed.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Admin on May 07, 2010, 08:01:10 PM
If it still doesn't work with the new programmer, I recommend trying a better power supply. If still no beans, then maybe your AVR is dysfunctional.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 10, 2010, 09:30:50 AM
Hi
My new AVR ISP MK2 is here. This time I got the following error after pressing VERIFY (see attachment).

Now things work in half. I was able to read the signature, erase the device, read the flash and save it into file (those did not work with pololu isp)
From the error message below 100% ISP header is correctly connected.
1. If so I wouldn't be able to read the devise!
2. I did try the oposite and had another error saying there is short in the ISP

Ok what else to do with the reset line, these 328p have integrated pull-up resistor (refering to datasheet). What else could be wrong?
What does this mean:
WARNING: FLASH byte address 0x0680 is 0xFF (should be 0xCD).. FAILED!

Another thing is that the only working ISP Clock frequencys are 6.48kHz, 125kHz, 250kHz. If ISP clock is set to be 500kHz then the signature doesn't mach the device! All frequencys above don't work.
Is it possible this to be result of parasitic capacitanse between close to each other pcb tracks?

EDIT:
Powered the board with power supply 12V capable of delivering 800mA and there was no difference.
Would anyone advise me to connect aditional pull-up resistor between ISP and ATmega reset pin?
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 10, 2010, 03:42:03 PM
Just tried with an aditional pull-up resistor of 10k but no change. Ordered ATmega168, I am very curious to see am I going to get same RESET issue
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Admin on May 10, 2010, 08:24:41 PM
My two theories is that you wired something wrong, or your ATmega was damaged somehow.

As for the additional pull-up resistor, its recommended, but it should work without it. I use a 300k on my Axons.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: madsci1016 on May 10, 2010, 08:34:59 PM
I'm glad this wasn't a problem with the Pololu programmer, (or at least completly the programmer) as I have been trying to push the programmer around here as a cheaper alternative with more features compared to a 'official' AVR programmer.

It works flawlessly for me Axon 1 and 2, on a laptop with win 7 64 bit.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 11, 2010, 01:17:47 PM
Hey guys.
Do I need to have all the sensors and servos connected while programming the mcu?
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: Admin on May 11, 2010, 09:40:04 PM
Nope, doesn't need to be.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 12, 2010, 04:58:50 AM
I also think the same but when I connect servo(9g chineese fake) to any of the regulated pins then both programmers AVR MK2 and Pololu are able to prgram the flash??? However it doesn't work properly because it doesn't center the servos after uploading servo.hex and restarting the avr.
Very very weird. Hopefuly my mega168 comes today, I cant wait to see is it going to behave same way...

I'm glad this wasn't a problem with the Pololu programmer, (or at least completly the programmer) as I have been trying to push the programmer around here as a cheaper alternative with more features compared to a 'official' AVR programmer.

It works flawlessly for me Axon 1 and 2, on a laptop with win 7 64 bit.

I haven't doubted your recomedation madsci, firstly I thought there is specific setting or something, and really hoped someone of the forum has experienced similar thing when using pololu.
Title: Re: Has anyone used Pololu AVR Programmer with 50$ robot MCU?
Post by: huevon on May 12, 2010, 06:49:33 PM
 :-[ :-\ :'(
After more than a week debugging decided to bin the whole thing and make a new one from scratch. Just can't find where the problem comes from. Don't know what else to do ???

The conclusion:
Pololu USB Progammer works just fine!