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 CCS Technical Support

18f45j11 write_eeprom problem

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



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

18f45j11 write_eeprom problem
PostPosted: Thu Aug 26, 2010 5:05 am     Reply with quote

any idea why this happens?

Line 41(14,15): Undefined identifier -- write_eeprom

thanks
_________________
Help "d" others and then you shell receive some help from "d" others.
dilandau



Joined: 25 Aug 2010
Posts: 11

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 5:22 am     Reply with quote

difficult to say without more info...

This can happen if a previous identifier is wrong,
or if there is a line without a ";" at the end,
or if there is a #ifdefine without its #endif somewhere in the code.

If it is a 16 bit chip it might happen that the register you are passing to the write_eeprom(16Bit address register, 16 bit value word); is not 16 bit
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 5:29 am     Reply with quote

thnx, the thing is that it works with 18f4520 so I am confused a bit now.

both are 8 bit by the way.

this is a line:

if (setValue < averageTempRead_int) {
write_eeprom (0x0A, 0x50);
delay_custom_ms(15);
fprintf(eth,"max internal temperature reached!...\n");
}

any one knows if I need to do any special fuses for it to work or is is a bug in compiler?

I have went to ccs wizard to do initial setup just to check if my manual is any good but no difference...

thank you
_________________
Help "d" others and then you shell receive some help from "d" others.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 6:32 am     Reply with quote

Look at the data sheet. How much EEPROM does the 18F45J11 have? Maybe that could be the problem?
_________________
Google and Forum Search are some of your best tools!!!!
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Aug 26, 2010 8:42 am     Reply with quote

dyeatman wrote:
Look at the data sheet. How much EEPROM does the 18F45J11 have? Maybe that could be the problem?



(chuckle)


RTFD?

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 3:58 am     Reply with quote

Stupid me! there is 0 ROM, I did buy wrong chip! Oh well life is hard for some people Smile tHNX
_________________
Help "d" others and then you shell receive some help from "d" others.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 9:12 am     Reply with quote

Linuxbuilders wrote:
Stupid me! there is 0 ROM, I did buy wrong chip! Oh well life is hard for some people Smile tHNX


But wait!


There might be a solution for you anyway.

You can use Program FLASH like EEPROM (just don't slam it with a lot of writes.)

You can use "read_program_memory" and "write_program_memory" if you have an extra flash page available. (I would use a whole page, it'll be easier) which I think is 1024bytes. (yes, I just checked)

Just stack your config into a structure that lives at an address in program memory. When you save changes, you have to read the whole block into memory, erase the memory and make your changes to the temporary block, then write it back.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 7:18 pm     Reply with quote

thnx, I was actually thinking about something like that but the problem is that I need to do what Apple is doing with their laptops and iphone/ipod/ipad - they have humidity sensor in the device and when it gets too wet they mark it in the eeprom. Then when you take it for a service you may find out that they will say that there is no warranty because of too high humidity level. (water damage). I need to do this thing but with too high temperature. So I need hard memory. That is ok I will get different chip...I have just overlooked rom size...

Program memory is ok but I better do not touch it for other reasons.

thank you
_________________
Help "d" others and then you shell receive some help from "d" others.
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