View previous topic :: View next topic |
Author |
Message |
Linuxbuilders
Joined: 20 Mar 2010 Posts: 193 Location: Auckland NZ
|
18f45j11 write_eeprom problem |
Posted: Thu Aug 26, 2010 5:05 am |
|
|
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
|
|
Posted: Thu Aug 26, 2010 5:22 am |
|
|
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
|
|
Posted: Thu Aug 26, 2010 5:29 am |
|
|
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
|
|
Posted: Thu Aug 26, 2010 6:32 am |
|
|
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
|
|
Posted: Thu Aug 26, 2010 8:42 am |
|
|
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
|
|
Posted: Fri Aug 27, 2010 3:58 am |
|
|
Stupid me! there is 0 ROM, I did buy wrong chip! Oh well life is hard for some people 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
|
|
Posted: Fri Aug 27, 2010 9:12 am |
|
|
Linuxbuilders wrote: | Stupid me! there is 0 ROM, I did buy wrong chip! Oh well life is hard for some people 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
|
|
Posted: Fri Aug 27, 2010 7:18 pm |
|
|
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. |
|
|
|