Page 1 of 2

PIC16F18345 EEPROM Compiler problem founded

Posted: Tue Oct 03, 2017 3:04 am
by danilof
I am user of V6 FlowCode and doing test before purchase the FlowCode 7. Using the PIC PIC16F18345 it is giving me error on EEPROM compilation. The error is as following:

PIC16F18345

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_EEPROM.c: FC_CAL_EE_Read()
52: EECON1bits.EEPGD = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S585
56: data = EEDATA;
^ (192) undefined identifier "EEDATA"
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_EEPROM.c: FC_CAL_EE_Write()
75: EEDATA = Data;
^ (192) undefined identifier "EEDATA"
80: EECON1bits.EEPGD = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S585
(908) exit status = 1
(908) exit status = 1

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Tue Oct 03, 2017 5:51 pm
by Benj
Hello,

I've moved your post as it is a new and unrelated problem.

Let me investigate for you, hopefully should be fairly easy to solve.

Edit: this looks to have already been solved. Try using the updated files available via the link below and hopefully these should solve the problem for you.
viewtopic.php?f=63&t=18760

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Tue Oct 03, 2017 9:20 pm
by danilof
Dear Benj,

Thanks your help. I have download the zip file and restarted the Flowcode 7 and the problem still the same. Could you please look it for me? It happen in Read and also write function of EEPROM.
52: EECON1bits.EEPGD = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S585
56: data = EEDATA;
^ (192) undefined identifier "EEDATA"
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_EEPROM.c: FC_CAL_EE_Write()
75: EEDATA = Data;
^ (192) undefined identifier "EEDATA"
80: EECON1bits.EEPGD = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S585
(908) exit status = 1
(908) exit status = 1

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Tue Oct 03, 2017 10:50 pm
by medelec35
Hi danilof,
I have created a flowchart using 16F18345.
Write and read operations involving EEPROM, flowchart compile ok.
Did your pc give you the option to over right existing files and did you restart or reload flowchart?

Can you post the flowchart that's causing erorrs.

Martin

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 12:47 am
by danilof
Dear Martin, yes, I did a reload, a restart on the computer after done the over right the files, but the problem still the same.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 6:41 am
by medelec35
Hi danilof,
Your flowchart compiles for me:

Code: Select all

arget folder: C:\Users\Martin\DOWNLO~1
Source name:   C:\Users\Martin\Downloads\teste.fcfx
Title:         
Description:   
Device:        PIC.16F.16F18345
Generated by:  Flowcode v7.2.1.4
Date:          Wednesday, October 04, 2017 05:58:07
Users:         1
Registered to: Martin
Licence key:   BA48R5
http://www.flowcode.co.uk
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe  --chip=16F18345 "teste.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

. . . .


Memory Summary:
    Program space        used    4Ch (    76) of  2000h words   (  0.9%)
    Data space           used    23h (    35) of   400h bytes   (  3.4%)
    EEPROM space         used     0h (     0) of   100h bytes   (  0.0%)
    Data stack space     used     0h (     0) of   3DCh bytes   (  0.0%)
    Configuration bits   used     4h (     4) of     4h words   (100.0%)
    ID Location space    used     0h (     0) of     4h bytes   (  0.0%)


You have compiled in FREE mode.
Using Omniscient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See http://www.microchip.com/MPLABXCcompilers for more information.
So if you replaced the files from the post of Ben's link, then not sure why compiles for me yet does not compile for you?
Can you go to \Flowcode 7\CAL\PIC folder and Attach

Code: Select all

PIC_CAL_EEPROM.c
file.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 6:11 pm
by danilof
Dear Martin, see the attached file as requested. I did not understand why it is happening either. Another interesting thing, Today when I started the FC7 it showed me again as the first time, requesting again 30 days trial period.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 7:16 pm
by medelec35
Hi danilof,
Has your Flowcode done a repair I wonder?

After downloaded the HashCalc 2.02, here are the results:
CRC32 of PIC_CAL_EEPROM.c
From my Flowcode folder = 26fb2b4f
Yours = 5ac0a1ee
Original before updated files = 5ac0a1ee
Updated files From this post = 26fb2b4f
So looks like the issue is your files have not been successfully updated.

Martin

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 11:14 pm
by danilof
Dear Martin, Now is working. Many Thanks.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Oct 04, 2017 11:17 pm
by medelec35
Your welcome
That's great.
Thanks for the update.

Martin.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 2:49 pm
by danilof
Thanks your help. Now I have the following problem: It works fine on the Flowcode simulation, read and write on the EEprom, but when I place it to works, programming the PIC, it not write on the EEprom. Also reading the eeprom it show me on the first EEmem addresss the following: 00,01,02,03,41,62,48,65,6C,6C,6F,FF,FF,FF,FF,0B . . . . A b H e l l o . . . . .

The code is attached. Please let me know where is the fault.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 3:32 pm
by medelec35
Hi danilof,
danilof wrote: It works fine on the Flowcode simulation, read and write on the EEprom,
Have you posted correct Flowchart as it looks like there is no way to access Macro_OK?
danilof wrote:Also reading the eeprom it show me on the first EEmem addresss the following: 00,01,02,03,41,62,48,65,6C,6C,6F,FF,FF,FF,FF,0B . . . . A b H e l l o . . . . .
If you look a the properties of EEPROM you will see there is an Initial Values section.
All you need to so is click on the text box so

