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.

mplab problem with pic 16f877a

Status
Not open for further replies.

roaa said

Newbie level 4
Joined
Jul 6, 2013
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
44
hi ..
i'm new in mplab i wana to display heart rate in lcd ... i used pic 16f877a

Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 2.7 illegal # directive "device"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 4.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 5.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 6.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 7.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 8.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 9.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 10.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 11.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 12.6 illegal # directive "FUSES"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 14.4 illegal # directive "use"
Warning [107] C:\Users\SILE1411\Desktop\HR\Untitled.c; 15.4 illegal # directive "use"
Error [141] C:\Users\SILE1411\Desktop\HR\Untitled.c; 18.16 can't open include file "lcd.c": No such file or directory

********** Build failed! **********


Code:
#include <htc.h>
#device adc=8

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD                    //No EE protection
#FUSES NOWRT                    //Program memory not write protected

#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)


#include <lcd.c>
int x=0,bpm;
void main()
{
   lcd_init();
lcd_gotoxy(1,1);
 lcd_putc("start");
  lcd_gotoxy(1,2);
  lcd_putc("tmr set");
  delay_ms(2900);
  setup_timer_0( RTCC_EXT_L_TO_H);
  set_timer0(0);
  delay_ms(5000);
  
  lcd_putc("\f");
  lcd_gotoxy(1,1);
   lcd_putc("dlay cmpt");
  x=get_timer0();
  lcd_gotoxy(1,2);
   lcd_putc("timer read");
   lcd_gotoxy(1,1);
  printf(lcd_putc,"val%d",x);
 bpm=x*24;
  lcd_putc("\f");
   printf(lcd_putc,"bpm%d",bpm);

   // TODO: USER CODE!!
plz heeeeeeeeeeeeeeeeeeeeelp me
 
Last edited by a moderator:

MPLAB is only the IDE.

What is the specific compiler you are attempting to utilizing, CCS, HiTech PICC, Microchip XC8, etc?

It appears as if you are not utilizing the correct compiler directive to set the configuration register and initialize the UART.

You are mixing CCS and HiTech Compiler directives, consult the actual compiler user manual for the correct directives and routines.

BigDog
 

thnx for reply..
i used HiTech PICC.i am new in mplab So I can not differentiate between them
what i do to display heart rate I beg you advise me plz
 

Your code is CCS Compiler!!! And incomplete!!!

Change #include <htc.h> instead #include <16F877A.h>...

In MPLB change the toolsuite (menu Project - Set Language Toolsuite... and choose the CCS C Compiller......etc)...

Or create the project in PIC C Compiler...
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top