Dimmer controlador por pic18f4550

1324 palavras 6 páginas
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* DEFINIÇÃO PIC *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <p18F4550.h> // Register definitions
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* INCLUDES DAS FUNÇÕES DE PERIFÉRICOS DO PIC *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <pwm.h> //PWM library functions
#include <adc.h> //ADC library functions
#include <timers.h> //Timer library functions
#include <delays.h> //Delay library functions
#include <i2c.h> //I2C library functions
#include <stdlib.h> //Library functions
#include <usart.h> //USART library functions
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Configurações para gravação *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#pragma config FOSC = HS
#pragma config CPUDIV = OSC1_PLL2
#pragma config WDT = ON
#pragma config WDTPS = 128
#pragma config LVP = OFF
#pragma config PWRT = ON
#pragma config BOR = OFF
#pragma config BORV = 0
#pragma config PBADEN = OFF
#pragma config DEBUG = OFF
#pragma config PLLDIV = 1
#pragma config USBDIV = 1
#pragma config FCMEN = OFF
#pragma config IESO = OFF
#pragma config VREGEN = OFF
#pragma config MCLRE = ON
#pragma config LPT1OSC = OFF
#pragma config CCP2MX = ON
#pragma config STVREN = OFF
#pragma config ICPRT = OFF
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Definição e inicialização das variáveis Globais *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//Neste bloco estão definidas as variáveis globais do programa.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Constantes internas *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
//A definição de constantes facilita a

Relacionados

  • tca 785
    10612 palavras | 43 páginas
  • Detecção de Harmônicas
    10453 palavras | 42 páginas