/*
* File: Math Test.c
* Author: chris
* Just a simple Math Test
* Created on September 26, 2014, 6:23 AM
*/
// Include Header Files
#include <xc.h> // will include chip specific header file
#include <plib.h> / include peripheral library functions
#include<p32xxxx.h>
// Configuration Bits
#pragma config FNOSC = FRCPLL
// Internal Fast RC oscillator (8 MHz) w/ PLL
#pragma config FPLLIDIV = DIV_2
// Divide FRC before PLL (now 4 MHz)
#pragma config FPLLMUL = MUL_20
// PLL Multiply (now 80 MHz)
#pragma config FPLLODIV = DIV_2
// Divide After PLL (now 40 MHz)
#pragma config FWDTEN = OFF // Watchdog Timer Disabled
#pragma config ICESEL = ICS_PGx1 // ICE/ICD Comm Channel Select
#pragma config JTAGEN = OFF // Disable JTAG
#pragma config FSOSCEN = OFF // Disable Secondary Oscillator
#pragma config FPBDIV = DIV_1 // PBCLK = SYCLK
// Defines
#define SYS_FREQ (40000000L)
main() {
SYSTEMConfig(SYS_FREQ, 0);
mPORTAClearBits(BIT_0); //Clear bits to ensure light is off.
mPORTASetPinsDigitalOut(BIT_0); //Set port as output
int i;
int j;
int k;
while(1) { //
i = 2048;
j = 2048;
mPORTAToggleBits(BIT_0);
k = i*j;
mPORTAToggleBits(BIT_0);
}
}