// STATUS : A VERIFIER
// CONFIG oscillateur interne (pas besoin de quartz) +PLL


#include <p33FJ64MC802.h>
#include <stdio.h>
#include <timer.h>


_FOSCSEL(FNOSC_FRCPLL); // FRC + PLL
_FOSC( POSCMD_NONE &OSCIOFNC_OFF&FCKSM_CSDCMD);		// Primary disabled Oscillator & OSC2 is clock O/P &  Both disabled (pas de switching)
_FWDT(FWDTEN_OFF); 


}

void InitClock2() {
	// ICI Fosc= 7.37M * 8/4 = 14.6 Mhz
	PLLFBD = 6;	// M = 8
	CLKDIVbits.PLLPOST = 0;	// N1 = 2
	CLKDIVbits.PLLPRE = 0;	// N2 = 2
	OSCTUN = 0;
	RCONbits.SWDTEN = 0;

	while(OSCCONbits.LOCK != 1) {}; // ATTENTE VERROUILLAGE PLL
}

int main (void)
{
	InitClock2() ;
	TRISBbits.TRISB0=0;
	AD1PCFGLbits.PCFG2=1;
	for (;;)
		PORTBbits.RB0=!PORTBbits.RB0; // 


}





