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.

ATMEGA128 programming problem

Status
Not open for further replies.

awaisaamir

Newbie level 6
Joined
Nov 14, 2012
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Rawalpindi, Pakistan
Activity points
1,357
hy

i recently start working with ATmega128 , i program it but i cant get output but in proteus it show output. i use avr studio 6

i post code here

Code:
#include <avr/io.h>

int main(void)
{
	
	DDRD=0xFF;
    while(1)
    {
        //TODO:: Please write your application code 
		PORTD=0xF0;
    }
}


thanks.
 
Last edited by a moderator:

I don't see anything wrong with the code, it sets PORTD as output ad then sets bits 7-6-5-4 to high.

What does proteus simulation show?
Have you loaded the hex/elf file correctly to the proteus mcu model?


EDIT: ok, you actually said hardware problem so I have no idea what can be wrong in order to make this not work.
If it was a clock problem you wouldn't be able to program the device.
 

hi
you r getting problem in proteus or in hardware?
 

He is not getting o/p in hardware.
 
  • Like
Reactions: ismbn

    ismbn

    Points: 2
    Helpful Answer Positive Rating
mega128 has three grounds and two Vcc and one AVcc , have you connected them all to power supply?
 

yes i connected all supply , controller is on but only JTAG pins are on HIGH state :(

- - - Updated - - -

this code is ok ??

- - - Updated - - -

what fuse setting should be for this code i am using 12 MHZ crystal oscillator
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top