My ATmega64 is not functioning properly after getting programmed completely

Status
Not open for further replies.

adityaheroes

Newbie level 2
Joined
Jan 26, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,296
Hey! I am facing a weird problem from my ATmega64. The IC is getting programmed but the code or for that matter any code is not working on it.. that includes even toggling any pin on the board.:-(. I want suggestions asap so that i can correct in time. Thank you in advance.
 

I have done the coding in CodeVisionAVR. I have the pcb board in eagle and basic hex file which says "PORTA =1". Although it was only for testing purposes.. even though it was programmed using sinaprog still it was not working and it was not just the PORTA, none of the PORTs of the IC are working. If i mail u these will it be alright?

- - - Updated - - -

Both the usernames are mine. Had to change for a reason.
 

Maybe try some different code because PORTA =1 just enables the pullup of port A bit 0

This code turns all ports to outputs and blinks them but be careful if you have anything connected to the pins when you use them as outputs.

Code:
#include <mega64.h>
#include <delay.h>

void main(void)
{

DDRA=0xff;
DDRB=0xff;
DDRC=0xff;
DDRD=0xff;
DDRE=0xff;
DDRF=0xff;
DDRG=0x1f;

while (1)
      {
		PORTA ^= 0xff;
		PORTB ^= 0xff;
		PORTC ^= 0xff;
		PORTD ^= 0xff;
		PORTE ^= 0xff;
		PORTF ^= 0xff;
		PORTG ^= 0x1f;	  
	
		delay_ms(500);
      }
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…