/************************************************************************ * * * Title: test_atmel.c * * Programmer: A. Antonio Arroyo {from code by Adam Barnett} * * Date: February 19, 2008 * * Version: 1.0 * * * * Description: * * Verifies the BDMICRO MAVRICII Board w/ an ATmel ATMega128 is working* ************************************************************************/ /*************************** Includes ********************************/ #include int main(void) { unsigned int temp = 0; long i = 0, j = 0; DDRE = 0xFF; // set portE to output //DDRG = 0b11111111; // set portG to output DDRB = 0xFF; // set PortB to output while(1) { PORTE = 0xAA; // set all pins on portE to 5v temp = PINB; // read portB, store value to temp PORTB = !(temp); // complement portB and write back while (i < 100) //dummy counter to wait clock cycles { while( j < 5000) { j++; } j=0; i++; } i = 0; } return 0; }