Cannot store data to PIC18F4680 data EEPROM - SOLVED

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Cannot store data to PIC18F4680 data EEPROM - SOLVED

Post by Brendan »

Hello All.

I'm having a devil of a job trying to poke bytes into a PIC18F4680 Data EEPROM (I'm using address range 0x00 to 0x32 (50d). No evident problems with FCV6 or the compiler, and when I run the project in FCV6 it all works just fine (I'm using the EB005 display to confirm EEPROM reads). However, I compile the project to the PIC and the data EEPROM never gets programmed, no-matter what I try. I should also add that I have all the various write and read protection bits disabled in the configuration panel.

I've been struggling with this most of today, so any informed advice or possible gotcha's would be most gratefully received !!!

Thank you in advance.

Brendan
Last edited by Brendan on Tue Feb 04, 2014 11:55 am, edited 1 time in total.

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Cannot store data to PIC18F4680 data EEPROM

Post by Kenrix2 »

So glad you started this post. This issue has been a thorn in my side for quite sometime now, so I understand your reason for posting. This issue is not limited to Flowcode V6. It also affects Flowcode V4 and V5. It is also not limited to that chip. I have not been able
to find a target device that it does work on. Through research I have found It has also been an issue with other programming
software providers, so it not an uncommon problem. However, I can't even determine if the issue is with Flowcode or PPP, so I have
no idea on how to correct it. Unlike you, I use Pickit2, so I get a message "Warning: Hex File Loaded is larger than device.".
I originally was unclear if this was a specific issue with the pickit2 but, obviously after your post is clearly isn't. If anyone
is willing to help on this very important issue, instructions for preloading data into eeprom is found on page 41 of the
sourceboost manual. The manual is included with the Flowcode installation. I place the code and data into the supplementary code,
which is the only place I know of to include it. If you create a program with "Initialization of EEPROM Data" and compile it, view
the asm file. At the very bottom is the address and data for the eeprom. The address seems to be the problem. This issue really is
an important requirement for many programs that need starting points or other initialization data using non-volatile data that is
easily adjusted using the EEPROM component. Any help would be very much appreciated.

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Cannot store data to PIC18F4680 data EEPROM

Post by Kenrix2 »

It turns out this is not a Flowcode issue. I finally found a way to fix it after reading this post in the sourceboost forums:
http://forum.sourceboost.com/index.php?showtopic=5020
Here is an example of supplementary code that loads data into the eeprom starting at eeprom location zero:
#pragma DATA 0xF000, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15
I have only tested this on a few 12 and 16 series chips so I don't know if it will work on your chip.

Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Re: Cannot store data to PIC18F4680 data EEPROM

Post by Brendan »

Hi Kenrix.

MANY thanks indeed for your interest and replies, and Kudos to you sir - A valuable find !

As I understand it, it looks like there's an erroneous header file and/or datasheet that's been doing the rounds. Certainly one gotcha to watch for, particularly in light of your own similar experiences.

I re-built for the 16F887 and all worked as sweet as a nut, but the RAM's too restrictive. Keeping things simple, I've just received some 16F1939's so will rebuild for that.

Fingers crossed :)


All the best,

Brendan

Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Re: Cannot store data to PIC18F4680 data EEPROM - SOLVED

Post by Brendan »

Update: As anticipated, no EEPROM issues with the 16F1939 either :D


All the best,

Brendan

Post Reply