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.

C32 compiler macro value cannot be changed

Status
Not open for further replies.

ponnus

Full Member level 2
Full Member level 2
Joined
Mar 17, 2011
Messages
142
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
Cochin, INDIA
satheeshchalackal.blogspot.in
Activity points
2,226
Hello everyone,

I am using PIC32 USB starter kit ll, with C32 compiler which came with the kit itself. I have been using it for many months.
Now I am facing a strange problem. When I tried to change the value of a macro and build it, the macro still holds the previous value.
I tried it many times, but still same problem.......
I tried to clean and build the project, but still the problem unresolved.
I then reboot my PC and it was ok......,but this same problem is occuring in another PC also.

Does anyone faced such a problem?

Thanks:-|
 

Hai,
I have some macros in my program......such as

#define High_THRESHOLD 500
#define Low_THRESHOLD 50

My program is working fine in PIC32 MPLAB IDE with C32 compiler.....I was able to edit the program and burn it successfully.
But, now when I changed the values of macros....like......

#define High_THRESHOLD 300
#define Low_THRESHOLD 10

Build was successful. But when I put my mouse cursor on top of these macros, I saw the previous values and not new ones.
I burned the program and the microcontroller is taking the old value as threshold.

This problem disappeared when I rebooted my PC. But if I want to edit the values again.....then again I have to reboot......

Thanks
 

I never came across such aproblem with C32 and MPLAB. I can only guess that the respective header files haven't been included to the project. You can check if the files are listed in the build log.
 

I find a problem with Microchip compilers with .h include files where it doesn't notice the change in the include file when you use F10 - "Build" (assuming you are using MPLAB not MPLABX). Try "Rebuild" - CTRL-F10. That fixes the problem for me.

Keith
 

hai,
Thank you for your reply.

I am sure that the code is fine because it's been working for months........
I find a problem with Microchip compilers with .h include files where it doesn't notice the change in the include file when you use F10 - "Build" (assuming you are using MPLAB not MPLABX). Try "Rebuild" - CTRL-F10. That fixes the problem for me.

Keith
I also experienced this problem and solved it the same way, But this is something new to me...and I didn't find a reason for that to occur.

Now when I reinstalled the compiler and IDE and the problem no longer occurs........:smile:
 

I find a problem with Microchip compilers with .h include files where it doesn't notice the change in the include file when you use F10 - "Build" (assuming you are using MPLAB not MPLABX). Try "Rebuild" - CTRL-F10. That fixes the problem for me.
Are you sure that the respective *.h file is included to the project files?
 

Yes, include files are in the project. And another puzzle is that I often have two include files and whenever I do a project 'save as' it never copies the delay.h file to the new project but it does with the other include file. I have never worked out why and just get used to manually copying the delay.h over.

Keith
 

It manifests itself in a similar way to described in the original post - I change a #define in my variables.h file and recompile and it automatically saves the file but doesn't recognise that all the C files that include it need recompiling (presumably because they haven't actually changed). Rebuilding fixes it.

Keith
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top