Code: Select all

0,1,0x2,0x03,'A','b',"Hello"
is highlighted, then press Backspace or delete key to clear the text box.

Martin

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 5:11 pm
by danilof
Another interesting thing is why it write on the memory the following: 00,01,02,03,41,62,48,65,6C,6C,6F,FF,FF,FF,FF,0B . . . . A b H e l l o . . . . .. I see that it happen on the start of running without call the EEMEM Function.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 5:13 pm
by danilof
Thanks again, Now I understood why it write 00,01,02,03,41,62,48,65,6C,6C,6F,FF,FF,FF,FF,0B . . . . A b H e l l o . . . . ..

But why I am not being succesfully to write on the EEMEM?

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 5:33 pm
by danilof
Martin, I can write using the simulation of the flowcode, but when I program the chip it is not writing. Is there anything wrong on the configuration or on the program?

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Wed Nov 01, 2017 6:34 pm
by danilof
It write 00,01,02,03,41,62,48,65,6C,6C,6F,FF,FF,FF,FF,0B . . . . A b H e l l o . . . . .. but not using the EEPROM macro instruction.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Thu Nov 02, 2017 1:02 pm
by danilof
Dear Martin, attached the result showing the Flow code simulation result and the real read operation on the EEprom. It shows that on the simulation AA, that is ok and when reading the PICF18345 EEMEM it is FF instead AA on 0xFE Address.

It showuld be AA and is FF. Could it be the Macro EEPROM not working? Or any of configuration in my program?

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Thu Nov 02, 2017 1:23 pm
by danilof
Attached the EEPROM RESULT. See that the Initial valueas are present "Blockline V.1" but the AA on the address oxFE is not present.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Thu Nov 02, 2017 8:53 pm
by danilof
Martin,

I have dne the same test using PI16F1829 and works. It means write on the EEPROM such as Intial values as also write on the Address I place on the EEPROM macro.

I believe there are some problem on the EEPROM macro.

Both write Initial values but only the 16F1835 do not write on the Specifi address used by the EEPROM MACRO.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Fri Nov 03, 2017 3:36 pm
by danilof
Martin, please could you help me on it? What could be the fault? Another question, on FC7 the "View ASM" is not more available?

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Sat Nov 04, 2017 4:17 am
by danilof
Martin,

I suspect that the write routine on PIC16f18345 to write the EEPROM is not addressing (address + 7000h). Unfortunately in FC7 does not show the ASM generated by the compiller.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Sat Nov 04, 2017 11:33 am
by medelec35
I agree it is odd.
Since OK_REG will always be 0 as the Read EEPROM address 0xFE does not assign itself to a variable as that has been left out.
Therefore the routine will always write 0xAA at address 0xFE.
This is odd as its writing the

Code: Select all

BLOCKLINE V.1
OK.
Have you tried changed address FE to a lower one?
E.g 0x0D?
As I Don't have PIC16F18345 I can tell if its an issue with your chip, programmer or EEPROM component with Flowcode?
You can get assembly from the generated .as file after compiling.

Martin

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Sat Nov 04, 2017 4:24 pm
by danilof
Hi martin,

Looking the .as file I could see the following:

l1983:
movlw 020h
movlb 0 ; select bank0
movwf (FCD_06651_eeprom1__Write@FCL_ADDRESS)
movlw 0
movwf ((FCD_06651_eeprom1__Write@FCL_ADDRESS))+1
movlw 0A5h
movwf (FCD_06651_eeprom1__Write@FCL_VALUE)
movlw 0
movwf ((FCD_06651_eeprom1__Write@FCL_VALUE))+1
fcall _FCD_06651_eeprom1__Write


Verify that it is writing 020h to lower address and 0 to the Higher address of the EEPROM. I believe it should be 020h on the lower addresss and 070h on the higher address. I am correct on it? I do not know if the problem is just the address as showed above, may be has other problems than this to write on this new family of PIC type EEPROM.

Could you please verify it? Could you using the MPLAB simulate run it and verify? I believe it happen because it is a new family of PIC and the way of EEPROM working is different of the others, and so I believe that this problem happen in all the new family that has the same EEPROM Type configuration.

Attached the file file corresponding that generate this result.

Would be very nice if the FC7 maintain the .asm files as present on FC6. It help a lot on debug.

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Sat Nov 04, 2017 5:15 pm
by danilof
Martin,

I have done a change on the program to try to see if works as attached, and it results:

l1983:
movlw 020h
movlb 0 ; select bank0
movwf (FCD_06651_eeprom1__Write@FCL_ADDRESS)
movlw 070h
movwf ((FCD_06651_eeprom1__Write@FCL_ADDRESS))+1
movlw 0B5h
movwf (FCD_06651_eeprom1__Write@FCL_VALUE)
movlw 0
movwf ((FCD_06651_eeprom1__Write@FCL_VALUE))+1 ???????????????
fcall _FCD_06651_eeprom1__Write
line 178

But still not writting on the EEPROM. Another question: Why it Write also on the FCL_VALUE?

Re: PIC16F18345 EEPROM Compiler problem founded

Posted: Sat Nov 04, 2017 5:43 pm
by danilof
Martin,
Note 1: It was tested not in just one PIC device, and also in different address.

Note 2: Could you send me a C Code write operation for the PIC16F18345 EEPROM? I will try it insteady of use the EEPROM Component software device.

Brgds,


Danilo Ferraz