AVR Studio connection problems with ATMega1280

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello All,

I have a ATMega1280 uController and am trying to program it from AVR Studio and am getting a connection failed error.

I have tried many things posted in forums here and other places but nothing has worked and I am stumped.

I am running Windows 7 64 bit, and am running the current version of AVR Studio (4.18 build 700)

I have tired;
running in Virtual Box with XP Pro SP3 guest...no go

installing alternate WinDriver drivers as was recommended...no go

tried avrdude -v -P con3 -U flash:w:TimerTest.hex -p m1280 -b 9600 -c stk500v2 no go stk500_2_ReceiveMessage(): timeout
Had thought that this might be a driver problem BUT

I am able to upload from the arduino-0018 IDE and works great.

I've just about pulled out the last of my hair so any help would be appreciated.

Another Newbie question,
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But which pins did you use for ISP in your board? Or is it a ready made board? The 1280 does not use Mosi and Miso. Look it up on the datasheet.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's a ready made board. According to Datasheet it has in "In-Systen Programming by On-Chip Boot Program"
I understood the Mosi and Miso as being used for ?clustering? chips together in a master slave relationship.
To program using the arduino IDE I plug in the USB cable and there's a button to upload and it is all done automagically so I can't really dig in and see what it is doing.
I want to use AVR Studio as it is more like an IDE that I am used to and appears to be able to handle larger programs better.

My background is in Windows and Web apps but I started my career in robotics more years than I can remember and am wanting to get back into it and do a few projects.

Thanks for your input,
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
In-Systen Programming by On-Chip Boot Program
That means that it COULD be using the USART0 pins which are also used for ISP.

Do you have a diagram of the bord? Depending on how it has been designed ISP may not be possible without doing some mods. Of course you could also use JTAG for programming as well as debugging, but again it depends on how the board was designed.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A schematic for the board is here; http://www.robotshop.ca/dfrobot-...

I have read and continue to read the data sheet but to a programmer a lot of it is written in greek.

I would like to get this working from AVR Studio so if you could recommend an inexpensive ISP programmer that would work in this situation I would appreciate it.

Thanks again,
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I would like to get this working from AVR Studio so if you could recommend an inexpensive ISP programmer that would work in this situation I would appreciate it.

AVRISPmkII - $34

But going back to your original post - if the board/chip have a bootloader then it's likely to use UART connection and "avrdude -c avr109".

But surely this board has some instructions telling you how to wire up the connection and what PC software to use to drive it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nothing came with the board and what I have found to program it has not been successful, except the Arduino IDE.
I googled for quite some time before posting here. There just isn't to much info on this board, other than data sheet I guess because it's new.
I have tried everything that I have found and nothing worked.

Thanks,
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh it's an Arduino board? In that case it contains the Arduino bootloader and you use avrdude as described here:

http://www.smileymicros.com/inde...

As the PDF within the .ZIP says:

Quote:
avrdude -p m328p -c avrisp -P com6 -b 57600 -F -U flash:w:Blink.hex

(obviously the com port may not be com6 - set that to the COM port that the UART of the Arduino is connected to)

The key thing here is the "-c avrisp" which is the bootloader protocol that Arduino uses.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You sir are the man!

I think I tried every protocol except avrisp.
You have no idea how many hours I have spent on this and it turn out to be that simple.
Now a couple of other questions on this subject if you would be so kind.
1) In AVR Studio I use the avrisp and COM3 option but it doesn't connect, can it be done or are there some other config options I need there.
2) Can I include options in the make file to get it to work from within AVR Studio.

If not I have no problem using avrdude but would just be a little nicer from within AVR Studio.

Thank you so much, I owe you a beverage of your choice.
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(1) nope, as David noted the other day the Arduino has chosen a bootloader protocol that cannot be be used from within Studio. You need to use avrdude externally.

(2) if you add an avrdude command to your own makefile then within Studio tick "use external makefile" it would be possible this way.

Personally I don't see what's wrong with running it separately.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Personally I don't see what's wrong with running it separately.

No I don't either but as I said just would be a little cleaner.

Thanks for all your help,
Mike

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
A schematic for the board is here;
I could not see a diagram on that site but the board seems to have a 6 pin header for ISP if it is the RB-Ard-13 or RB-Dfr-09. Doesn't seem to have a direct JTAG connector but I'm sure it could be rigged up somehow if you ever need JTAG debugging.

Anyway you seem to be up and running while I was asleep. :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I did, I also noticed the 6 pin header and had assumed that was what it was for but being as I'm unemployed at the moment and tight on cash thought I'd try to go the economical route if possible.

Thanks for your help, I'm sure before it's over I'll have asked a load of stupid questions. Please bear with me I've got a lot of ground to cover.
Mike

Happy Trails,

Mike

JaxCoder.com