Need for help with EEPROM

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
Erik-Odinsvej
Posts: 20
Joined: 21 Jan 2008 21:37

Need for help with EEPROM

#1 Post by Erik-Odinsvej » 29 Sep 2020 22:13

I cannot get eeprom to work in AVR pascal for an ATMEGA328p, when I use the example in the help file it only work as long I have power on my device,
example I use following from example file:
for counter := 0 to 31 do EEPROM_Write(0x100 + counter, counter);

In datasheet I can use addresses from 0 to 1023
and when I read it back:

for counter := 0 to 31 do // Read 32 bytes block from address 0x100
begin
PORTC := EEPROM_Read(0x100+counter); // and display data on PORTC
Delay_ms(100);
end;
Then all works well but if I change my program and only want to read and not write to eeprom, then all byte I read is 255 ! ???
it have complete forgot the byte I write to eeprom before.
can anybody tell me what is wrong, I have read several time in the datasheet but cannot see what I do wrong.

really hope for a solution cos I need to store some data in the eeprom for to read everytime I turn on my project
Best regards Erik

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Need for help with EEPROM

#2 Post by filip » 13 Oct 2020 09:02

Hi,

I apologize for the late reply, have you been able to sort out this issue ?

Regards,
Filip.

Erik-Odinsvej
Posts: 20
Joined: 21 Jan 2008 21:37

Re: Need for help with EEPROM

#3 Post by Erik-Odinsvej » 18 Mar 2021 10:58

And I also sorry for the late reply, I got it sorted Thank you

Post Reply

Return to “mikroPascal PRO for AVR General”