Hi, my problems is that I can't detect a 0 in the register for IN PUT data, I only detec 1's This is my simple code:
int main()
{
int i;
MCF5282_GPIO_PBCDPAR = 0x00;
MCF5282_GPIO_DDRB = 0xFF;
MCF5282_GPIO_DDRC = 0x00;
MCF5282_GPIO_PORTB = 0x00;
MCF5282_GPIO_PORTCP = MCF5282_GPIO_PORTCP & 0x01;
while(1)
{
i = MCF5282_GPIO_PORTCP;
if(i = 0x00){
MCF5282_GPIO_PORTB = 0x55;
}
if(i = 0x01){
MCF5282_GPIO_PORTB = 0xAA;
}
}// Idle
return 0;
}
This program is very simple but I can't do that the register MCF5282_GPIO_PORTCP detect a cero, it only detect logic 1's