pic18f67k22 eeprom memory error

Discuss with MikroElektronika software developers about current library development.
Post Reply
Author
Message
maney
Posts: 6
Joined: 12 Feb 2014 07:36

pic18f67k22 eeprom memory error

#1 Post by maney » 12 Feb 2014 08:01

hello,

i am using pic18f67k22 to read and write eeprom data.
As it has 1KB eeprom memory, it doesnot write data above 255(0xff).


void main()
{
eeprom_write(0x100,10);

}

this code write data at (0x00), insted of at (0x100).


please help.....!!!

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: pic18f67k22 eeprom memory error

#2 Post by marina.petrovic » 12 Feb 2014 14:16

Hi,

Please, can you explain me a little bit more where the problem occurs?

I tried simple code for PIC18F67K22, and code is working like expected:

Code: Select all

unsigned int data_;

void main(){
EEPROM_Write(0x100,10);
Delay_ms(100); 
data_ = EEPROM_Read(0x100);
}
Best regards,
Marina

maney
Posts: 6
Joined: 12 Feb 2014 07:36

Re: pic18f67k22 eeprom memory error

#3 Post by maney » 12 Feb 2014 14:29

Hi.
thanks for the reply Marina.
i am using micro c for pic V 6.0.0

i agree with you, but the problem is if i write data at address (0x00) or (0X100)
it write data at (0x00) only....(i.e. overwrite it)

it will be more clear to you if you see watch window EEADR , EEADRH , EEDATA.


wating for the reply.

with regards
Maney Mongia

maney
Posts: 6
Joined: 12 Feb 2014 07:36

Re: pic18f67k22 eeprom memory error

#4 Post by maney » 12 Feb 2014 15:16

here is a image for more clearence...

http://www.akashwebs.com/1.GIF

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: pic18f67k22 eeprom memory error

#5 Post by marina.petrovic » 13 Feb 2014 16:43

Hi,

I managed to reproduce the same behavior in compiler.
We will try to investigate it little bit further and try to find source of the problem.

Best regards,
Marina

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: pic18f67k22 eeprom memory error

#6 Post by janni » 13 Feb 2014 17:24

maney wrote:i agree with you, but the problem is if i write data at address (0x00) or (0X100)
it write data at (0x00) only....(i.e. overwrite it)
The problem lies in wrong EEPROM library declared in processor *.mlk file. For a quick fix open the P18F67K22.mlk file (in Defs sub-directory of mC installation directory) with text or xml file editor and change __Lib_EEPROM_256 to __Lib_EEPROM_1024 in the following library declaration

Code: Select all

		<LIB>
			<ALIAS>EEPROM</ALIAS>
			<FILE>__Lib_EEPROM_256</FILE>
			<TYPE>REGULAR</TYPE>
		</LIB>

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: pic18f67k22 eeprom memory error

#7 Post by marina.petrovic » 14 Feb 2014 13:23

Hi,

Thank you, janni, for pointing on the source of the problem.
Indeed problem is in the very .mlk file.

We're already found the cause of the problem and we will try to correct it as soon as possible.

Of course, the .mlk file can be easily modified like you already explained.

Best regards,
Marina

maney
Posts: 6
Joined: 12 Feb 2014 07:36

Re: pic18f67k22 eeprom memory error

#8 Post by maney » 14 Feb 2014 14:55

Hie

Thank you, Janni and Marina .

it worked well by editing the .mlk file.

With Regards,
Maney Mongia

Post Reply

Return to “Library Development Discussion”