18F45K50 EEPROM problem(solved)

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

18F45K50 EEPROM problem(solved)

Post by GTF »

What might cause nothing to be written to the EEPROM? The program does not stall at any of the read or writes, but there is no data stored? I can get it to work with a bare bones EEPROM only test program, and it was working fine in my program up until yesterday. I have disabled any new code and most of the old code and it still doesn't work. Can't get past the initial calibration sequence anyway because the "calibrated" value never gets written to EEPROM. There is a reset at the end of this sequence and a "calibrated" check at startup. All EEPROM addresses remain FF. Tested on 2 different chips.

Don't see much difference in the assembled write code other than bank usage(test code on the right works). Variable list is getting long though.
Attachments
EEPROM.jpg
EEPROM.jpg (163.54 KiB) Viewed 12038 times
Last edited by GTF on Tue Mar 29, 2016 1:49 am, edited 2 times in total.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: 18F45K50 EEPROM problem

Post by kersing »

Please post your flowchart or a simple test flowchart so we can check the calling sequence etc.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: 18F45K50 EEPROM problem

Post by GTF »

The simple test flowcharts attached seem to work, mostly. But then I am only writing/reading to 1 or 2 addresses and have only 3-4 variables. My program should write to 28 EEPROM addresses during calibration, including a final write to address dec 52 of the dec value "126". I can see values written now, but they don't seem correct. The 4 addresses in the top row should all be written "0" during a recalibration. Sometimes there is a "FF or two". Other writes appear to be randomly missed as well. I'm using a fresh PCB today. The correct value "126" appears to have been written at the end of the calibration sequence in this image, but the program always ends up in the flashing LED loop at startup rather than continuing to the main program loop. I have not made any changes to this portion of the flowchart since back when it was a V5 project.
Attachments
EEPROM_Test.fcfx
(13.29 KiB) Downloaded 416 times
decision.jpg
decision.jpg (126.49 KiB) Viewed 12025 times
EEPROM1.jpg
EEPROM1.jpg (126.3 KiB) Viewed 12025 times
Last edited by GTF on Sat Mar 26, 2016 11:41 pm, edited 2 times in total.

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: 18F45K50 EEPROM problem

Post by GTF »

The other small test program.

I think the changes I made just before the problem started was adding a circular buffer and a macro that reads those 5 top row addresses and sends the values out the UART. That macro is currently deleted.
Attachments
EEPROM_Test_2.fcfx
(20.82 KiB) Downloaded 412 times

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: 18F45K50 EEPROM problem

Post by GTF »

This test program randomly worked a few times, but mostly will not. When it doesn't, nothing appears to be written to EEPROM. Code read in and read out are identical on compare.
Attachments
EEPROM_Test_3.fcfx
(20.12 KiB) Downloaded 405 times

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: 18F45K50 EEPROM problem-SOLVED

Post by GTF »

The programs work fine if I use code blocks for the EEPROM write/reads rather than the FC EEPROM component. New test program attached.

So I reviewed the CAL and FCD files again. It appears that the incorrect eeprom type is specified in the FCD. It should be type 3 not type 2. Seems to be working with just that correction.
Attachments
45K50 eeprom type.jpg
45K50 eeprom type.jpg (209.75 KiB) Viewed 11995 times
45K50 eeprom CAL.jpg
45K50 eeprom CAL.jpg (19.73 KiB) Viewed 11995 times
EEPROM_Test_4.fcfx
(21.69 KiB) Downloaded 413 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 18F45K50 EEPROM problem

Post by medelec35 »

Hi Grant,
Good spot!
I will move this topic to the bugs section for Matrix to post corrective update.

Martin
Martin

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: 18F45K50 EEPROM problem(solved)

Post by Benj »

Hello,

Yes a good find indeed. I have now applied the fix to the 18F24K50, 25K50 and 45K50 FCDs.

I'll try and do a post 6.1.3 release of the bug fixes some time this week so all the current fixes are in one place.

Post Reply