hello , this is my new code for a flasher led , will u see if there is a problem in it ?
//************************************************************************************
//**
//** File name: C:\Program Files\Flowcode V4\???? ????\Flowcode1.c
//** Generated by: Flowcode v4.2.3.58
//** Date: Friday, August 19, 2011 04:31:52
//** Licence: Professional
//** Registered to: 2A1RRG
//**
//**
//** http://www.matrixmultimedia.com
//************************************************************************************
#define MX_PIC
//Defines for microcontroller
#define P16F630
#define MX_EE
#define MX_EE_TYPE1
#define MX_EE_SIZE 128
//Functions
#define MX_CLK_SPEED 19660800
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif
//Configuration data
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3fef
#endif
#ifdef HI_TECH_C
__CONFIG(0x3fef);
#endif
//Internal functions
#include "C:\Program Files\Flowcode V4\FCD\internals.h"
//Macro function declarations
//Variable declarations
//Defines:
/**** Macro Substitutions ****
portc = LED Port Register
trisc = LED Data Direction Register
2 = LED Pin Mask
1 = LED Active Polarity
******************************/
//LED0: //Macro function declarations
void FCD_LED0_LEDOn();
void FCD_LED0_LEDOff();
//LED0: //Macro implementations
void FCD_LED0_LEDOn()
{
trisc = trisc & ~2; //Convert pin to output
if( 1 ) //Active high polarity
portc = portc | 2;
else //Active low polarity
portc = portc & ~2;
}
void FCD_LED0_LEDOff()
{
trisc = trisc & ~2; //Convert pin to output
if( 1 ) //Active high polarity
portc = portc & ~2;
else //Active low polarity
portc = portc | 2;
}
//Macro implementations
void main()
{
//Initialisation
cmcon = 0x07;
//Interrupt initialisation code
option_reg = 0xC0;
//Loop
//Loop: While 1
while (1)
{
//Call Component Macro
//Call Component Macro: LED(0)::LEDOn
FCD_LED0_LEDOn();
//Delay
//Delay: 1 s
delay_s(1);
//Call Component Macro
//Call Component Macro: LED(0)::LEDOff
FCD_LED0_LEDOff();
//Delay
//Delay: 1 s
delay_s(1);
}
mainendloop: goto mainendloop;
}
void MX_INTERRUPT_MACRO(void)
{
}
//************************************************************************************
//**
//** File name: C:\Program Files\Flowcode V4\???? ????\Flowcode1.c
//** Generated by: Flowcode v4.2.3.58
//** Date: Friday, August 19, 2011 04:31:52
//** Licence: Professional
//** Registered to: 2A1RRG
//**
//**
//** http://www.matrixmultimedia.com
//************************************************************************************
#define MX_PIC
//Defines for microcontroller
#define P16F630
#define MX_EE
#define MX_EE_TYPE1
#define MX_EE_SIZE 128
//Functions
#define MX_CLK_SPEED 19660800
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif
//Configuration data
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3fef
#endif
#ifdef HI_TECH_C
__CONFIG(0x3fef);
#endif
//Internal functions
#include "C:\Program Files\Flowcode V4\FCD\internals.h"
//Macro function declarations
//Variable declarations
//Defines:
/**** Macro Substitutions ****
portc = LED Port Register
trisc = LED Data Direction Register
2 = LED Pin Mask
1 = LED Active Polarity
******************************/
//LED0: //Macro function declarations
void FCD_LED0_LEDOn();
void FCD_LED0_LEDOff();
//LED0: //Macro implementations
void FCD_LED0_LEDOn()
{
trisc = trisc & ~2; //Convert pin to output
if( 1 ) //Active high polarity
portc = portc | 2;
else //Active low polarity
portc = portc & ~2;
}
void FCD_LED0_LEDOff()
{
trisc = trisc & ~2; //Convert pin to output
if( 1 ) //Active high polarity
portc = portc & ~2;
else //Active low polarity
portc = portc | 2;
}
//Macro implementations
void main()
{
//Initialisation
cmcon = 0x07;
//Interrupt initialisation code
option_reg = 0xC0;
//Loop
//Loop: While 1
while (1)
{
//Call Component Macro
//Call Component Macro: LED(0)::LEDOn
FCD_LED0_LEDOn();
//Delay
//Delay: 1 s
delay_s(1);
//Call Component Macro
//Call Component Macro: LED(0)::LEDOff
FCD_LED0_LEDOff();
//Delay
//Delay: 1 s
delay_s(1);
}
mainendloop: goto mainendloop;
}
void MX_INTERRUPT_MACRO(void)
{
}