Can program ATmega128 Header board BUT program doesnt run

Hi

I’m using the H128 header board for atmega128 from olimex with a AVRPG2 parallel port prgrammer. This is really a newbie qn so pls excuse me.

I am able to Program the Atmega128 successfully using linux,avr-gcc,uisp. BUT no program is able to run .

I checked the ~RESET Pin and have found it to be low after the programming.Even on the scope it is a continous low. How is it being held low?

Is this why the program isnt executing? I recycled power after programming : but the problem still exists.

Do i have to disconnect the programming dongle header ICSP-10 from the board after i programmed it?. That doesnt make sense to me though.

The power supply is clean and so there is no reason for the MCU to reset.

This is the schematic:

http://www.olimex.com/dev/images/avr-h103b-sch.gif

I have disconnected Jumper J1 as i am using direct 5 volts to pin 52 of atmega128

Pls advise as to what i am doing wrong.

This is the program i am starting with:

#include

#include

int main(void)

{

DDRD = 0x01;

PORTD = 0xFF;

return 1;

}

Any advice shall be appreciated

Thanks a lot

Hi,

you can’t run your code if your programmer is attached as AVR-PG2B will hold AVR in reset as you have noticed.

This is programmer not debugger and it’s not supposed to stay connected to AVR when you want to run AVR

Tsvetan

OLIMEX:
This is programmer not debugger and it’s not supposed to stay connected to AVR when you want to run AVR

Is this what JTAG is for?

Is that really the code you’re trying? Something like this makes more sense to me:

#include “avr/io.h”

int main(void)

{

DDRD |= 0x01;

PORTD |= 0x01;

while(1);

return 0; //you never go here

}

andrey is right. It looks like your code actually DOES run, but exits almost immediately.