PIC18F45K22 EEPROM

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
VladimirG
Posts: 39
Joined: 04 May 2012 10:52
Location: Canada

PIC18F45K22 EEPROM

#1 Post by VladimirG » 15 Jan 2018 08:12

Hi all,

Can anyone clarify how to write data to the PIC18F45K22 EEPROM? I created *.ihex dump file, added to my project, selected EEPROM library in the Library Manager.
Press Build and Program. The MikroProg Suite GUI appears. Press "Data" knobe" - Data Dump windows is empty (all cells are FF).
Press "Reload Hex". Data Dump window is filled with data from *.ihex file.
Press "Write", then "Read" - Data Dump windows is empty (all cells are FF).

What am I doing wrong? Is there any project setting missing?
Attachments
EEPROM.JPG
EEPROM.JPG (160.73 KiB) Viewed 2633 times

User avatar
strahinja.jacimovic
mikroElektronika team
Posts: 200
Joined: 18 Dec 2017 18:19

Re: PIC18F45K22 EEPROM

#2 Post by strahinja.jacimovic » 15 Jan 2018 13:34

Hi,

When you use the .hex file, it writes code to your MCU.

Now if your code didn't include any EEPROM writing, then of course it won't write to the memory.

Here is how you write to EEPROM: viewtopic.php?f=88&t=71526

Also, there is a protection that could be preventing you from writing to it.

Make sure to de-select Code Protect for Data EEPROM.

Kind regards,
Strahinja Jacimovic

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

Re: PIC18F45K22 EEPROM

#3 Post by janni » 15 Jan 2018 14:48

VladimirG wrote:Can anyone clarify how to write data to the PIC18F45K22 EEPROM? I created *.ihex dump file, added to my project, selected EEPROM library in the Library Manager.
I assume that you created the ihex file with help of EEPROM Editor. If you answered Yes to the question "Use this EEPROM definition in project?" then the ihex file is included in project's hex file (and visible in Project Manager in "EEPROM files").
Press Build and Program. The MikroProg Suite GUI appears. Press "Data" knobe" - Data Dump windows is empty (all cells are FF).
Press "Reload Hex". Data Dump window is filled with data from *.ihex file.
That would obviously be a quirk of mikroProg Suite if one had to reload hex file to see its contents though I don't see such behaviour for PIC18F45K22-based project (v. 2.51 of mikroProg Suite).
Press "Write", then "Read" - Data Dump windows is empty (all cells are FF).
Make sure that you have "Load/Save DATA" checked in mikroProg Suite and that in "Options" in "Advanced Options" group "Preserve DATA" checkbox is unchecked. As Strahinja suggested, "Data EEPROM Code Protection" needs to be disabled in Project Manager.

VladimirG
Posts: 39
Joined: 04 May 2012 10:52
Location: Canada

Re: PIC18F45K22 EEPROM

#4 Post by VladimirG » 17 Jan 2018 07:26

Hi strahinja and Janny,

Thanks for the inputs, I upgraded the MikroProg software and firmware, it seems everything works good now!

Regards,
Vlad

User avatar
strahinja.jacimovic
mikroElektronika team
Posts: 200
Joined: 18 Dec 2017 18:19

Re: PIC18F45K22 EEPROM

#5 Post by strahinja.jacimovic » 18 Jan 2018 10:28

I'm glad that you solved it.

Kind regards,
Strahinja Jacimovic

Post Reply

Return to “mikroPascal PRO for PIC General”