Would you help me? : about Atmega128 error

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

I am an amateur who just started atmega128 yesterday. I'm trying to turn on the led, but it's not working. I don't know what's wrong.  I'd really really appreciate it if you could tell me what went wrong. 

 

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9702 (probably m128)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "c:\users\송이두\Documents\Atmel Studio\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex"
avrdude.exe: writing flash (174 bytes):

Writing | ################################################## | 100% 0.16s

avrdude.exe: 174 bytes of flash written
avrdude.exe: verifying flash memory against c:\users\송이두\Documents\Atmel Studio\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex:
avrdude.exe: load data flash data from input file c:\users\송이두\Documents\Atmel Studio\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex:
avrdude.exe: input file c:\users\송이두\Documents\Atmel Studio\7.0\GccApplication4\GccApplication4\Debug\GccApplication4.hex contains 174 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.13s

avrdude.exe: verifying ...
avrdude.exe: 174 bytes of flash verified

avrdude.exe: safemode: Fuses OK (E:FF, H:C9, L:FF)

avrdude.exe done.  Thank you.

 

 

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

Welcome to AVRFreaks!

 

chobo wrote:
 I'm trying to turn on the led, but it's not working

You show only  the output of AVRDude, and all is ok with flashing your code to the device, Note: you can ignore the warning on the first line about sck period, your using a Chinese made USBasp, the 

firmware on these are different then the German made USBasp firmware that AVRDude is expecting.

 

So that leaves us with "not working", that is not much of an error report, I'll assume you mean your LED is not blinking, but you need to be clear about what "not working" means....

Use the code editor in the menu above the comment box when you reply with your code, it's icon looks like "<>", two places to the right of the smiley face icon, this will preserve your code and spacing when posting.

 

Jim

 

 

FF = PI > S.E.T

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
I really appreciate your advice , thank you!!

 

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

chobo wrote:
 I'm trying to turn on the led, but it's not working. I don't know what's wrong. 
as Jim says you haven't actually said how it is "not working". also it might be an idea to show us both the code and a quick sketch/picture to show ho your have the LED connected to the 128.

 

As it is a 128 I will point out that the very first "gotcha" for most people is that brand new mega128's are really mega103's . You actually have to program something (a fuse) to say "stop being a 103 and start being a 128". If you don't do that most things will not work as expected 

 

(the alternative is to actually build the code as if it were a 103 but you probably don't want to do that!!)

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

clawson wrote:
. You actually have to program something (a fuse) to say "stop being a 103 and start being a 128"

chobo wrote:
avrdude.exe: safemode: Fuses OK (E:FF, H:C9, L:FF)

This seems to confirm the M128(A) is configured correctly!  external XTAL, JTAG enabled, and 103 disabled!

 

 

FF = PI > S.E.T

 

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

Is the problem solved now? I think you'll get more responses if you share your ckt diagram too. The messages shows that your code have been successfully loaded to the microcontroller. Still, if it does not give you the desired result, then there are many things to consider. Such as, the power supply, the fuse bits of the microcontroller, circuit connections etc. What the other users have said above, should be taken into consideration too. 

 

By the way, if you ever decide to make a PCB of your project, this write-up will be helpful: https://pcbtracks.com/how-to-man...