Page 1 of 1
18F45K50 EEPROM problem(solved)
Posted: Sat Mar 26, 2016 2:01 am
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.
Re: 18F45K50 EEPROM problem
Posted: Sat Mar 26, 2016 9:45 am
by kersing
Please post your flowchart or a simple test flowchart so we can check the calling sequence etc.
Re: 18F45K50 EEPROM problem
Posted: Sat Mar 26, 2016 8:04 pm
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.
Re: 18F45K50 EEPROM problem
Posted: Sat Mar 26, 2016 8:19 pm
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.
Re: 18F45K50 EEPROM problem
Posted: Sun Mar 27, 2016 3:34 am
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.
Re: 18F45K50 EEPROM problem-SOLVED
Posted: Sun Mar 27, 2016 7:23 pm
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.
Re: 18F45K50 EEPROM problem
Posted: Sun Mar 27, 2016 8:00 pm
by medelec35
Hi Grant,
Good spot!
I will move this topic to the bugs section for Matrix to post corrective update.
Martin
Re: 18F45K50 EEPROM problem(solved)
Posted: Tue Mar 29, 2016 11:27 am
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.