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.....!!!
pic18f67k22 eeprom memory error
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: pic18f67k22 eeprom memory error
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:
Best regards,
Marina
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);
}
Marina
Re: pic18f67k22 eeprom memory error
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
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
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: pic18f67k22 eeprom memory error
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
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
Re: pic18f67k22 eeprom memory error
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 declarationmaney 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)
Code: Select all
<LIB>
<ALIAS>EEPROM</ALIAS>
<FILE>__Lib_EEPROM_256</FILE>
<TYPE>REGULAR</TYPE>
</LIB>
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: pic18f67k22 eeprom memory error
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
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
Re: pic18f67k22 eeprom memory error
Hie
Thank you, Janni and Marina .
it worked well by editing the .mlk file.
With Regards,
Maney Mongia
Thank you, Janni and Marina .
it worked well by editing the .mlk file.
With Regards,
Maney Mongia