Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * File: main.c
- * Author: Fsociety Darkness
- *
- * Created on 16 de Maio de 2018, 20:26
- */
- #include <xc.h>
- #include <p18f4550.h>
- #define _XTAL_FREQ 4000000
- #pragma config FOSC = INTOSC_EC //internal oscillator
- #pragma config PLLDIV = 4 //divide by 5 to give 4MHz to PLL
- #pragma config FCMEN = OFF //no fail safe clock monitor
- #pragma config IESO = OFF //oscillator switchover disabled
- #pragma config PWRT = ON //oscillator power up timer enabled
- #pragma config BOR = OFF //hardware brown out reset
- #pragma config WDT = OFF //watchdog timer disabled
- #pragma config MCLRE = OFF //MCLR pin enabled
- #pragma config LPT1OSC = ON //timer1 low power operation
- #pragma config PBADEN = OFF //portB 0to 4 digital - not analogue
- #pragma config LVP = OFF //low voltage programming disabled
- #pragma config CCP2MX = OFF //portc1 = CCP2
- #pragma config XINST = OFF //do not allow PIC18 extended instructions
- #pragma config STVREN = ON //stack overflow will cause reset
- void main(void) {
- TRISD = 0;
- LATDbits.LATD0 = 0;
- while(1){
- LATDbits.LATD0 = 1 ;
- __delay_ms(500);
- LATDbits.LATD0 = 0;
- __delay_ms(500);
- }
- }
Add Comment
Please, Sign In to add comment