EEPROM issues

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

Moderator: Benj

Post Reply
Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

EEPROM issues

Post by Lord Grezington »

Hello

Did a program a while back on V5, I now needed to updated with some EEPROM settings. I am using 18F25K22 and it already has some EEPROM variables being used successfully.

I program the Write and Read macros exactly the same as the other ones, however no matter what I do I cant get he EEPROM to work... However it compiles every time.

So, I opened the file up in F6, and now it refuses to compile saying:

C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(72): EEPROM error - MX_EEADR not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(75): EEPROM error - MX_EEDATA not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(134): EEPROM error - MX_EEADR not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(137): EEPROM error - MX_EEDATA not set
4 errors detected
Error: preprocessing error
failure
Completed BoostC compilation, return = 1


Anyone know of a solution?

Thanks

GRaham

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: EEPROM issues

Post by Benj »

Hello Graham,

I've just tested it here and it seems to be working. Maybe you could try my EEPROM CAL file to see if this fixes your compilation problem.

The file needs to be placed into your "Flowcode 6\CAL\PIC" directory.
PIC_CAL_EEPROM.c
(4.11 KiB) Downloaded 302 times
Let me know how you get on.

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: EEPROM issues

Post by Lord Grezington »

Hi Ben

No, just tried it, still gives the same error...

I have attached the V6 program, can you see if it will compile for you?

Graham
Attachments
V6 EEPROM issues.fcfx
(177.18 KiB) Downloaded 283 times

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: EEPROM issues

Post by Benj »

Hi Graham,

It's compiling fine for me. Please can you confirm your using Flowcode version 6.1.3.

I've also attached the current definition file just in case this is what is causing problems.

This file lives in the "Flowcode 6/FCD/PIC" folder.
18F25K22.fcdx
(36.21 KiB) Downloaded 276 times

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: EEPROM issues

Post by Lord Grezington »

Hi Ben

I am using V 6.1.4

Here is more details on the compiler message if it helps

Launching the compiler...
C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\boostc_18f.exe -v -t PIC%(chip:u) "V6 EEPROM issues.c"
Launching BoostC...
BoostC Optimizing C Compiler Version 7.20 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2013 Pavel Baranov
Copyright(C) 2004-2013 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited


V6 EEPROM issues.c
Starting preprocessor: "C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\pp.exe" "V6 EEPROM issues.c" -i "C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\include" -d _PICPIC -la -c2 -o "V6 EEPROM issues.pp" -v -d _BOOSTC -d _PIC18 -d _CHAR_INDEX

C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(72): EEPROM error - MX_EEADR not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(75): EEPROM error - MX_EEDATA not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(134): EEPROM error - MX_EEADR not set
C:\Program Files (x86)\Flowcode 6\CAL\PIC\PIC_CAL_EEPROM.c(137): EEPROM error - MX_EEDATA not set

4 errors detected
Error: preprocessing error

failure
.
Completed BoostC compilation, return = 1

C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\boostc_18f.exe reported error code 1


FINISHED

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: EEPROM issues

Post by Benj »

Hello,

This bit of the command line to the compiler looks wrong.

C:\Program Files (x86)\Flowcode 6\compilers\pic\boostc\boostc_18f.exe -v -t PIC%(chip:u) "V6 EEPROM issues.c"

Can you click on Build -> Compiler options.

The settings for a PIC should look like this.

Compiler Location: $(appdir)compilers\pic\boostc\boostc_$(family:/12F/16F).exe
Compiler Parameters: -v -t PIC$(chip:u) "$(target).c"

Linker Location: $(appdir)compilers\pic\boostc\boostlink_picmicro.exe
Linker Parameters: -ld "$(appdir)compilers\pic\boostc\lib" libc_$(family:/12F/16F).lib rand_$(family:/12F/16F).lib float_$(family:/12F/16F).lib "$(target).obj" -t PIC$(chip:u) -d "$(outdir:~-1)" -p "$(target)" -swcs 6 2

It looks like you have a % symbol instead of the expected $ symbol.

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: EEPROM issues

Post by Lord Grezington »

Hi Ben

Thanks for this, V6 will now compile however the code is no longer working on hardware. Are there some common things that typically go wrong from taking V5 code to V6 or will I need to fault find the whole code?

Thanks

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: EEPROM issues

Post by Benj »

Hello,

Maybe check the configuration settings. v5 used PPP to define the configuration but v6 uses Flowcode itself so maybe things could have changed here?

A 1 second flasher test is useful to check the configuration and that the device is running at the correct speed.
https://www.matrixtsl.com/wikiv7/index. ... ED_flasher

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: EEPROM issues

Post by Lord Grezington »

Hi Ben

There were a number of configuration settings incorrect. After matching them exactly the program compiled ok, but did not work.

Put a two second loop at the start of the program to check the clock settings, this works ok.

I have attached the program, maybe you can see something obvious.

Thanks
Attachments
V6 EEPROM issues.fcfx
(176.61 KiB) Downloaded 308 times

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: EEPROM issues

Post by Benj »

Hello,

We added EEPROM initialisers in v6, look at the EEPROM component properties.

Maybe delete the contents of the Initial values property and this will do the job of setting EEPROM locations to 255 after programming.

Other then that nothing is springing to mind.

Post Reply