ATmega1284P: End to End using 1.0 IDE

What about running the 1284p at 20Mhz? As far as I know if you change the value in the boards.txt the millis should work fine.
Can I have any other problems?

I've received today my AVRISP MkII, so I can finally program the microcontrollers in a professional way. Unfortunately I have no luck.
When I try to upload a sketch using 1.01 IDE with the option "Upload using programmer", with the correct board an programmer selected, I get the errror:

avrdude: stk500v2_command(): Command failedavrdude: stk500v2_programm_enable(): bad AVRISPmkII connection status: SCK fail
avrdude: initialization failed, rc=1
Double check connection and try again, or use -F to override this check

So I thought I've made something wrong on the connections. Then I tested this in an official Arduino Uno and Mega2560 boards, with exactly the same result.

I do the following:
Connect the AVR to my computer. Red light lights.
Connect the Arduino to the USB, it powers up. And the red light of the AVR turns green.
Upload using programmer: another green light of the AVR lights on, then goes off and red light of the AVR starts to blink.

Jesus! Is that difficult to program the Atmel micro's???

svalls:
What about running the 1284p at 20Mhz?

0.39% error in millis...

I believe micros is way off.

Interesting, so I can run the processor at 24 Mhz without problems on the software side (I don't have it clear enought what will happen on the hardware). With an improvement in speed of 33%.
I must point that I'm doing that for learning, so don't try to found a "reason".

@svalls,
Do you have the driver installed for it?
Need to dig down into the arduino files to find it, do a search within arduino path for libusb.

Dear Crossroads,

I forgot to mention that i'm using a Mac, with Snow leopard.
I was looking into the arduino path, and I found that I have under Arduino/Contents/Resources/Java/hardware/tools/avr/lib two files:
libusb.a
libusb.la

and also:
libusbpp.a
libusbpp.la

I noticed also on Google, that some people says I must install a big sort of things, and others nothing ¿? I'm really lost!
PD: I also tried on Ubuntu Linux with the same results.

Here's my full path to the files:
c:/arduino-1.0.1\hardware\tools\avr\utils\libusb\bin
there are avrisp2... named files there.

Could be you're looking in the wrong place.
I don't know if it makes a difference for your PC type.

BTW, I'm reminded that 1.0 introduced a bug in ArduinoISP; I keep forgetting because it's one of the bugs that's actually been fixed in 1.0.1
If you're still using 1.0, you should upgrade or apply one of the patches!
http://code.google.com/p/arduino/issues/detail?id=860

Glad I haven't been using ArduinoISP!

I'm using Arduino 1.01, thanks for the appointment.
I'm sure it must be a dummy think, but what?

I will test it in another computer.

Did you find the avrisp2 drivers & try those?
I don't know. You need MAC person to jump in here.

Well the thing is moving forward!
It results that my stupidity it's only surpassed by my ignorance: I connected the MKii to the wrong ICSP... It results that both the Uno and the Mega2560 have TWO ICSP, one for program and the other for...

But it can be that easy!
Now I get the following error:

  • Trying to program an Arduino Uno board (tested with two boards): Wrong microcontroller found. Expected signature for the ATMEGA328P is 1E 95 0F
  • Trying to program an Arduino Mega2560: Wrong microcontroller found. Expected signature for the ATMEGA2560 is 1E 98 01

WTF! And this are original Arduino boards! I will appreciate so much any help.
Thanks!

Ok, I have now more info:
The signature corresponds to the MEGA16U2, so I am connected to the wrong chip.

Any ideas?

What happens when you connect to the correct chip?

Well, this will cause some laughs...

The UNO shares the ICSP pins with Pin13, 12, 11, so if one wants to program via ICSP, please: disconnect any I/O cables/sensor/etc. from pins 13, 12 and 11.

It that simple!
I was changing the boards, but connecting the exactly same cables to the same pins, so no way.
Hope it can help to anybody.

Yes, if external devices were driving those pins while you were programming, that would be a problem.

In short: is USBasp enough to correctly bootload the 1284 (P and non-P) ? I have the one based on an Atmega8A, which I have successfully used to bootload a countper Atmega328 (non-P, so I had to edit avrdude.conf).

svalls:
Ok, I have now more info:
The signature corresponds to the MEGA16U2, so I am connected to the wrong chip.

Any ideas?

The are 2 ICSP headers in the Rev. 3 boards. Make sure you connect to the one farthest from the USB connector.

I don't believe the USBASP based on Atmega8 will program the full address range of the '1284.

NickGammon has nice writeups on using an Arduino as ISP including '1284s.

I use an Atmel AVR ISP MKii myself.
Set up the 1284 core files here

I install a bootloader so the fuses are set right, then use File:Upload using Programmer to upload a sketch if I'm not uploading via the Serial port.

Just a question: is the Optiboot 4.5 available in the Mighty-1284 core able to write over the whole memory of the 1284P (due to the fact that it has 128 kB of Flash)? I think it is, just because the bootloader is written in the higher part of the Flash and it's running fine on my chip... :sweat_smile: