Discussion in "PIC Microcontroller Discussion" started by    vohsty    Nov 13, 2013.
Fri Nov 29 2013, 11:49 pm
#11
hi tech c integrated into mplab
Mon Dec 02 2013, 01:26 am
#12
ok.. can you post error log? It should not be giving error though.
Mon Dec 02 2013, 01:34 am
#13
Build I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\IDTPM for device 16F877A
Using driver C:\Program Files (x86)\HI-TECH Software\PICC\9.83\bin\picc.exe

Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\main.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\LCD162.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\delay.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\mystrings.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\877_eeprom.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\DS1307.p1" is up to date.
Make: The target "I:\pic industrial timer\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.p1" is out of date.
Executing: "C:\Program Files (x86)\HI-TECH Software\PICC\9.83\bin\picc.exe" --pass1 "I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c" -q --chip=16F877A -P --runtime=default,+clear,+init,-keep,+osccal,-download,-resetbits,-stackcall,+clib --opt=default,+asm,-debug,-speed,+space,9 --warn=0 -D__DEBUG=1 --double=24 --float=24 --addrqual=ignore -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 35.7 undefined identifier "RA4"
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 38.1 function declared implicit int
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 38.13 undefined identifier "LCD_clear"
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 39.1 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 40.1 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 40.17 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 42.1 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 45.18 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 45.37 function declared implicit int
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 53.38 undefined identifier "setstring"
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 53.50 pointer required
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 53.50 pointer required
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 54.38 undefined identifier "setstring"
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 54.50 pointer required
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 54.50 pointer required
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 58.35 undefined identifier "rlyonoff"
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 58.53 pointer required
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 58.53 pointer required
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 62.4 undefined identifier "RD1"
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 66.30 pointer required
Error [981] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 66.30 pointer required
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 68.4 undefined identifier "RD0"
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 78.1 function declared implicit int
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 88.69 function declared implicit int
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 94.4 undefined identifier "RD2"
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 100.28 function declared implicit int
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 106.4 undefined identifier "RD0"
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 112.4 undefined identifier "RD1"
Warning [361] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 117.1 function declared implicit int
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 131.7 undefined identifier "RD2"
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 132.13 undefined identifier "LCD_clear"
Error [192] I:\pic industrial timer\IDT\MPLAB PROJECT\MPLAB PROJECT\MPLAB PROJECT\alarm.c; 146.4 undefined identifier "RA4"
Advisory[1] too many errors (21)

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



i only changed wht u instructed me
Mon Dec 02 2013, 01:45 am
#14
Looks like issue with header file. Are you using MPLAB or MPLABx (new IDE)?
Mon Dec 02 2013, 01:56 am
#15
MPLAB and not the MPLABx
Mon Dec 02 2013, 02:27 am
#16
Well he did a very awkward way of building code. He is including C file instead of header file. that might be causing issue. Probably the new Hi-Tech C compiler does not allow this. You need to work a little bit and create header file to add all the function prototypes to one header file that you can include it in all your C file.

e.g. for set_alarm function prototype will be
void set_alarm(void);

for LCD_send_packedbcd function
void LCD_send_packedbcd(unsigned char data);

You get it? errors coz probably of latest version of Hi-tech C.
Mon Dec 02 2013, 07:59 am
#17
To be honest i dint understand what u sayed.I am not all that good in this
Thu Dec 05 2013, 05:07 am
#18
Its really difficult to help you if you do not understand what I am trying to say. Its basic C that I am talkin about. You need to create header file thats it. Anyways let me see if I can create it for you.
Sat Dec 07 2013, 10:21 pm
#19
I have been reading and i think i got an idea of what you are saying but i will greatly apreciate if you made one for me
Mon Dec 16 2013, 04:01 am
#20
Here is the header file code, save it in a file name idt.h

#ifndef __IDT_H__
#define __IDT_H__

// EEPROM
void Eeprom_write(unsigned char address, unsigned char data);
unsigned char Eeprom_read(unsigned char address);

//DS1307
void rtc_init(void);
void rtc_settime(unsigned char h,unsigned char m,unsigned char s);
void rtc_setdate(unsigned char y,unsigned char m,unsigned char d,unsigned char w);
void rtc_gettime(unsigned char *h,unsigned char *m,unsigned char *s);
void rtc_getdate(unsigned char *y,unsigned char *m,unsigned char *d,unsigned char *w);

// LCD
void LCD_enable(void);
void LCD_data(unsigned char ascii);
void LCD_command(unsigned char ascii);
void LCD_gotoxy(unsigned char x,unsigned char y);
void LCD_string(unsigned char *lcd_string);
void LCD_init(void);

//mystring
void LCD_send_packedbcd(unsigned char data);
void LCD_timeset(unsigned char data,unsigned char position);
unsigned char hex2bcd (unsigned char x);

//Alarm
void set_alarm(void);
void set_time(void);

#endif // __IDT_H__


Now make following changes in following files..:
877_eeprom.c
DS1307.c
LCD162.c
delay.c
mystrings.c
alarm.c
main.c

Add #include "idt.h" in all the above files.

And from main.c remove all the C files
#include"877_eeprom.c"
#include"DS1307.c"
#include"LCD162.c"
#include"delay.h"
#include"mystrings.c"
#include"alarm.c"


Now once you done these modification, now add all the C files in the project so that they gets compiled. Hope it works for you

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm
Richardedils
Wed Apr 24 2024, 04:07 am
Malcolmaccek
Wed Apr 24 2024, 01:21 am