2013/12/4
/* * File: main.c * Author: webmaster * * Created on 2013/12/04, 14:24 */ #include <stdio.h> #include <stdlib.h> #include <xc.h> // CONFIG #pragma config FOSC = INTOSCIO // Oscillator Selection bits (INTOSC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled) #pragma config MCLRE = OFF // RA5/MCLR/VPP Pin Function Select bit (RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD) #pragma config BOREN = ON // Brown-out Detect Enable bit (BOD enabled) #pragma config LVP = OFF // Low-Voltage Programming Enable bit (RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming) #pragma config CPD = OFF // Data EE Memory Code Protection bit (Data memory code protection off) #pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off) #define _XTAL_FREQ 4e6 //Fosc=4[MHz] int main(int argc, char** argv) { PORTA=0x00; TRISA=0x0; while(1){ PORTA=0x55; __delay_ms(1); PORTA=0xAA; __delay(10); } return (EXIT_SUCCESS); }