the problem is
is this mean the program wont execute??
how to enable it??
what about the eeprom data??
// Include the neccesary header files
#include <p30F2012.h>
#include <libpic30.h>
/*******************************************************************************
* DEVICE CONFIGURATION WORDS *
*******************************************************************************/
// Primary Oscillator Mode = HS.
// Clock Switching and Monitor = Off.
_FOSC(CSW_FSCM_OFF & HS);
// Watchdog Timer = Off.
_FWDT(WDT_OFF);
// Brown Out Reset = Off.
// POR Timer Value = Off.
// Master Clear = Enabled.
_FBORPOR(PBOR_OFF & PWRT_OFF & MCLR_EN);
// Code Protection = On.
_FGS(CODE_PROT_ON);
// Debug = Off.
_FICD(GWRP_OFF);
#define _XTAL_FREQ 80000000
// I/O Connections.
#define sw2 PORTDbits.RD0
#define led1 LATFbits.LATF2
#define led2 LATFbits.LATF3
/*******************************************************************************
* FUNCTION PROTOTYPE *
*******************************************************************************/
void led_blink(void);
void init(void);
void delay_ms(unsigned int ui_value);
/*******************************************************************************
* Global Variables *
*******************************************************************************/
unsigned char flag_1 = 0;
unsigned char flag_2 = 0;
unsigned char flag_3 = 0;
unsigned char flag_4 = 0;
/*******************************************************************************
* MAIN FUNCTION *
*******************************************************************************/
int main(void)
{ init();while(1);{
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////START PROGRAM/////////////////////////////////
LATFbits.LATF2=1; delay_ms(5000);
LATFbits.LATF2=0; delay_ms(5000);
LATFbits.LATF3=1; delay_ms(5000);
LATFbits.LATF3=0; delay_ms(5000);
}//////////////////////////////////END PROGRAM//////////////////////////////////
}///////////////////////////////////////////////////////////////////////////////
void led_blink(void)
{
led1=1;delay_ms(5000);
led1=0;delay_ms(5000);
led2=1;delay_ms(5000);
led2=0;delay_ms(5000);
}
void init(void)
{
// Clear all ports.
LATB = 0;
LATC = 0;
LATD = 0;
LATF = 0;
// Initialize I/O directions.
TRISB = 0;
TRISC = 0;
TRISD = 0;
TRISF = 0;
TRISFbits.TRISF2 = 0;
TRISFbits.TRISF3 = 0;
}
void delay_ms(unsigned int ui_value)
{
__delay32(_XTAL_FREQ/4000 * ui_value);
}
while(1)
{
//your code here...
}
Return to PIC Development Tool
Users browsing this forum: No registered users and 15 guests