Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ATmega 8 lock bits issue

Status
Not open for further replies.

debojitk

Newbie level 3
Newbie level 3
Joined
May 14, 2013
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,317
Hi,

i am trying to burn bootloader on atmega8l with arduinoISP. I connected 17,18,19 of atmega8 (mosi, miso, sck) with 11,12,13 pin of arduino. reset pin of atmega8 to pin 10 of arduino. a 10uf cap between reset and ground. No external crystal, as i was using internal crystal oscillator.
I was successfully able to burn bootloader on the atmega8. But today onwards i am getting very weird device signature mismatch issue on avrdude while trying to upload bootloader. Then I used -F option and got follwoing error:

Code:
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading |                                                    | 0% 0.00savrdude: Send: V [56] X [58] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0x00
avrdude: verification error; content mismatch
.

I am using follwoing command line for avrdude:
Code:
avrdude -Cavrdude.conf -e -F -v -v -v -v -patmega8 -cstk500v1 -P\\.\COM6 -b19200 -e -Ulock:w:0x3F:m -Uhfuse:w:0xc4:m -Ulfuse:w:0xe4:m.
The board info from arduino i am using is:
Code:
atmega8noxtal.name=ATmega8-noxtal @8MHz

atmega8noxtal.upload.protocol=stk500
atmega8noxtal.upload.maximum_size=7168
atmega8noxtal.upload.speed=38400

atmega8noxtal.bootloader.low_fuses=0xe4
atmega8noxtal.bootloader.high_fuses=0xc4
atmega8noxtal.bootloader.path=atmega8_noxtal
atmega8noxtal.bootloader.file=ATmegaBOOT.hex
atmega8noxtal.bootloader.unlock_bits=0x3F
atmega8noxtal.bootloader.lock_bits=0x0F

atmega8noxtal.build.mcu=atmega8
atmega8noxtal.build.f_cpu=8000000L
atmega8noxtal.build.core=arduino
atmega8noxtal.build.variant=standard

I am no more able to burn bootloader to the chip. How should I counter this issue.
Please help.
Thanks in advance.
Debojit
 

Hi,
I have narrowed down the problem.
1. The device signature is read as 0x000000
2. Erasing seems to be working correctly with -e switch with avrdude
3. Writing any of the lock/fuse bits results in failure

PFB the avrdude logs:
Code:
G:\debojit\electronics project\arduino-1.0.4-windows\arduino-1.0.4\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.conf -v -p atmega8 -c avrisp -P \\.\COM6 -b 19200 -U lock:w:0x3F:m -F -V

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "..\etc\avrdude.conf"

         Using Port                    : \\.\COM6
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
         AVR Part                      : ATMEGA8
         Chip Erase delay              : 10000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom         4    20   128    0 no        512    4      0  9000  9000 0xff 0xff
           flash         33    10    64    0 yes      8192   64    128  4500  4500 0xff 0x00
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel AVR ISP
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.09s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA8 is 1E 93 07
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |                                                    | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.17s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

All the fuses are set as 0x00, but when it is tried being overwritten, it results in writing failure.
But the thing is: with the same chip connection i was able to burn bootloader on the chip. I have two atmega and both of them are behaving in the same way.
One more thing: When I remove the mosi miso sck connections (only arduino's 10 is connected to reset pin of target atmega-pin 1), the same error comes out; seems no connection are there between atmega's 17,18,19 and arduino's 11,12, and 13. However i have checked the connection atleast 100 times, even with digital multimeter, and they are fine. To disable auto reset on serial connection on arduino, i added 10uf between pin-1 and ground, and 110 ohm between pin-1 and Vin. Also for the target atmega i have added a 10k between pin-1 and Vin. I am not able to figure out why device signature is coming as 0x000000. Did I brick the chip. And if it is bricked, what wrong i would have done. I need to know this because if i buy new costlier chips (atmega328) i should not damage the chip.
Please help.
Thanks in advance.
Debojit
 

Please anyone reply. I am pretty hopeful that i would get a solution here.

I more info: I am powering the arduino and the target atmega both with computer usb power only. Can it be a issue of lack of enough power.

Please help.
 

a 10uf cap between reset and ground.

Seems too large. Can you 0.1 uf or recommended in the data sheet / application note of AVR Microcontrollers
 

So you all think these are happening because of the auto reset issue. It does mean if i use parallel programmer these issue should not occur.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top