Go Down

Topic: Unsuccessfully Trying to Program atmega8L using mega2560 Nick Gammon sketches (Read 590 times) previous topic - next topic

azhaque

Hi,

I am trying to program an atmega8L using Nick Gammon's sketches. The Atmega8L is part of a diy USBasp pcb from fischl.de.

For reference the usbasp circuit is as below




Now I have connected an arduino mega2560 as per Nick Gammon's website. The scheme of connections is as follows:



Mega2560      Target(Pin No. of Mega8L on USBasp)   
                 
  D10     to   Reset(Pin1)     
  D51     to   MOSI(Pin17)     
  D50     to   MISO(Pin18)   
  D52     to   SCK (Pin19)(JP1-1: Jumper in place)   
         
  Gnd     to    Gnd (Pin8)                   
  +5V     to   +5V (Pin7) (JP1-2: Jumper in place)


   
When I run the sketch the following is output on the serial monitor:

Atmega fuse calculator.
Written by Nick Gammon.
Version 1.11
Compiled on Apr 23 2017 at 12:00:55 with Arduino IDE 10612.
Attempting to enter programming mode ....
Entered programming mode OK.
Signature = 0x1E 0x93 0x07
Processor = ATmega8A
Flash memory size = 8192
LFuse = 0x00
HFuse = 0xD9
EFuse = 0x00
Lock byte = 0x00
Clock calibration = 0xA9
External Reset Disable.................. [ ]
Watchdog Timer Always On................ [ ]
Self Programming Enable................. [X]
Oscillator Options...................... [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [ ]
Brown out detector level................ [X]
Brown out detector enable............... [X]
Bootloader size: 2048 bytes.
Start-up time: SUT0: [X]  SUT1: [X] (see datasheet)
Clock source: external clock.


However I am unable to load the USbasp hexfile thru the mega2560.

Please help.

TIA

azhaque


azhaque

UPDATE

Substantive progress. The issue was a poor connection.

OUTPUT..................

Atmega chip detector.
Written by Nick Gammon.
Version 1.20
Compiled on Apr 23 2017 at 18:46:50 with Arduino IDE 10612.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x93 0x07
Processor = ATmega8A
Flash memory size = 8192 bytes.
LFuse = 0xE4
HFuse = 0xCA
EFuse = 0xFF
Lock byte = 0xCF
Clock calibration = 0xA9
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: Yes
Bootloader is 1024 bytes starting at 1C00

Bootloader:

1C00: 0x12 0xC0 0x2B 0xC0 0x2A 0xC0 0x29 0xC0 0x28 0xC0 0x27 0xC0 0x26 0xC0 0x25 0xC0
1C10: 0x24 0xC0 0x23 0xC0 0x22 0xC0 0x21 0xC0 0x20 0xC0 0x1F 0xC0 0x1E 0xC0 0x1D 0xC0
1C20: 0x1C 0xC0 0x1B 0xC0 0x1A 0xC0 0x11 0x24 0x1F 0xBE 0xCF 0xE5 0xD4 0xE0 0xDE 0xBF
1C30: 0xCD 0xBF 0x10 0xE0 0xA0 0xE6 0xB0 0xE0 0xE8 0xEE 0xFF 0xE1 0x02 0xC0 0x05 0x90
1C40: 0x0D 0x92 0xA2 0x36 0xB1 0x07 0xD9 0xF7 0x11 0xE0 0xA2 0xE6 0xB0 0xE0 0x01 0xC0
1C50: 0x1D 0x92 0xAA 0x36 0xB1 0x07 0xE1 0xF7 0x4F 0xC0 0xD2 0xCF 0xEF 0x92 0xFF 0x92
1C60: 0x0F 0x93 0x1F 0x93 0xEE 0x24 0xFF 0x24 0x87 0x01 0x13 0xC0 0x08 0x94 0xE1 0x1C
1C70: 0xF1 0x1C 0x01 0x1D 0x11 0x1D 0x81 0xE0 0xE8 0x16 0x82 0xE1 0xF8 0x06 0x8A 0xE7
1C80: 0x08 0x07 0x80 0xE0 0x18 0x07 0x28 0xF0 0xE0 0x91 0x62 0x00 0xF0 0x91 0x63 0x00
1C90: 0x09 0x95 0x5F 0x9B 0xEB 0xCF 0x8C 0xB1 0x99 0x27 0x87 0xFD 0x90 0x95 0x1F 0x91
1CA0: 0x0F 0x91 0xFF 0x90 0xEF 0x90 0x08 0x95 0x5D 0x9B 0xFE 0xCF 0x8C 0xB9 0x08 0x95
1CB0: 0xD5 0xDF 0x80 0x32 0x21 0xF4 0x84 0xE1 0xF7 0xDF 0x80 0xE1 0xF5 0xDF 0x08 0x95
1CC0: 0x1F 0x93 0x18 0x2F 0xCB 0xDF 0x80 0x32 0x31 0xF4 0x84 0xE1 0xED 0xDF 0x81 0x2F
1CD0: 0xEB 0xDF 0x80 0xE1 0xE9 0xDF 0x1F 0x91 0x08 0x95 0x1F 0x93 0xCF 0x93 0xDF 0x93
1CE0: 0x18 0x2F 0xC0 0xE0 0xD0 0xE0 0x02 0xC0 0xB9 0xDF 0x21 0x96 0xC1 0x17 0xE0 0xF3
1CF0: 0xDF 0x91 0xCF 0x91 0x1F 0x91 0x08 0x95 0xCF 0xE5 0xD4 0xE0 0xDE 0xBF 0xCD 0xBF
1D00: 0x00 0x00 0x10 0xBC 0x83 0xE3 0x89 0xB9 0x88 0xE1 0x8A 0xB9 0x86 0xE8 0x80 0xBD
1D10: 0xBD 0x9A 0x10 0x92 0x68 0x01 0x30 0xE2 0xE0 0xE0 0xF0 0xE0 0x2F 0xE0 0x88 0xB3
1D20: 0x83 0x27 0x88 0xBB 0xCF 0x01 0x01 0x97 0xF1 0xF7 0x21 0x50 0x27 0xFF 0xF7 0xCF
1D30: 0x20 0xE1 0x20 0x93 0x68 0x01 0x92 0xDF 0x80 0x33 0x81 0xF1 0x81 0x33 0x99 0xF4
1D40: 0x8D 0xDF 0x80 0x32 0xC1 0xF7 0x84 0xE1 0xAF 0xDF 0x81 0xE4 0xAD 0xDF 0x86 0xE5
1D50: 0xAB 0xDF 0x82 0xE5 0xA9 0xDF 0x80 0xE2 0xA7 0xDF 0x89 0xE4 0xA5 0xDF 0x83 0xE5
1D60: 0xA3 0xDF 0x80 0xE5 0xC7 0xC0 0x80 0x34 0x29 0xF4 0x78 0xDF 0x86 0x38 0xB0 0xF0
1D70: 0x75 0xDF 0x14 0xC0 0x81 0x34 0x71 0xF4 0x71 0xDF 0x80 0x38 0x11 0xF4 0x82 0xE0
1D80: 0x1D 0xC1 0x81 0x38 0x11 0xF4 0x81 0xE0 0x19 0xC1 0x82 0x38 0x09 0xF0 0x15 0xC1
1D90: 0x82 0xE1 0x14 0xC1 0x82 0x34 0x21 0xF4 0x84 0xE1 0x9F 0xDF 0x89 0xDF 0xCB 0xCF
1DA0: 0x85 0x34 0x11 0xF4 0x85 0xE0 0xF9 0xCF 0x80 0x35 0xC1 0xF3 0x81 0x35 0xB1 0xF3
1DB0: 0x82 0x35 0xA1 0xF3 0x85 0x35 0x39 0xF4 0x51 0xDF 0x80 0x93 0x64 0x00 0x4E 0xDF
1DC0: 0x80 0x93 0x65 0x00 0xEB 0xCF 0x86 0x35 0x19 0xF4 0x84 0xE0 0x86 0xDF 0xF5 0xC0
1DD0: 0x84 0x36 0x09 0xF0 0x93 0xC0 0x42 0xDF 0x80 0x93 0x67 0x01 0x3F 0xDF 0x80 0x93
1DE0: 0x66 0x01 0x80 0x91 0x69 0x01 0x8E 0x7F 0x80 0x93 0x69 0x01 0x37 0xDF 0x85 0x34
1DF0: 0x29 0xF4 0x80 0x91 0x69 0x01 0x81 0x60 0x80 0x93 0x69 0x01 0xC0 0xE0 0xD0 0xE0
1E00: 0x06 0xE6 0x10 0xE0 0x05 0xC0 0x2A 0xDF 0xF8 0x01 0x81 0x93 0x8F 0x01 0x21 0x96
1E10: 0x80 0x91 0x66 0x01 0x90 0x91 0x67 0x01 0xC8 0x17 0xD9 0x07 0xA0 0xF3 0x1E 0xDF
1E20: 0x80 0x32 0x09 0xF0 0x88 0xCF 0x80 0x91 0x69 0x01 0x80 0xFF 0x1F 0xC0 0x20 0xE0
1E30: 0x30 0xE0 0xE6 0xE6 0xF0 0xE0 0x12 0xC0 0xA0 0x91 0x64 0x00 0xB0 0x91 0x65 0x00
1E40: 0x81 0x91 0x08 0x2E 0xC5 0xD0 0x80 0x91 0x64 0x00 0x90 0x91 0x65 0x00 0x01 0x96
1E50: 0x90 0x93 0x65 0x00 0x80 0x93 0x64 0x00 0x2F 0x5F 0x3F 0x4F 0x80 0x91 0x66 0x01
1E60: 0x90 0x91 0x67 0x01 0x28 0x17 0x39 0x07 0x38 0xF3 0x43 0xC0 0xF8 0x94 0xE1 0x99
1E70: 0xFE 0xCF 0x11 0x27 0xE0 0x91 0x64 0x00 0xF0 0x91 0x65 0x00 0xEE 0x0F 0xFF 0x1F
1E80: 0xC6 0xE6 0xD0 0xE0 0x80 0x91 0x66 0x01 0x90 0x91 0x67 0x01 0x80 0xFF 0x01 0xC0
1E90: 0x01 0x96 0x10 0x30 0x51 0xF4 0x22 0xD0 0x03 0xE0 0x00 0x93 0x57 0x00 0xE8 0x95
1EA0: 0x1D 0xD0 0x01 0xE1 0x00 0x93 0x57 0x00 0xE8 0x95 0x09 0x90 0x19 0x90 0x16 0xD0
1EB0: 0x01 0xE0 0x00 0x93 0x57 0x00 0xE8 0x95 0x13 0x95 0x10 0x32 0x58 0xF0 0x11 0x27
1EC0: 0x0D 0xD0 0x05 0xE0 0x00 0x93 0x57 0x00 0xE8 0x95 0x08 0xD0 0x01 0xE1 0x00 0x93
1ED0: 0x57 0x00 0xE8 0x95 0x32 0x96 0x02 0x97 0x39 0xF0 0xDB 0xCF 0x00 0x91 0x57 0x00
1EE0: 0x01 0x70 0x01 0x30 0xD9 0xF3 0x08 0x95 0x10 0x30 0x11 0xF0 0x02 0x96 0xE7 0xCF
1EF0: 0x11 0x24 0x84 0xE1 0xD9 0xDE 0x80 0xE1 0xD7 0xDE 0x1D 0xCF 0x84 0x37 0x09 0xF0
1F00: 0x4B 0xC0 0xAC 0xDE 0x80 0x93 0x67 0x01 0xA9 0xDE 0x80 0x93 0x66 0x01 0xA6 0xDE
1F10: 0x90 0x91 0x69 0x01 0x85 0x34 0x21 0xF4 0x91 0x60 0x90 0x93 0x69 0x01 0x0D 0xC0
1F20: 0x9E 0x7F 0x90 0x93 0x69 0x01 0x80 0x91 0x64 0x00 0x90 0x91 0x65 0x00 0x88 0x0F
1F30: 0x99 0x1F 0x90 0x93 0x65 0x00 0x80 0x93 0x64 0x00 0x90 0xDE 0x80 0x32 0x09 0xF0
1F40: 0xFA 0xCE 0x84 0xE1 0xB1 0xDE 0xC0 0xE0 0xD0 0xE0 0x1E 0xC0 0x80 0x91 0x69 0x01
1F50: 0x80 0xFF 0x07 0xC0 0xA0 0x91 0x64 0x00 0xB0 0x91 0x65 0x00 0x31 0xD0 0x80 0x2D
1F60: 0x08 0xC0 0x81 0xFD 0x07 0xC0 0xE0 0x91 0x64 0x00 0xF0 0x91 0x65 0x00 0xE4 0x91
1F70: 0x8E 0x2F 0x9A 0xDE 0x80 0x91 0x64 0x00 0x90 0x91 0x65 0x00 0x01 0x96 0x90 0x93
1F80: 0x65 0x00 0x80 0x93 0x64 0x00 0x21 0x96 0x80 0x91 0x66 0x01 0x90 0x91 0x67 0x01
1F90: 0xC8 0x17 0xD9 0x07 0xD8 0xF2 0xAF 0xCF 0x85 0x37 0x61 0xF4 0x5F 0xDE 0x80 0x32
1FA0: 0x09 0xF0 0xC9 0xCE 0x84 0xE1 0x80 0xDE 0x8E 0xE1 0x7E 0xDE 0x83 0xE9 0x7C 0xDE
1FB0: 0x87 0xE0 0xA0 0xCF 0x86 0x37 0x09 0xF0 0xBE 0xCE 0x80 0xE0 0x81 0xDE 0xBB 0xCE
1FC0: 0xE1 0x99 0xFE 0xCF 0xBF 0xBB 0xAE 0xBB 0xE0 0x9A 0x11 0x96 0x0D 0xB2 0x08 0x95
1FD0: 0xE1 0x99 0xFE 0xCF 0xBF 0xBB 0xAE 0xBB 0x0D 0xBA 0x11 0x96 0x0F 0xB6 0xF8 0x94
1FE0: 0xE2 0x9A 0xE1 0x9A 0x0F 0xBE 0x08 0x95 0x80 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
1FF0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF

MD5 sum of bootloader = 0x98 0x6D 0xCF 0xBB 0x55 0xE1 0x22 0x1E 0xE4 0x3C 0xC2 0x07 0xB2 0x2B 0x46 0xAE
Bootloader name: ATmegaBOOT

First 256 bytes of program memory:

00: 0xFF 0xFF 0xFF 0xF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F 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
D0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
E0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
F0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF

Programming mode off.


Now when I connect the usbasp directly to the computer USB port Windows-7 shows an error.

What am I doing wrong?

azhaque

kprims

"What am I doing wrong?"

Looks to me you have loaded a bootloader instead of the complete usbasp firmware.

http://www.nexuscyber.com/boards/topic/1/how-to-use-arduino-uno-upgrade-usbasp-firmware

If you want a more up to-date Usbasp firmware check this out.

https://forum.arduino.cc/index.php?topic=363772.0

You may have to set the fuses also since yours is diy.
my usbasp fuses:

avrdude: Device signature = 0x1e9307 (probably m8)
avrdude: safemode: hfuse reads as D9

avrdude: safemode: hfuse reads as D9
avrdude: safemode: Fuses OK (E:FF, H:D9, L:9F)

azhaque


Go Up