ISP: Program ATMEGA256016AU

Good Evening Nick,
below reported the information from Atmega_Board_Detector:

Atmega chip detector.
Entered programming mode OK.
Signature = 1E 98 01
Processor = ATmega2560
Flash memory size = 262144
LFuse = FF
HFuse = D0
EFuse = FD
Lock byte = CF
Clock calibration = 85
Bootloader in use: Yes
EEPROM preserved through erase: Yes
Watchdog timer always on: No
Bootloader is 8192 bytes starting at 3E000

Bootloader:

// I didn't post the bootloader because it's very long if needed I can post shrink in several pieces ...

MD5 sum of bootloader = 1E 35 14 08 1F 65 7F 8C 96 50 69 9F 19 1E 3D F0

First 256 bytes of program memory:

0: 02 C1 00 00 2D C1 00 00 2B C1 00 00 29 C1 00 00
10: 27 C1 00 00 25 C1 00 00 23 C1 00 00 21 C1 00 00
20: 1F C1 00 00 1D C1 00 00 1B C1 00 00 19 C1 00 00
30: 17 C1 00 00 15 C1 00 00 13 C1 00 00 11 C1 00 00
40: 0F C1 00 00 0D C1 00 00 0B C1 00 00 09 C1 00 00
50: 07 C1 00 00 05 C1 00 00 03 C1 00 00 0C 94 54 19
60: FF C0 00 00 0C 94 3D 1B 0C 94 81 1C F9 C0 00 00
70: F7 C0 00 00 F5 C0 00 00 F3 C0 00 00 F1 C0 00 00
80: EF C0 00 00 ED C0 00 00 EB C0 00 00 E9 C0 00 00
90: 0C 94 7D 1B 0C 94 C0 1C E3 C0 00 00 E1 C0 00 00
A0: DF C0 00 00 DD C0 00 00 DB C0 00 00 D9 C0 00 00
B0: D7 C0 00 00 D5 C0 00 00 D3 C0 00 00 D1 C0 00 00
C0: CF C0 00 00 CD C0 00 00 CB C0 00 00 0C 94 BD 1B
D0: 0C 94 FF 1C C5 C0 00 00 0C 94 FD 1B 0C 94 3E 1D
E0: BF C0 00 00 00 00 21 00 24 00 27 00 2A 00 2D 00
F0: 30 00 33 00 01 01 00 00 04 01 07 01 0A 01 00 00

What I've understand is that the cable is working correct ? Please let me know if I'm wrong something :slight_smile: thanks you very much for your help :slight_smile: it's very useful ...

regards,
Gnux

The chip looks like it is working OK, and you also have the Mega bootloader on it. Compare the MD5 sum to the one on this page:

stk500v2

stk500boot_v2_mega2560.hex
23d339e0ba55f179dd02e0e29d736991 *stk500boot_v2_mega2560.hex
Loader start: 3E000, length: 8192
MD5 sum = 1E 35 14 08 1F 65 7F 8C 96 50 69 9F 19 1E 3D F0
Board name in IDE: Arduino Mega 2560 or Mega ADK

You also seem to have some sort of sketch loaded:

First 256 bytes of program memory:

0: 02 C1 00 00 2D C1 00 00 2B C1 00 00 29 C1 00 00
10: 27 C1 00 00 25 C1 00 00 23 C1 00 00 21 C1 00 00
20: 1F C1 00 00 1D C1 00 00 1B C1 00 00 19 C1 00 00
30: 17 C1 00 00 15 C1 00 00 13 C1 00 00 11 C1 00 00
40: 0F C1 00 00 0D C1 00 00 0B C1 00 00 09 C1 00 00
50: 07 C1 00 00 05 C1 00 00 03 C1 00 00 0C 94 54 19
60: FF C0 00 00 0C 94 3D 1B 0C 94 81 1C F9 C0 00 00
70: F7 C0 00 00 F5 C0 00 00 F3 C0 00 00 F1 C0 00 00
...

Your fuses indicate you have set up for an external crystal, and that bootloader requires a 16 MHz crystal. Do you have a 16 MHz crystal installed?, and two 18 pF (or so) capacitors?

