/*
 * ATmega128.c
 *
 * Created: 10-Jul-19 1:40:11 PM
 * Author : M19892
 */

#include <avr/io.h>
#include <avr/fuse.h>

//#define CKOPT // Uncomment for devices 1.x. Comment for devices 2.x

#ifdef CKOPT
FUSES =
{
	.extended = 0xFD,
	.high = 0x89,
	.low = 0xE9,
};
#endif

#ifndef CKOPT
FUSES =
{
	.extended = 0xFD,
	.high = 0x99,
	.low = 0xE9,
};
#endif

int main(void)
{
	// Crystal clock will be output on PORTB4 (divided by 2)
	DDRB |= (1 << 4);

	// Enable CTC mode with toggle on compare match. Precale 1 and top at 0
	OCR0 = 0;
	TCCR0 = (0 << COM01) | (1 << COM00) | (1 << WGM01) | (0 << WGM00) | (0 << CS02) | (0 << CS01) | (1 << CS00);

	while(1) {}
}