ATmega 128 development board Issue

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

Hi,

I have designed a mega128 development board. I tried to toggle LEDs but its not working. The schematic files (.jpg) are attached for reference.

Some board related info

Vcc = 5v, Crystal = 7.3728MHz
Peripherals present: FT232, DS1307, AT24C16

Few Components are not soldered on the board yet: These are as follows

1. Microcontroller reset circuit ( R10, C18)
2. pull ups for the I2C ( r2, r3)
3. LEDs ( D3,D4,D5, D6)
4. Ferrite bead L2 shorted ( due to non availability)

Fuse Bit Settings

I am using 7.3728 MHz crystal. The fuse bit settings, I have programmed are attached as .jpg file. Please see it

Q1. Is this setting correct for 7.3728MHz? If not please suggest the correct way.

I have verified that this is not a software (code) issue (by toggling LEDs on Mega32 board) using same type of code. It works fine.

The problem: Mega128 board
The port pins can be set or cleared. But they are not getting toggled.

Here is the code snippet to toggle LEDs.

while (1)
{

PORTC =0xff; // line 1
delay_ms(1000); // line 2
PORTC =0x00; // line 3
delay_ms(1000); // line 4
}

Here in this code

1. if I comment the line 1 & 2 , LEDs switch on.
2. Similarly LEDs are off when line 3 & 4 are commented and line 1 and 2 active.

Q2. How can I identify where the problem is?
Q3. How to resolve this issue?

Thanks in Advance :)

Attachment(s): 

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

I think SPIEN is not enabled?

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

You have a mega128. So clear the M103C compatibility fuse. Unless you want to be crippled.

The crystal fuse should be fine. But the 3.0-8.0MHz setting may be better.

None of your LEDs will light until you set DDRC to o/p mode.

If you are unsure on how AVRs work, you should get some experience with an existing development board.

David.

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

Add a 2..3 k resistor between the reset button/r/c and the Mega/ISP reset net.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Looks like JTAGEN fuse is set. Maybe disabling JTAG will help?

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

Thank you friends,

I have changed the fuse bit settings (w.r.t. David's suggestion) and the board is working fine.

Thanks !!!!

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

Wish I had a dollar for every tiro that has fallen into the ATmega128/64 103/603 compatibility fuse trap!
Unless you already have a product designed around the atmega128(A) or have a truckload of the chips on hand, you probably should consider the atmega128/A a 'mature' part near EOL. The ATmega1281 is 99.99% compatible with the atmega128 and offers an upgrade path to the atmega2561. I would not be surprised if Atmel discontinued the atmega64/128 parts tomorrow in favor pushing people over to the atmega641/1281.

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

Quote:

I would not be surprised if Atmel discontinued the atmega64/128 parts tomorrow in favor pushing people over to the atmega641/1281.

Well, I thought the Mega8 was on its way out when the 48/88/... family came online. But as with the 64/128 I think these have been very popular models over the years and thus Atmel keeps producing them.

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

theusch wrote:
Quote:

I would not be surprised if Atmel discontinued the atmega64/128 parts tomorrow in favor pushing people over to the atmega641/1281.

Well, I thought the Mega8 was on its way out when the 48/88/... family came online. But as with the 64/128 I think these have been very popular models over the years and thus Atmel keeps producing them.

Atmel is slowly increasing the price gap between the older and newer families. Witness the difference in cost between the atmega32 and atmega324 for example. This will drive the older familes out of new designs and Atmel will eventually discontinue them.