FC6 with PIC18F2420 EE-Prom Problem

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

Moderator: Benj

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Sun Mar 16, 2014 11:31 pm

Hello together,


Í have a Problem with write and read to the EE-Prom at a PIC18F2420.
This function is not possible anymore with the amount of code, I have a feeling.
The Errors is a bit strange. If I try a EE-Prom W/R with less code then in the compiler summary below, it works.

If I write and read from my PICKIT-2, I can adress the EE_Prom too.

I have the Feeling that the Problem could be related to the read an write cycle that the EE_prom needs.

Could there be some disturbance to the write/read cycle??
Are there any restrictions??
Has anybody made some similar expierence?

Compiler Summary:
RAM available:768 bytes, used:222 bytes (29.0%), free:546 bytes (71.0%),

Heap size:546 bytes, Heap max single alloc:127 Bytes

ROM available:16384 bytes, used:12004 bytes (73.3%), free:4380 bytes (26.7%)

MY FC6 is Version 6.0.1.0

BR

Dirk

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: FC6 with PIC18F2420 EE-Prom Problem

Postby kersing » Sun Mar 16, 2014 11:43 pm

Hi Dirk,

Please use "Check for Updates..." from the "Help" menu to update to 6.0.4.0, then test again.

Jac
These users thanked the author kersing for the post:
Dirk Bubley (Mon Mar 17, 2014 5:58 pm)
Rating: 5.56%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Mon Mar 17, 2014 12:21 am

Many thanks Jac for the fast late reply.

Update patch done to 6.0.4.0.

Unfortunatly no Change of the Problem.

Is there a difference in resetting the Pic18F2420?

If a do a EE-Prom read with the follwing reset of the device, then my EE-prom value at the beginning of the Programm is read perfectly

If I do a regular OFF/ON reset the device does not read the EE-Prom.

Strange....

BR

Dirk

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: FC6 with PIC18F2420 EE-Prom Problem

Postby kersing » Mon Mar 17, 2014 12:30 am

Which eeprom location are you using? According to forum messages it's better to avoid using the first byte (0).
These users thanked the author kersing for the post:
Dirk Bubley (Mon Mar 17, 2014 5:58 pm)
Rating: 5.56%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Mon Mar 17, 2014 12:50 am

Hi,

I tried adress number 0,1 and 255. Same results, same Problem.

Maybe something in the middle could be a try.

BR

Dirk

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Mon Mar 17, 2014 12:59 am

...just checked EEProm adress 100!

Same Problem!

BR

Dirk

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: FC6 with PIC18F2420 EE-Prom Problem

Postby kersing » Mon Mar 17, 2014 1:21 am

One thing to try is to add a small delay (100ms to 1 s) to the start of your code. If that does not work, could you post a simple test flowchart we can take a look at?
These users thanked the author kersing for the post:
Dirk Bubley (Mon Mar 17, 2014 5:58 pm)
Rating: 5.56%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Mon Mar 17, 2014 10:02 am

...delay before and after is also not solving the problem.

I observed the following with no change in my code and the same chip:

If I do a EE-Prom read only of the chip from my Pickit-2. The reading after this reset of the EE-Prom cell in the programm is then done correctly.

If I do a power OFF/ON of the chip, the reading of the EE-Prom cell is not done, it looks that EE-Prom function and reading is skipped or ignored.
This looks to me like a EE-Prom initilized problem.

BR

Dirk

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: 4080 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Benj » Mon Mar 17, 2014 11:03 am

Hello Dirk,

I found a problem with the EEPROM on some 18F devices last week.

Here is an updated chip definition file for the 18F2420 with the problem resolved.

Place the attached file into your "Flowcode 6/FCD/PIC" folder before starting Flowcode to load in the changes.

18F2420.fcdx
(25.89 KiB) Downloaded 53 times


Let me know how you get on.
These users thanked the author Benj for the post:
Dirk Bubley (Mon Mar 17, 2014 5:58 pm)
Rating: 5.56%
 

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Mon Mar 17, 2014 5:57 pm

Hello Ben,

many thanks for your fast support. That new file solved the Problem!! :D

Great!!

BR

Dirk

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Fri Dec 07, 2018 2:51 pm

Hi Ben,

hope you are well.

I must recall this old Topic again because I tested today a new PIC with EE-Prom

It is a PIC18F2520. I observed the same Problem that I can`t read an write to the EE-Prom.

Maybe there is also updated PIC18F2520 Definition file needed too.

I would apreachiate if you could take a look at this issue.

BR

Dirk

Dirk Bubley
Posts: 87
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 9 times
Been thanked: 8 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Postby Dirk Bubley » Fri Dec 07, 2018 3:33 pm

Hello together,

problem solved. Somtimes the Problem is sitting in front of the PC!! :wink:

The mistake was that the EE-Prom Write function was not reached by the Programm.

BR
Dirk
These users thanked the author Dirk Bubley for the post:
Benj (Fri Dec 07, 2018 3:48 pm)
Rating: 5.56%