Es stellt sich die Frage, ob Du weißt was
Code:
if ( i = 0x80)
bedeutet.
Das ist Käse, weil diese Bedienung ist nur dann erfüllt, wenn PA7 High und alle anderen Pins Lows sind.
Besser wäre z.B.

Code:
if ( i & (1<<PA7) )
zu schreiben, hier Prüfst Du nur Pin 7 ab, der Rest ist egal.

Aber Bleib mal bei Deinem Pin0 und versuche es mal so :
Code:
#include <avr/io.h>

int main(void)
{
  int i;
  DDRC = 0xff;  // PORTC als Ausgang
  DDRA = 0x00;  // PORTA als Eingang
  PORTA = (1<<PA0);
  while (1)
 
  {
    i=PINA;
     if(i & (1<<PA0))
     {
   PORTC = 0x00;
   }
   else
      {
      PORTC = 0xff;
      }
 
    }
}
und dann hälst Du Pin0 vom PortA mal an 5V und mal an GND.

Schauen wir mal was Passiert.

Gruß Sebastian