PIC16F18345 EEPROM Compiler problem founded
Moderator: Benj
PIC16F18345 EEPROM Compiler problem founded
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
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
- 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: PIC16F18345 EEPROM Compiler problem founded
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: PIC16F18345 EEPROM Compiler problem founded
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
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
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
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
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
Martin
Re: PIC16F18345 EEPROM Compiler problem founded
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.
- Attachments
-
- teste.fcfx
- (7.15 KiB) Downloaded 253 times
-
- teste.msg.txt
- (486 Bytes) Downloaded 241 times
-
- teste.c
- (3.3 KiB) Downloaded 250 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
Hi danilof,
Your flowchart compiles for me:
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 file.
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.matrixtsl.com
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.
Can you go to \Flowcode 7\CAL\PIC folder and Attach
Code: Select all
PIC_CAL_EEPROM.c
Martin
Re: PIC16F18345 EEPROM Compiler problem founded
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.
- Attachments
-
- PIC_CAL_EEPROM.c
- (2.65 KiB) Downloaded 259 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
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
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
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
Your welcome
That's great.
Thanks for the update.
Martin.
That's great.
Thanks for the update.
Martin.
Martin
Re: PIC16F18345 EEPROM Compiler problem founded
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.
The code is attached. Please let me know where is the fault.
- Attachments
-
- teste2.fcfx
- (33.54 KiB) Downloaded 232 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
Hi danilof,
All you need to so is click on the text box so is highlighted, then press Backspace or delete key to clear the text box.
Martin
Have you posted correct Flowchart as it looks like there is no way to access Macro_OK?danilof wrote: It works fine on the Flowcode simulation, read and write on the EEprom,
If you look a the properties of EEPROM you will see there is an Initial Values section.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 . . . . .
All you need to so is click on the text box so
Code: Select all
0,1,0x2,0x03,'A','b',"Hello"
Martin
Martin
Re: PIC16F18345 EEPROM Compiler problem founded
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
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?
But why I am not being succesfully to write on the EEMEM?
Re: PIC16F18345 EEPROM Compiler problem founded
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
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
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?
It showuld be AA and is FF. Could it be the Macro EEPROM not working? Or any of configuration in my program?
- Attachments
-
- teste2.fcfx
- (33.9 KiB) Downloaded 150 times
-
- eeprom test.png
- (271.11 KiB) Downloaded 4567 times
Re: PIC16F18345 EEPROM Compiler problem founded
Attached the EEPROM RESULT. See that the Initial valueas are present "Blockline V.1" but the AA on the address oxFE is not present.
- Attachments
-
- EEPROM RESULT.png
- (11.01 KiB) Downloaded 4566 times
Re: PIC16F18345 EEPROM Compiler problem founded
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.
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.
- Attachments
-
- EEPROM MACRO FAULT.png
- (2.49 KiB) Downloaded 4525 times
Re: PIC16F18345 EEPROM Compiler problem founded
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
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.
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.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F18345 EEPROM Compiler problem founded
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 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
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
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
Martin
Re: PIC16F18345 EEPROM Compiler problem founded
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.
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.
- Attachments
-
- TEST PICF18345.fcfx
- (7.33 KiB) Downloaded 134 times
Re: PIC16F18345 EEPROM Compiler problem founded
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?
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?
- Attachments
-
- TEST PICF18345 T2.fcfx
- (7.33 KiB) Downloaded 146 times
Re: PIC16F18345 EEPROM Compiler problem founded
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
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