CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Read_eeprom and write_eeprom error with 18F452 & Ver3.24

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hansolo



Joined: 06 Oct 2006
Posts: 20

View user's profile Send private message

Read_eeprom and write_eeprom error with 18F452 & Ver3.24
PostPosted: Sun Oct 08, 2006 1:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Oct 08, 2006 10:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Oct 08, 2006 5:19 pm     Reply with quote

My mistake, I have use #include<18C452.h> instead of #include<18F452.h>. Embarassed

It seems that PIC18C452 does not have eeprom inside.

By the way, thanks for your assistance PCM.

Hansolo
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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