Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined(__dsPIC33F__)
- #include "p33Fxxxx.h"
- #elif defined(__PIC24H__)
- #include "p24Hxxxx.h"
- #endif
- #include "math.h"
- // Internal FRC Oscillator
- _FOSCSEL(FNOSC_FRC);
- _FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_NONE);
- _FWDT(FWDTEN_OFF);
- _FICD(ICS_PGD3);
- void initPLL(void)
- {
- PLLFBD = 41;
- CLKDIVbits.PLLPOST = 0;
- CLKDIVbits.PLLPRE = 0;
- OSCTUN = 0;
- RCONbits.SWDTEN=0;
- __builtin_write_OSCCONH(0x01);
- __builtin_write_OSCCONL(0x01);
- while (OSCCONbits.COSC != 0b001);
- while(OSCCONbits.LOCK != 1) {};
- }
- int main(void)
- {
- initPLL();
- float i = 0;
- i = sin(45);
- int breakhere = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement