Go Down

Topic: standalone MEGA 2560 (Read 12103 times) previous topic - next topic

hiduino

Yes, you can.  I was able to use it to program with the Arduino IDE to program some ATtiny84/85/13 chips.

The Pololu USB AVR Programmer driver installs several virtual COM ports.  You need to use the "Pololu USB AVR Programmer Programming Port(COMxx)" port.  Select this COM port in the IDE Tools->Serial Port menu.

You will need to add this Pololu definition to the \arduino-1.0.4\hardware\arduino\programmers.txt file.
(Note: you need to restart your IDE after editing this file)
Code: [Select]

pololu.name=Pololu
pololu.communication=serial
pololu.protocol=stk500v2



Make sure you select the Pololu programmer under Tools->Programmer menu.  And use the Upload Using Programmer.


HH75

Thanks.

I read this from the pololu user guide, "it does not currently work with Atmel's line of XMega microcontrollers"

Does this means that it cannot be use on the Mega 2560?


Thanks

JoeN

#17
Mar 20, 2013, 07:09 pm Last Edit: Mar 20, 2013, 07:14 pm by JoeN Reason: 1

Thanks.

I read this from the pololu user guide, "it does not currently work with Atmel's line of XMega microcontrollers"

Does this means that it cannot be use on the Mega 2560?


Thanks


It will work fine with the MEGA2650, exactly the same as with the 328, just different pin numbers to hook up.  2560 is not an XMEGA chip.

XMEGA is a different line and the X will always be in the chip name.  It's not a placeholder for a number, it's an actual X character.  For example, the ATxmega128A1 is an XMEGA chip.  XMEGAs have the AVR core but significant differences in the way ports are set up.  They usually have other features (they come with a real DAC for example) added and can run at higher clock speeds.  Not too many people  mess with them.  I got a few from Atmel on a sample order (free is my favorite price, especially if I just want to mess with it) and I am going to try them out with my AVR ISP II programmer which supports them.

They are fairly impressive, but I just don't know where they see real world use.  More info:

http://www.atmel.com/products/microcontrollers/avr/xmega_technical_details.aspx
I will never ask you to do anything that I wouldn't do myself.

HH75

I have wired up my mega2560 and try to download the sketch into it using the pololu avr programmer.

I have set up the the programmer to use Pololu and Upload using programmer.

But I am getting error msg "avrdude stk500v2_command() command failed "

There are 2 virtual com port and I have tried both.

Sometimes I get this error "avrdude: usbdev_open(): did not find any USB device "usb""


hiduino

What is your command line for avrdude?

How old is your Pololu AVR programmer?  You might need to update the firmware to v1.0.7 if it's not already at that version.  I think the older version 1.0.1 supported AVRISPV2, not STK500V2.


HH75

Hi,
I have checked the firmware and it is v1.0.7 (from the device manage - USB\VID_1FFB&PID_0081&REV_0107&MI_04)

I am using the Arduino IDE and I selected Tools->Burn Bootloader and I get this error:

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

Is it a hardware wiring connection error? Or my procedure is wrong?


JoeN

#21
Mar 29, 2013, 09:02 pm Last Edit: Mar 29, 2013, 09:09 pm by JoeN Reason: 1
I have no experience with Pololu's programmer, but I have done standalone 2560s before and did one this week using Atmel programmers.  Just to reiterate the process, bind pin 64 (avcc), 52 (vcc), and 21 (vcc) to 4.5V - 5.5V and pins 63, 53, and 22 to ground.  Reset, pin 20, must be held high through a 10K external resistor in addition to being connected to the programming port - the programming port can overcome this when the 2560 is being programmed but when the 2560 is not being programmed it needs to be high.  Pin 62 (aref) should be connected to ground through a .1uF cap, though this is not strictly necessary.  Have you probed all of these pins to make sure they are connected correctly (aref will be floating but the others should be tied to ground or positive voltage).  Have you ensured continuity between the pins on your programming port and the pins on the 2560?  Are the pins actually in the correct order?  I am betting a hardware issue right now.  You shouldn't need a crystal for the default clock mode but may want to add that too, it shouldn't hurt you as the 2560 will initially use its internal clock.
I will never ask you to do anything that I wouldn't do myself.

hiduino

#22
Mar 29, 2013, 09:50 pm Last Edit: Mar 29, 2013, 10:55 pm by hiduino Reason: 1
The Pololu programmer does not support powering of the target device.  How are you powering your mega2560?


One word of caution, when burning bootloader from IDE using the Pololu programmer to a mega2560, it tends to hang the IDE.  It appears the Pololu programmer output has very verbose messages that overflows the IDE buffers.  So if the IDE becomes unresponsive then just close the IDE window and reopen it again.


HH75

Thanks for your reply.

I have re-check and probe the wiring again and they are similar to JoeN process. In addition I have 3 x 0.1uF cap connected from AVcc to Gnd. I also have a resonator and a 1K resistor connected across the XTAL1 and XTAL 2. The datasheet of the resonator is attached.

The 6 ISCP pins are also probed from the 2560 up to the Pololu programmer where the 6 pins are indicated as shown.

I am currently powering the 2560 with a 9V battery cell thru a voltage regulator that provides a constant 5V output. The voltage level is sufficient as indicated by the Pololu programmer yellow blinking LED (which means that the programmer has detected the target device, and the voltage on the target VDD line is high).

The Arduino IDE didn't really hang but returns the following error msg when I tried to download bootloader or upload sketch using programmer.

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


hiduino

Usually those type of errors indicate bad ICSP connections to the target device.  Can you post the full output?


HH75

Can you explain more on the full output?

I am using the Arduino IDE and the errors I received when burning bootloader and uploading using programmer are the same.

See attached screenshot.


hiduino

From the IDE File->Preferences menu, you can enable "show verbose output during upload".  Then post the results.

The errors you are seeing could be due to no system clock, or bad connections. What kind of prototyping board are you using for your ATmega2560?


HH75

Thanks.

I have attached the verbose output. Please help me on this, I can't figure out anything from this output.

I am using a Schmart board with TQFP 64 pin for my mega2561. I wired it up as per what I had mentioned in my earlier post.

HH75

Hi,

I noticed this in the verbose output:
         SCK period      : 1.1 us
         Varef           : 0.0 V
         Oscillator      : 3.686 MHz

Does this imply that my circuit oscillator is 3.686 MHz?

hiduino

No I believe that is the programmers clock speed.

What speed is your resonator?

The output indicates that the programmer cannot communicate to the ATmega2561.

Also the ATmega2561 is not the same as the ATmega2560, so we should change the part number to avrdude.  But this is not why it's failing yet.

How is your reset pin connected up?


Go Up