svsandeep99
Newbie level 3
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
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