What method are you using to connect to your Mega2560 for the purpose of uploading sketches with the bootloader?

Hi Nick,
good Morning so right Now I'm using:
a) Arduino Uno (That is the board with sketch)
b) Arduino Mega 2560 (that is the board being programmed)

then yes I've the capacitor, the clock and all the stuff needed i think. After I'm doing a stand-alone circuit where i will use atmega2560 with capacitor, clock etc etc. Now my scope was trying this kind of programming for understand and manage at the top it ...

for programming I've used this step suggested by "crossroad" below reported:

You will install bootloader using your existing Uno and NickGammon's bootloader sketch:

Then connect the USB/Serial interface, start the IDE, select the COM port,
select Tools: Board:Mega2560
use the regular buttons to upload a sketch.

so, if i not understood bad, first is necessary upload the boot loader and second the sketch, but to be honest i didn't understand how to configure my Arduino Enviroment for do that ... and if the steps are correct ...

I've checked and MD5 is different,
so in your link is

MD5 sum of bootloader = B9 49 93 09 49 1A 64 6E CD 58 47 89 C2 D8 A4 6C

my board

MD5 sum = 1E 35 14 08 1F 65 7F 8C 96 50 69 9F 19 1E 3D F0

Thanks for your help,
Gnux

The bootloader uploads a sketch via the serial port. Can you please explain what serial communications you have implemented?

Hi Nick,

I think is better do the reverse :slight_smile: could you indicate kindly me the steps that are necessary do for upload bootloader and sketch via ISP ?

because right-now I've a little bit a confusion ... so what I've understood is: first upload the boot loader and then upload the sketch.

For to do that is necessary please correct me if i wrong :

Thanks in this way i think that I can clarify all the steps :slight_smile:

have nice day,
Gnux

I've modify the bootloader also,
maybe it's a little bit clear the ISP cable is used only for the boot-loader ?
now i've how to upload the sketch ... thanks for your help ...
gnux

Hi Nick,
I think that I've did a little steps in advance so I've looked your post how to upload by sd and I've tried with arduino ethernet shield and I've modified the pin for work with the shield but now Im not able to upload hex file when i try to upload it if I type the name nothing happened, then I type the name another time and I received back the message that can't open the file because some the both entry see the attachment of my serial monitor.

Of course I remain interested for programming via isp also if is possible,

thanks
Gnux

Ciao Nick,
I thinks that I've discovered the issues ... the problem was the lenght file name ... I've did a with a name long 12 character and now it's ok,

could you confirm ?

Thanks,
Gnux

The file name was SERIAL.HEX not SERIAL.HEXE

yes but i think there is a bug because if i type a name less of 12 characters dpesn't work

changing the file name with length 12 it working

thx
gnux

I renamed one of my hex files to FOO.HEX and it still worked.

Okey so, then now I'm a little bit confused because ...

If I renamed the file FOO.HEX and then I type the named into my console when request, the system do nothing ... then I've to put the name again until appears the error that I've post to you ... was not my entry fault ... but the system automatically was the sum of my entries ... this was very strange ... then the unique way to fix that was do a file name long 12 character in this way in one shot was able to do the programming ...

very strange, maybe I've wrong something ?

Thanks
Gnux

Do you have the latest version?

I need to check,

I will try with the version indicate from you and then I'll let you know ...

another curiosity ... If i would like to program my micro via "serial" is possible ?

Thanks for the suggestion,
Gnux

Not with my sketch. It is designed for the SD card. But the Arduino as ISP sketch basically takes serial input.

Good Afternoon Nick,
sorry for the late but i was out of home for work and I'm came back only today ...

So I've tried but if you see the attchment is happening the same things ... I've tried to write SERIA.HEX and then I've give the ok but after is happened nothing ... very strange ...

anyway i will use in the other way ...

have nice week end,
Andrea

Schermata 2013-04-13 a 17.16.57.png

But you seem to have chosen (or typed): SERIA.HEXSER

so is not true ... I've type the first times ... but nothing happened, then I've type again and then the software has sum the both entry ... this is the strange ...