Atmega664 delay_ms doesn't work

General discussion on mikroBasic for AVR.
Post Reply
Author
Message
Harte
Posts: 2
Joined: 13 Feb 2011 13:36

Atmega664 delay_ms doesn't work

#1 Post by Harte » 25 Feb 2011 15:25

Hello,

i have got a big problem with my Atmega644 in my EasyAVR Board. I just wanted to blink the LEDs on PortC but in the delay funktion the controller stopps. I dont know why... I'm desperate... I've read about a M103C Fuse in the Atmega series perhaps this could be the problem, but I cant find it in the datasheet and avrflash doesn't provied an option to reset it.
This is the source code:
void main() {
DDRA = 0xFF; // Set direction to be output
DDRB = 0xFF; // Set direction to be output
DDRC = 0xFF; // Set direction to be output
DDRD = 0xFF; // Set direction to be output

do {
// Turn ON diodes on PORTA

PORTC = 0xFF;
Delay_ms(1000); // 1 second delay
PORTC = 0x00;
Delay_ms(1000);
} while(1); // Endless loop
}
Im working with the mikroC Pro for AVR IDE.
As described the controller turns all leds on PortC on, but then nothing more happens.

I have a other question. Does the hook in the AVRflash tool for the fuses mean
1. possibility: the fuse will be programmed (respectivly high or low)
2. possibility: the fuse will be written to 1

I added a picture of my Fuses, so you can tell me if they are right.
I appologize for my bad english, I'm no nativ speaker... :)

I hope you can help me. Thanks
Attachments
Picture of Fuses
Picture of Fuses
problem.jpg (179.43 KiB) Viewed 3263 times

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: Atmega664 delay_ms doesn't work

#2 Post by tihomir.losic » 25 Feb 2011 16:32

Hello,

in attachment is LED blinking project for ATmega644.
PORTA, PORTB, PORTC and PORTD blink, and there is no errors.

Best regards,

Losic Tihomir
Attachments
ATmega644_LED.rar
(16.41 KiB) Downloaded 319 times
mikroElektronika [Support team]

Post Reply

Return to “mikroBasic for AVR General”