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.

atmega32 program simulated using proteus

Status
Not open for further replies.

svsandeep99

Newbie level 3
Joined
Sep 17, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
hi friend
i am working on atmega 32. i have small doubt when i am executing this small program by using code vision for generating code and i have used this hex file in proteus.
PROGRAM:
while (1)
{
// Place your code here

if(PORTC.0=1)
{
PORTB.0=0;

}
else
{
PORTB.0=1;
}

}
i have kept port c and port b as
PORTC=0x00;
DDRC=0x00;
and
PORTB=0x00;
DDRB=0x01;

the problem is that if i connect c(0) pin to +5v or gnd the output is same
it is giving always 1.
kindly plz me.....
this will be useful for my project
 

pull up resistor on the c.0 10k to +5V./on the c.0 is button?/
 
thanks dude for reply but it is not working when i kept a 10k resistor
 

if(PORTC.0=1)

this is a perfect example where your unwillingness to learn the very basics will come back and hunt you.
 

this is a perfect example where your unwillingness to learn the very basics will come back and hunt you.
mr millwood thanks for ur reply i have wrote like that only in my program(PORTC.0==1)....
if u want u once try that one using code vision avr software and simulate in proteus.....

---------- Post added at 15:50 ---------- Previous post was at 15:48 ----------

try :

if(PINC.0==1)

thanks dude for helping i have AD coverter instead this program......
 

i have wrote like that only in my program(PORTC.0==1)....

that's another example of why not reading the datasheet will come back and bite you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top