PIC24F16KA102 compile to HEX problem

Use this section to discuss your embedded Flowcode projects.
Post Reply
canary_wharfe
Posts: 78
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

PIC24F16KA102 compile to HEX problem

Post by canary_wharfe »

flowchart simulates ok and compiles to C but has huge syntax & declaration fail errors on assembly and hex generation.
The flowchart compiles to HEX just fine on an PIC8 compiler when changing to a PIC18 device in the configuration menu. Also other simple test programs using the PIC24F16KA102 compile just fine on the PIC16 compiler. However, as soon as I add in PWM and I2C and so on and try compiling all hell breaks loose. Pls. see attached txt report. I can upload the flowcode file if wanted. I'm pretty certain from the report that the problem is a mismatch in syntax expected by the assembler routine. (Ignore the name of the PIC in the attachment filename in case it causes confusion. The device being used in the flowcode is the PIC24F16KA102 and the problem is in Flowcode v9 as well as v8 which is why this is on the Flowcode 9 forum)
Attachments
24FV16KM102 3 Switch Dual Speed Increment Decrement Button Menu Example (Flowcode 8).msg.txt
(23.13 KiB) Downloaded 63 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: PIC24F16KA102 compile to HEX problem

Post by BenR »

Hello,

If you close and reopen the project after you have changed the target device does this make any difference?

Please can you attach the project and we will investigate for you.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: PIC24F16KA102 compile to HEX problem

Post by canary_wharfe »

Hi Ben

No,, closing and reopening the project makes no difference. However the project was originally created using an 8 bit PIC device in Flowcode. I then changed to the current 16 bit PIC2416KA102. I tested the simulation so far all good. Saved the file with a new filename and then tried compiling and then the total failure as per attached txt file. Is it possible somehow Flowcode has managed to incorporate the old 8 bit PIC definitions into the later PIC24F16 file? Perhaps some bug that is not clearing the cache from the PC? I have never seen so many definition error messages. Anyway attached is the project file and the error msg report for your examination. Looking forward to learning what is going on. It does compile to get the c code. It's getting the HEX file when things go haywire. Thanks for the support.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: PIC24F16KA102 compile to HEX problem

Post by BenR »

Hello,

It's something to do with the EEPROM component Initial Values property, If the values are removed then the project compiles correctly.

I'll investigate what the problem might be.

For now in your program you can check to see if the location 0 of the EEPROM is 0xFFFF, if it is then you know the EE memory is unprogrammed and you can set the values you need to 0. This only works if 0xFFFF is a value you don't genuinely need to store into EE location 0.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: PIC24F16KA102 compile to HEX problem

Post by canary_wharfe »

Hello again Ben

I can probably use the 0xFFFF workaround and delete the initial values from the EEPROM. I think it's worth getting to the bottom of the problem as the initial pre-loaded values in the EEPROM component is a useful device and if the bug whatever it is is not cured then it could potentially lead to limiting the use of the EEPROM component for all users. I'd appreciate an update on it when you've had the time to delve into it further.
best regards etc.

EDIT: Have now deleted the initial values from the EEPROM and also changed the default port/pin for the internal PWM o/p as per your other response on the other topic. Flowcode is simulating and compiling the changes perfectly.
Can now continue with the development knowing I can use the 5V 24FVKM102 version of the device. Still dying to know how those pre-loaded values in the EEPROM can freak out the linker/assembler.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: PIC24F16KA102 compile to HEX problem

Post by canary_wharfe »

Hello Ben

Just wondering if you've had time to look into what is causing the linker / assembler to bomb out when preloading values into the EEPROm component?

Post Reply