PIC16(L)F18446.fcdx more wrong definitions

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
miggarc
Posts: 52
http://meble-kuchenne.info.pl
Joined: Mon Jan 04, 2021 8:08 pm
Has thanked: 7 times
Been thanked: 4 times

PIC16(L)F18446.fcdx more wrong definitions

Post by miggarc »

Hi

On May 31, 2022 10:38 pm I posted a bug report named
PIC16(L)F18446.fcdx with wrong definitions .

You promptly solved this uC definitions and all compile well.

At.that time anoter problem arrived:
It simulates as if all is correct (functioning as expected) but, after compiled (no errors)
and transfered to the real PIC16LF18446 it doesn't work

You suggested me to add this code
T2CLKCONbits.CS = 2;
T2HLTbits.MODE = 0;

And all workes wlas it should.


The current problem is, when adding TMR4 with same properties and also adding the suggested code (adapted to tmr4) to that initially attached Flowchart, when compiling, it says

16f18446.c: main()
2516: T4CONbits.T2CKPS = 6;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S508
XmiPRO2chargerExtraControl_Basic_tests_v0.7_16f18446.c: myisr()
3481: FCM_TRM2_int_process();
^ (361) function declared implicit int (warning)
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

Can you help me?

It seams to me there are more errors in the definition s file for this uC .
Could it be ?
Last edited by miggarc on Sat Jun 11, 2022 6:21 pm, edited 1 time in total.

Many thanks in advance,


Miguel Garcia,
Electronic Systems Developer

Steve-Matrix
Matrix Staff
Posts: 1234
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: PIC16(L)F18466.fcdx more wrong definitions

Post by Steve-Matrix »

miggarc wrote:
Thu Jun 09, 2022 9:40 am
16f18446.c: main()
2516: T4CONbits.T2CKPS = 6;
^ (255) not a member of the struct/union ""
It looks like this should maybe be "T4CONbits.T4CKPS" in the FCD definition file. I will ask for this to be updated.

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

Re: PIC16(L)F18466.fcdx more wrong definitions

Post by BenR »

Hello,

Many thanks for letting us know.

I have now fixed the typo for you on the Timer4 interrupt and also added clock source options for Timers 2/4/6 so you can set what clock is driving the timer without using C code.

The latest fixes should now be available via the library updates.

miggarc
Posts: 52
Joined: Mon Jan 04, 2021 8:08 pm
Has thanked: 7 times
Been thanked: 4 times

Re: PIC16(L)F18446.fcdx more wrong definitions

Post by miggarc »

Hi...

Thanks for the rapid intervention on correcting the definitions file for the PIC16LF18446 .
It's compiling correctly now ... ( at least until next errors reveal themselves ) .

About the rest of the message:

On a previous post of mine, PIC16(L)F18446.fcdx with wrong definitions (continuation) , I alerted for a problem
about this timer source select drop down (which already exists).

"
I found result frequency doesn't change with different options from Clock Source Select ,
at least for any PIC16LF18446 timer interrupt properties where this drop down exists.
"

... and Steve answered me this ( Steve-Matrix » Tue Jun 07, 2022 8:38 am ) ,

"
We are aware of this issue. Please see here:

https://www.flowcode.co.uk/forums/viewt ... 6844#p6844
"

So, it was already there but still not working and, from what Steve said, this will work only after the releasing of FC10,
which I hop not (so long time to wait)...
Last edited by miggarc on Sat Jun 11, 2022 6:22 pm, edited 1 time in total.

Many thanks in advance,


Miguel Garcia,
Electronic Systems Developer

Steve-Matrix
Matrix Staff
Posts: 1234
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: PIC16(L)F18466.fcdx more wrong definitions

Post by Steve-Matrix »

Hi Miguel,

The problem where the timer interrupt frequency is incorrectly calculated should not affect the code or performance of your project. That is, the figure that Flowcode calculates does not take into account the actual clock divider of the option chosen and always assumes it it the main clock speed divided by 4. So the figure shown at the bottom of that window is potentially wrong with some of the options used for the interrupt.

Modern microcontrollers offer a vast array of options for their internal timers and it is difficult to provide a comprehensive coverage of all the options across all the chip families we support. We do expose these options to allow advanced users to take advantage of these complex features, but caution is advised and we recommend the operation of your code in the microcontroller is always thoroughly checked before it is released.

Regarding the release of v10, we are progressing well with this and expect a release before the end of the year.

Post Reply