#include <p24fj128ga010.h>						//(1)

_CONFIG1(JTAGEN_OFF & FWDTEN_OFF)				//(2)
_CONFIG2(FNOSC_FRCPLL & OSCIOFNC_OFF)			//(3)

void delay(void)								//(4)
{
	int i=0;

	while(i++<20000);
}

int main (void)
{
	char i;

	//FRC postscaler divided by 1 (8MHz from internal RC)
	CLKDIV = 0x0000;							//(5)

	LATD  = 0xFFFF;								//(6)
	TRISD = 0xFFF0;								//(7)

	for(;;){
		for (i=0; i<16; i++)
		{
			LATD = i;							//(8)
			delay();
		}
	}

	return (0);
}
