ATMega128 not responding

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

Have programmed ATMega128 to flash LED but not responding. Though I have connected a external Crystal of 16MHz, presently on internal at 8MHz. Programming thro AVR studio using AVR ISP2 and takes me thru the process. Only LED not flashing. IOs  though pulled up are not 5V but 1.9V . Reset is also at 5V.

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

Sorry the crystal ball is in the shop, please post a picture of your setup, and/or provide a schematic and post a small complete program that demos the problem.

 

As you can see, it is impossible to provide an answer given the info so far....

 

Some suggestions:

check VCC has been connected to ALL VCC and AVCC pins

check ALL GND pins are connected to ground

check that there is a 0.1 uf (100nf) cap between each pair of VCC/AVCC = Gnd pins

check that you have the proper current limiting resistor in series with each LED (if vcc = 5v, 330 ohm is normal)

All port pins default to inputs, so did you set the DDR register to make your port pin an output?

 

 

Jim

edit: spelling

 

 

Last Edited: Thu. Sep 21, 2017 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
post a picture of your setup, and/or provide a schematic and post a small complete program that demos the problem

Absolutely - although I would say you should definitely post both the schematic and a photograph.

 

Instructions for posting pictures and code: http://www.avrfreaks.net/comment...

 

 

The ATMega128 has on-chip debug - use it!

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

There is a lot we don't know; some of the questions have already been presented.

 

Some other common '128 issues:

 

--

K.Chandramohan wrote:
Have programmed ATMega128 to flash LED

I'd like to know about ISP connections, and see the log of the "programming".

 

-- M103C fuse is set by default -- has it been cleared?

 

-- What clock source is being used for the '128?

 

-- Is the device ever coming out of reset?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

0.1 mfd cap connected between Vcc and GND.LEDs have current limiting resistor (1K). All DDRs are in Output mode (1). PORTs all pulled up. ISP connected to UART and not SPI being 128, to which the programmer (AVR ISP II) is responding. M103 fuse cleared to operate as 128. On internal Oscillator of 8MHz. Reset pin shows 5 Volts. 

 AVCC is not connected to 5 Volts as no ADC used. Is it necessary to connect to 5V?

 

Any more suggestions please.

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

K.Chandramohan wrote:
 AVCC is not connected to 5 Volts as no ADC used. Is it necessary to connect to 5V?

According to the datasheet, it is strongly suggested you connect this!

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

Quote:

ATMega128 not responding

 

K.Chandramohan wrote:

Have programmed ATMega128 to flash LED but not responding. ...

 

K.Chandramohan wrote:

...being 128, to which the programmer (AVR ISP II) is responding. ...

 

So, to be clear, the m128 IS responding; it's just that your code doesn't work?

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

K.Chandramohan wrote:
Any more suggestions please

More?

 

You haven't supplied what was originally asked yet

  • A schematic (don't mess about trying to describe circuits in words)
  • Code
  • Photograph(s)
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Connecting AVcc to 5V made the difference. All pulled up PORT pins showed 5V which was about 0.9 to 2V. The LEDs began to respond indicating ATMega 128 is active.

 

Thank you all

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

From the datasheet:

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Brian Fairchild wrote:

So, to be clear, the m128 IS responding; it's just that your code doesn't work?

Details, details...

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

So I nailed it with my first suggestion in reply #2!!!! smiley