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.

CODEVISIONAVR code on hardware

Status
Not open for further replies.

vvarlord

Member level 4
Member level 4
Joined
Mar 15, 2012
Messages
74
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,288
Visit site
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:
#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 2 (1.8v~0v):
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);
}
}
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?
 

hi.
second code - portD configured as input, and for this configuration only pull-up resistor is available
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top