DS... It does in this case OpenTimer0(); is correct .Generally I've noticed that function names don't start with a capital. OpenTimer0, for example, is probably actually openTimer0.
DS... It does in this case OpenTimer0(); is correct .
I have just created a project.. called "proj" and copied and pasted the Leds.c into the project, saved, built and no errors..
Have you added to "leds.c" file from its current position, or have you copied the file to the new directory?
From what you say it sounds like you didn't even need to add a linker file into the project, or maybe you just automatically did? If I remove P18F452.lkr from the project it gets even less far - complains that there is no linker script and halts.
Mods, please remove this message - I've incorporated what I originally wrote here into the body pf the previous message (how do I delete a post?)
DS- I must stress again that I have (so far) not written any code myself. I'm using code supplied by Microchip as part of the C18 installation.
As to why I'm using MPLAB V8.00 (apart from the fact that it is simply what I already have, and has served me perfectly well until now) it runs moderately well on the old Windows 98 machine which is the only computer conveniently available to me at work, and so I continue to use the same version here at home as well, so I don't get any issues with the older version of MPLAB at work not being able to work with projects written on a newer version somewhere else.
NEVER had this problem.... I only link a LKR script when I need to modify the original.... (copy the original and paste into the working directory)
It appears that your project directories are not set up correctly.... The default LKR script IS, as you say, automatically included... I would look at the projects directory settings and (in particular) look at the "intermediate" and "include" paths... These need to be the defaults... If you have these as your working directory... The project linker will not find the files.
I meant that including the header file in the code does not actually add it to the project. To do that, you need to add the .h in the project wizard. I have a feeling that might be part (if not all) of your problem.
That's at odds with my understanding of how things normally work, but then again this is Microchip, so define normal
Seriously though: If the .c source contains the line '#include timers.h>' and the toolsuite location definitions state that the includes directory is:
C:\Program Files\Microchip\mplabc18\v3.42\h
-isn't that combination enough for the compiler / linker to be able to find timers.h in that folder?
In any case I think your thought occurred to me too, and I tried explicitly adding timers.h to the project as well - exactly the same result, so I took it out again. (I've just tried it again, to be sure).
It is not always enough. I have a much newer version of MPLAB, so things might be different, but did you try adding the header files through the project wizard, or did you do it manually in the project window? If v.8.00 isn't too much different from 8.76 (what I have), there should be a window with a bunch of folders in it. Is this where you added the .h files (directly to the "header files" folder)?
As you can see from my other recent post I've got the includes (.h) and linker scripts (.lkr) set up to where they definitely are, but the 'intermediate' set to the project directory - I thought this would be OK since the name suggests that this folder is just used for files temporarily created during the compilation/linking process. What IS the default setting for the "intermediate" directory? (what does yours say?)
Nothing.... Its all blank, If you leave it blank it defaults to... A) the working directory of the project.. and B) The path determined by the installer program when C18 was installed..
What did you install first... MPLAB or C18?
It just goes to show you can't take anything at face value.....
You need to check the Toolsuite settings.. Just make sure they are right.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?