vvarlord
Member level 4
- Joined
- Mar 15, 2012
- Messages
- 74
- Helped
- 4
- Reputation
- 8
- Reaction score
- 3
- Trophy points
- 1,288
- Activity points
- 1,756
hi
i'm writing codes using codevisionavr c compiler for atmega 8 and then program it on the atmega using stk500/isp programmer on an atmega8
the problem is i've got 2 simple codes, for making PORTD.2 pin of avr 1 and 0, and toggle it continiuesly.
the two codes are exactly the same but one of the makes the pin 5 volts and 0 volts , and the other one makes it 1.8 volts and 0 volts
the hardware and setting of codeviosion for both are the same but two diffrent results is wierd.
code 1 (5v~0v):
code 2 (1.8v~0v):
any help would be appreciated.
- - - Updated - - -
i've also run those codes on the same hardware in simiulation of isis proteus , and incredibely got 2 diffrent results
i've tried to run codevisionavr wizard to create the codes but it gives me the (1.8v~0v) result.
could my codevisionavr software been corrupted?
i'm writing codes using codevisionavr c compiler for atmega 8 and then program it on the atmega using stk500/isp programmer on an atmega8
the problem is i've got 2 simple codes, for making PORTD.2 pin of avr 1 and 0, and toggle it continiuesly.
the two codes are exactly the same but one of the makes the pin 5 volts and 0 volts , and the other one makes it 1.8 volts and 0 volts
the hardware and setting of codeviosion for both are the same but two diffrent results is wierd.
code 1 (5v~0v):
Code:
#include <delay.h>
#include <mega8.h>
void main(void)
{
DDRD=0x04;
while(1)
{PORTD.2=0;
delay_ms(100);
PORTD.2=1;
delay_ms(100);
}}
Code:
#include <delay.h>
#include <mega8.h>
void main(void)
{
DDRB=0x04;
while(1)
{PORTD.2=0;
delay_ms(100);
PORTD.2=1;
delay_ms(100);
}
}
- - - Updated - - -
i've also run those codes on the same hardware in simiulation of isis proteus , and incredibely got 2 diffrent results
i've tried to run codevisionavr wizard to create the codes but it gives me the (1.8v~0v) result.
could my codevisionavr software been corrupted?