Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] PIC 16f877 header file

Status
Not open for further replies.

Janeera

Newbie level 3
Joined
Mar 11, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,300
I am programing PIC using MPLAB Sim. but I need the header file pic.h for pic 16f877. can anyone give me the code ?

I have the other 3 header files- pic_lcd8.h, pic_serial.h and pic_adc.h

This is my program... to display ecg, pressure, pulse, respiration rate.


Code:
#include<pic.h>
#include"pic_lcd8.h"
#include"pic_serial.h"
#include"pic_adc.h"

#define pulse1 RB1
//#define pulse2 RB2

unsigned char i,j,v[10],f,g,h,re,time=0,sec=0,aa=0,bb=0,pul,sec1=0,pulse, count,count1,beat,Temp;	
int pressure;

void main()
{
TRISC=0xC0;
TRISD=0x00;
TRISB=0x03;
lcd8_init();
Serial_Init(9600);

GIE=1;	
PEIE=1; 
//	INTE=1;
//	INTEDG=1;
TMR1IE=1;
TMR1H=60;
TMR1L=235;
T1CON=0X00;
TMR1ON=0;
Receive(0);
lcd8_display(0x80," Cardiopulmonary ",16);
lcd8_display(0xc0," Activity Monitor ",16);
delay(65000);delay(65000);
lcd8_display(0x80,"Pre: R: ",16);
lcd8_display(0xc0,"E: P: S: ",16);
delay(65000);delay(65000);

while(1)
{
TMR1ON=1;	
Temp=Adc8_Cha(0);//value reading for temperature
pressure=Adc8_Cha(1);//value reading for pressure
//	if(!pulse2 && !bb)	{ bb=1; }
//	if(pulse2 && bb)	{ bb=0; pulse++; }

if(!pulse1 && !aa)	{ aa=1; }
if(pulse1 && aa)	{ aa=0; pul++; }

lcd8_decimal2(0xce,sec);
lcd8_decimal3(0x84,pressure);	
lcd8_decimal3(0x8b,pul);
lcd8_decimal3(0xC2,Temp);	
lcd8_decimal3(0xC8,pulse);

if(sec>59)
{
delay(65000);delay(65000);
TMR1ON=0;
sec=0;
pul=pulse=0;
}


}

} 

void interrupt ser_int(void) 
{
if(RCIF) //reciever interrupt flag
{
RCIF=0;
v[i]=RCREG;i++;	
}
if(INTF)/interrupt flag
{
INTF=0;
pulse++;
}
if(TMR1IF==1)
{
TMR1ON=0;
TMR1IF=0;
count1++;
if(count1>=20){sec++;count1=0;}
TMR1H=60;
TMR1L=235;
TMR1ON=1;
}

}
 

In any of the installed sample programs you will find the header files. take from that location....

---------- Post added at 08:07 ---------- Previous post was at 08:05 ----------

download from here **broken link removed**
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top