0

Using atmel studio to write some beginner C for an atmega64 micro controller. To start off I wanted to read values from PINA, one's complement the values, write them out on PORTC.

Started off with

#include <avr/io.h>
int main(void)
{

DDRA = 0x00; //set PORTA to inputs
DDRC = 0xFF; //set PORTC to outputs
while(1)
{
    ~PINA; // one's  values of PORT A




}
return 0;
}

Not so sure how to write the value out to PORTC,

Can anyone guide me where to go from here?

Cheers james

Sim
  • 570
  • 1
  • 10
  • 22

1 Answers1

0

Assignment operator (just like you would do with any other port):

PORTC = ~PINA;
  • Wow thank the lord, cheers. Dunno why i didn't think of that! Only been doing C for a day – Sim May 05 '13 at 11:09