fork download
  1. // PIC16F877A Configuration Bit Settings
  2. // 'C' source line config statements
  3. // CONFIG
  4. #pragma config FOSC = EXTRC // Oscillator Selection bits (RC oscillator)
  5. #pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
  6. #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
  7. #pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
  8. #pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
  9. #pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
  10. #pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
  11. #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
  12.  
  13. #define _XTAL_FREQ 8000000
  14. #include <xc.h>
  15.  
  16. void main(void)
  17. {
  18. TRISB=0x00;
  19. while(1)
  20. {
  21. RB0 = 1 ;
  22. __delay_ms(500);
  23. RB0 = 0 ;
  24. __delay_ms(500);
  25.  
  26. }
  27. return;
  28. }
Success #stdin #stdout 0.02s 26020KB
stdin
Standard input is empty
stdout
// PIC16F877A Configuration Bit Settings
// 'C' source line config statements
// CONFIG
#pragma config FOSC = EXTRC // Oscillator Selection bits (RC oscillator)
#pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)

#define _XTAL_FREQ 8000000
#include <xc.h>

void main(void) 
{
TRISB=0x00;
while(1)
{
RB0 = 1 ;
__delay_ms(500);
RB0 = 0 ;
__delay_ms(500);

}
return;
}