View previous topic :: View next topic |
Author |
Message |
hansolo
Joined: 06 Oct 2006 Posts: 20
|
Read_eeprom and write_eeprom error with 18F452 & Ver3.24 |
Posted: Sun Oct 08, 2006 1:35 am |
|
|
I tried using the following commands with PIC18F452 and compile with PICC V3.249.
Code: | read_eeprom();
write_eeprom(); |
The error I have got is :
Code: | Error[12] D:\PICC Programs\Clock_Test_2.c 93 : Undefined identifier -- write_eeprom
1 Errors, 0 Warnings. |
I have no problem compiling the same code with PIC16F877A.
I tried using the 2 commands above in other projects using PIC18F452 and have same error.
I think there is some bug with the PIC18F452 header file or something.
Any help is welcome. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Oct 08, 2006 10:19 am |
|
|
The following program compiles with no errors, with PCH vs. 3.249.
Try it, and see you can compile it. If not, re-install the compiler.
That might fix the problem.
Code: |
#include <18F452.h>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud = 9600, xmit=PIN_C6, rcv = PIN_C7, ERRORS)
//===========================================
main()
{
int8 result;
write_eeprom(0, 0x55);
result = read_eeprom(0);
while(1);
}
|
|
|
|
hansolo
Joined: 06 Oct 2006 Posts: 20
|
|
Posted: Sun Oct 08, 2006 5:19 pm |
|
|
My mistake, I have use #include<18C452.h> instead of #include<18F452.h>.
It seems that PIC18C452 does not have eeprom inside.
By the way, thanks for your assistance PCM.
Hansolo |
|
|
|