Код: Выделить всё
#include <stdio.h>
#include <stdlib.h>
#include "htc.h"
#define _XTAL_FREQ 40000
#pragma config FOSC = INTRCIO // Oscillator Selection bits (INTOSC oscillator: I/O function on GP4/OSC2/CLKOUT pin, I/O function on GP5/OSC1/CLKIN)
#pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-Up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = OFF // GP3/MCLR pin function select (GP3/MCLR pin function is digital I/O, MCLR internally tied to VDD)
#pragma config BOREN = OFF // Brown-out Detect Enable bit (BOD disabled)
#pragma config CP = OFF // Code Protection bit (Program Memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
void main(void)
{
TRISA = 0x00;
CMCON = 0x1F;
INTCON = 0;
GPIO = 0;
while(1)
{
GP0 = 1;
__delay_ms(2000);
GP0 = 0;
__delay_ms(2000);
}
}

