EEPROM on 16F872

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

EEPROM on 16F872

Post by andygraves »

Doing some testing with EEPROM, so made a quick prog to store a value to EEPROM and retrieve it on powerup, all works fine in the panel but on the chip the value is lost (it returns the address instead of the data. Any clues...?
FLASH.fcf

andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

Re: EEPROM on 16F872

Post by andygraves »

Here is the FC4 file
Attachments
FLASH.fcf
EEPROM TEST
(11.5 KiB) Downloaded 237 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EEPROM on 16F872

Post by Benj »

Hi Andy

The EEPROM will get erased during programming by default. Could this be the cause of the problem.
Or is it also getting erased on a reset?

If you need to disable the programming EEPROM erase then information an be found on this here.
http://www.matrixmultimedia.com/mmforum ... ROM#p17227

andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

Re: EEPROM on 16F872

Post by andygraves »

Hi Ben,
Even after a reset...
Thanks
Andy

andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

Re: EEPROM on 16F872

Post by andygraves »

Hi Ben, Just tried it with a 16F88 and code is works ok?

andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

Re: EEPROM on 16F872

Post by andygraves »

Hi Ben, is the a chip problem or FC problem?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EEPROM on 16F872

Post by Benj »

Hi Andy

It is unlikely to be a chip problem unless you have had it for a while or it has been a bit abused in the past.

I will get one of these devices and see if I can find out whats going wrong.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EEPROM on 16F872

Post by Benj »

Hello Andy

I have had a quick dig around and may have a solution to the problem.

Please can you try the following.

Open the 16F872.fcd file from the "C:\Program Files\Matrix Multimedia\Flowcode vx\FCD\" folder in a text editor and then scroll down to the [Defines] section.

At the bottom of this section add the line

Define22=#define MX_EE_TYPE2

Save the file, restart Flowcode and re-compile to your target. Hopefully the problem will now be resolved on the hardware.

let me know how you get on

andygraves
Posts: 18
Joined: Wed Jan 06, 2010 2:59 pm
Contact:

Re: EEPROM on 16F872

Post by andygraves »

Hi Ben,
Yes that sorted it, thank you.
Do such fixes find their way into future versions?
Thanks
Andy

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EEPROM on 16F872

Post by Benj »

Hello Andy,

Yes I will make sure that this makes it into the next release.

Post Reply