Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

embedded c

Posted on 2010-08-16
6
Medium Priority
?
605 Views
Last Modified: 2012-06-27
Hi,

I am working on I2C interface with PIC32. I have taken code from microchip website. I have copied that 2 folders of I2C. but in project file they have included HardwareProfile.h and in source file i2c_master.c. But if I create a new project and include new .c and HardwareProfile.h file. It is giving an error that HardwareProfile.h file or directory not found.
0
Comment
Question by:skadulkar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Expert Comment

by:masheik
ID: 33443897
Hi skadulkar,

In your include , just try adding full .h file path like #include"C:\\C_EmbeddedProjects\ECProjc\\HardwareProfile.h"

or set the library directory that contains the required .h file into include directories option from your IDE .
0
 

Author Comment

by:skadulkar
ID: 33444096
Hi,

I tried your solution. Now it not giving me an error of hardwarProfile.h file or directory not found but it is giving me an error that `SYS_CLOCK' undeclared. even though it is declared in the hardwareprofile.h file


Here is the file

// Clock Constants
#ifndef SYS_CLOCK
      #error "Define SYS_CLOCK (ex. -DSYS_CLOCK=80000000) on compiler command line"
#endif
#define GetSystemClock()            (SYS_CLOCK)
#define GetPeripheralClock()        (SYS_CLOCK/2)
#define GetInstructionClock()       (SYS_CLOCK)
#define I2C_CLOCK_FREQ              5000

// EEPROM Constants
#define EEPROM_I2C_BUS              I2C1
#define EEPROM_ADDRESS              0x50        // 0b1010000 Serial EEPROM address



regards,
shailendra.
0
 
LVL 9

Expert Comment

by:masheik
ID: 33444113
As in your code, SYS_CLOCK should be a #define constant ,

try to put
#define SYS_CLOCK 80000000 at very beginning of HardareProfile.h and compile,

and also look at this code,

#ifndef SYS_CLOCK
      #error "Define SYS_CLOCK (ex. -DSYS_CLOCK=80000000) on compiler command line"
#endif
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:skadulkar
ID: 33446706
Hi masheik,

I tried it, but still it is giving the same error.
And as it is not declared in original code also,how it gets compiled and not mine. because i just copy pasted the code.

shailendra.
0
 

Author Comment

by:skadulkar
ID: 33451468
Hi,

I tried it, but still it is giving the same error.
And as it is not declared in original code also,how it gets compiled and not mine. because i just copy pasted the code.

shailendra.
0
 
LVL 9

Accepted Solution

by:
masheik earned 2000 total points
ID: 33455416
Hi shailendra,

      This error generally occurs if you miss some libraries ie inlcude files missed during compilation, please check all the required libraries have been included  from your ide you can do this ,
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question