tarose78
Junior Member level 2
- Joined
- Jul 22, 2012
- Messages
- 23
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,441
Hi all,
I am building a very simple program using Atmega128 and CodeVision v2.05.3 with 11,059200Mhz crystal
I also configured at the project settings using the right CLOCK
Burned using USBASP with avrdude.
Below is the code...
I am expecting that the led1 is on at the first time followed by led2 is on then led3 is on at the next 100 ms.
But it doesnt work as I expected,
only led1 and led2 is on, but led3 is still off.
I am suggest that delay_ms() function is not working properly.
Am I missing something here ?
Please Help...
I am building a very simple program using Atmega128 and CodeVision v2.05.3 with 11,059200Mhz crystal
I also configured at the project settings using the right CLOCK
Burned using USBASP with avrdude.
Below is the code...
#include <mega128.h>
#include <delay.h>
#define led1_hi PORTA.7=1
#define led2_hi PORTA.6=1
#define led3_hi PORTA.5=1
#define led1_lo PORTA.7=0
#define led2_lo PORTA.6=0
#define led3_lo PORTA.5=0
//=========================================================================
void main(void)
{
DDRB.7=1;
DDRC.0=1;
DDRF|=(1<<0);
DDRA|=(1<<5);
DDRA|=(1<<6);
DDRA|=(1<<7);
led1_hi;
delay_us(10000);
led2_hi;
delay_ms(100);
led3_hi;
}
I am expecting that the led1 is on at the first time followed by led2 is on then led3 is on at the next 100 ms.
But it doesnt work as I expected,
only led1 and led2 is on, but led3 is still off.
I am suggest that delay_ms() function is not working properly.
Am I missing something here ?
Please Help...