Advertisement
hidromotic

config_pic18f46k20.h

May 3rd, 2020
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.02 KB | None | 0 0
  1. /*
  2.  * File:   config.h
  3.  * Author: Alejo
  4.  *
  5.  * Created on 3 de mayo de 2020, 21:18
  6.  */
  7.  
  8. #ifndef CONFIG_H
  9. #define CONFIG_H
  10.  
  11. #ifdef  __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. #include <xc.h>
  16. #include <pic18f46k20.h>
  17. #include <stdio.h>
  18.  
  19. #pragma config CONFIG1H = 0x08
  20. #pragma config CONFIG2L = 0x19
  21. #pragma config CONFIG2H = 0x1E
  22. #pragma config CONFIG3H = 0x01
  23. #pragma config CONFIG4L = 0x80
  24. #pragma config CONFIG5L = 0x0F
  25. #pragma config CONFIG5H = 0xC0
  26. #pragma config CONFIG6L = 0x0F
  27. #pragma config CONFIG6H = 0xE0
  28. #pragma config CONFIG7L = 0x0F
  29. #pragma config CONFIG7H = 0x40
  30.  
  31. #define _XTAL_FREQ                      8000000
  32. #define TMR0_PREVALUE                    200 //CARGA DEL TIMER
  33.  
  34. #define HAY_INTERRUPCION                (INTCONbits.TMR0IF ==1)
  35. #define LIMPIAR_BANDERA_INTERRUPCION    INTCONbits.TMR0IF=0
  36.    
  37. extern unsigned long centiseg;  //Para el control de tiempos
  38.  
  39. void recargar_timer(void);
  40. void timer0_config(void);
  41. void setup(void);
  42.  
  43.  
  44. #ifdef  __cplusplus
  45. }
  46. #endif
  47.  
  48. #endif  /* CONFIG_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement