18F45K50 EEPROM problem(solved)

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

Moderator: Benj

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)

Postby GTF » Sat Mar 26, 2016 2:01 am

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 4873 times
Last edited by GTF on Tue Mar 29, 2016 1:49 am, edited 2 times in total.

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: 18F45K50 EEPROM problem

Postby kersing » Sat Mar 26, 2016 9:45 am

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

Postby GTF » Sat Mar 26, 2016 8:04 pm

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 144 times
decision.jpg
decision.jpg (126.49 KiB) Viewed 4860 times
EEPROM1.jpg
EEPROM1.jpg (126.3 KiB) Viewed 4860 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

Postby GTF » Sat Mar 26, 2016 8:19 pm

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 151 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

Postby GTF » Sun Mar 27, 2016 3:34 am

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 154 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

Postby GTF » Sun Mar 27, 2016 7:23 pm

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.76 KiB) Viewed 4830 times
45K50 eeprom CAL.jpg
45K50 eeprom CAL.jpg (19.73 KiB) Viewed 4830 times
EEPROM_Test_4.fcfx
(21.69 KiB) Downloaded 156 times
These users thanked the author GTF for the post (total 3):
medelec35 (Sun Mar 27, 2016 7:58 pm) • kersing (Sun Mar 27, 2016 8:03 pm) • Benj (Tue Mar 29, 2016 11:18 am)
Rating: 16.67%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8334
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2382 times
Been thanked: 3393 times
Contact:

Re: 18F45K50 EEPROM problem

Postby medelec35 » Sun Mar 27, 2016 8:00 pm

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

Martin
These users thanked the author medelec35 for the post:
Benj (Tue Mar 29, 2016 11:21 am)
Rating: 5.56%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Re: 18F45K50 EEPROM problem(solved)

Postby Benj » Tue Mar 29, 2016 11:27 am

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.