FC6 with PIC18F2420 EE-Prom Problem

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

Moderator: Benj

Post Reply
Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

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: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by kersing »

Hi Dirk,

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

Jac
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

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: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by kersing »

Which eeprom location are you using? According to forum messages it's better to avoid using the first byte (0).
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

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: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

...just checked EEProm adress 100!

Same Problem!

BR

Dirk

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

Post by kersing »

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?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

...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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Benj »

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 238 times
Let me know how you get on.

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

Hello Ben,

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

Great!!

BR

Dirk

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

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: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: FC6 with PIC18F2420 EE-Prom Problem

Post by Dirk Bubley »

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

Post Reply