|
|
View previous topic :: View next topic |
Author |
Message |
pascom
Joined: 23 Jun 2005 Posts: 1 Location: Austria
|
PIC18F4580 Standart Header File Error 23 |
Posted: Thu Jun 23, 2005 3:35 am |
|
|
Hello!
I'm starting now with a new project and the PIC18F4580.
When I'm compiling my project, the compiler stops with an strange (for me) error.
These are the first 2 lines in 18F4580.h:
//////// Standard Header file for the PIC18F4580 device ////////////////
#device PIC18F4580
But this #device causes the error: "Can not change device type this far into the code"
Can anyone help with my problem?
Thanks for answers.
Robert |
|
|
Ttelmah Guest
|
|
Posted: Thu Jun 23, 2005 4:19 am |
|
|
The problem is not in the 18F4580.h file, but in your _main_ file.
Basically, the top lines of the main should look something like:
#include <18f4580.h>
#include <stdio.h>
#include....
etc..
Note that the 18F4580 file is the _first_ file included.
If you use the wizard, and it sets up a project 'include' file, then this must be the first file included, and the 18F4580.h file, must be included as the first line in this file.
The error you have, will occur is (for instance), you have:
#device PIC18F4580
#include <stdio.h>
#include <18F4580.h>
This shows two seperate faults that will cause the problem. The first is putting a seperate #device statement (don't - just rely on the one in the processors 'include' file), and the second is putting another include file in front of the processor definition file.
Best Wishes |
|
|
psycho Guest
|
Hello. can anyone have the pic18f4580 library ? |
Posted: Tue Jan 24, 2006 2:55 am |
|
|
Ttelmah wrote: | The problem is not in the 18F4580.h file, but in your _main_ file.
Basically, the top lines of the main should look something like:
#include <18f4580.h>
#include <stdio.h>
#include....
etc..
Note that the 18F4580 file is the _first_ file included.
If you use the wizard, and it sets up a project 'include' file, then this must be the first file included, and the 18F4580.h file, must be included as the first line in this file.
The error you have, will occur is (for instance), you have:
#device PIC18F4580
#include <stdio.h>
#include <18F4580.h>
This shows two seperate faults that will cause the problem. The first is putting a seperate #device statement (don't - just rely on the one in the processors 'include' file), and the second is putting another include file in front of the processor definition file.
Best Wishes | |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|