haroon_tech
Member level 2
- Joined
- Apr 28, 2011
- Messages
- 51
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- bangalore
- Activity points
- 1,727
C:\Program Files\HI-TECH Software\PICC\9.81\include
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 #ifndef _HTC_H_ #warning Header file pic16f877a.h included directly. Use #include <htc.h> instead. #endif /* header file for the MICROCHIP PIC microcontroller * 16F877A */ #ifndef __PIC16F877A_H #define __PIC16F877A_H // // Configuration mask definitions // // Config Register: CONFIG #define CONFIG 0x2007 // Oscillator Selection bits [COLOR="#FF0000"]// RC oscillator #define FOSC_EXTRC 0xFFFF[/COLOR] // HS oscillator #define FOSC_HS 0xFFFE // XT oscillator #define FOSC_XT 0xFFFD // LP oscillator #define FOSC_LP 0xFFFC // Watchdog Timer Enable bit /[COLOR="#FF0000"]/ WDT enabled #define WDTE_ON 0xFFFF[/COLOR] // WDT disabled #define WDTE_OFF 0xFFFB // Power-up Timer Enable bit // PWRT disabled #define PWRTE_OFF 0xFFFF // PWRT enabled #define PWRTE_ON 0xFFF7 // Brown-out Reset Enable bit // BOR enabled #define BOREN_ON 0xFFFF // BOR disabled #define BOREN_OFF 0xFFBF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit // RB3/PGM pin has PGM function; low-voltage programming enabled #define LVP_ON 0xFFFF // RB3 is digital I/O, HV on MCLR must be used for programming #define LVP_OFF 0xFF7F // Data EEPROM Memory Code Protection bit // Data EEPROM code protection off #define CPD_OFF 0xFFFF // Data EEPROM code-protected #define CPD_ON 0xFEFF // Flash Program Memory Write Enable bits // Write protection off; all program memory may be written to by EECON control #define WRT_OFF 0xFFFF // 0000h to 00FFh write-protected; 0100h to 1FFFh may be written to by EECON control #define WRT_256 0xFDFF // 0000h to 07FFh write-protected; 0800h to 1FFFh may be written to by EECON control #define WRT_1FOURTH 0xFBFF // 0000h to 0FFFh write-protected; 1000h to 1FFFh may be written to by EECON control #define WRT_HALF 0xF9FF // In-Circuit Debugger Mode bit // In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins #define DEBUG_OFF 0xFFFF // In-Circuit Debugger enabled, RB6 and RB7 are dedicated to the debugger #define DEBUG_ON 0xF7FF // Flash Program Memory Code Protection bit // Code protection off #define CP_OFF 0xFFFF // All program memory code-protected #define CP_ON 0xDFFF // // Special function register definitions // // Register: INDF volatile unsigned char INDF @ 0x000; // bit and bitfield definitions // Register: TMR0 volatile unsigned char TMR0 @ 0x001; // bit and bitfield definitions // Register: PCL volatile unsigned char PCL @ 0x002; // bit and bitfield definitions // Register: STATUS volatile unsigned char STATUS @ 0x003; // bit and bitfield definitions volatile bit CARRY @ ((unsigned)&STATUS*8)+0; volatile bit DC @ ((unsigned)&STATUS*8)+1; volatile bit ZERO @ ((unsigned)&STATUS*8)+2; volatile bit nPD @ ((unsigned)&STATUS*8)+3; volatile bit nTO @ ((unsigned)&STATUS*8)+4; volatile bit IRP @ ((unsigned)&STATUS*8)+7; volatile bit RP0 @ ((unsigned)&STATUS*8)+5; volatile bit RP1 @ ((unsigned)&STATUS*8)+6; #ifndef _LIB_BUILD volatile union { struct { unsigned C : 1; unsigned DC : 1; unsigned Z : 1; unsigned nPD : 1; unsigned nTO : 1; unsigned RP : 2; unsigned IRP : 1; }; struct { unsigned : 5; unsigned RP0 : 1; unsigned RP1 : 1; }; } STATUSbits @ 0x003; #endif ... ... ...
Code C - [expand] 1 __CONFIG(RC & WDTEN );
Code C - [expand] 1 __CONFIG(FOSC_EXTRC & WDTE_ON );
T0Delay();
---------- Post added at 12:17 ---------- Previous post was at 11:58 ----------
main()
{
pic_init(); //initialize PIC
while(1)
{
LED=0x00;
T0Delay();
LED=0xFF;
T0Delay();
}
}
still not working then i think you need to check the delay function.
thanx vinodstanur, Zwilorg..
my code run.
with these configrantion....
#include<pic.h>
#include<htc.h>
#define _XTAL_FREQ 4000000
__CONFIG(WDTDIS & XT & UNPROTECT);
so can you explain me.. who we can create interrupt..
#include<htc.h>
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?