Pic18FxxK22 family: PMW Timer 2 only available timer

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Bruno
Posts: 17
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 2 times
Contact:

Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Bruno » Sat Oct 06, 2018 4:48 pm

Hi
I'm using a pic18F24K22 and I'm having trouble selecting the PWM timer:
only timer2 is available. for the whole family K22 there is the same problem while for the K40 family there is the possibility to use also timer4 and timer6.
I read that the same problem was also found with the pic16F18323 and it was solved. Can it also be solved for the 18FxxK22 family?

best regards

Bruno
Posts: 17
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 2 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Bruno » Mon Oct 08, 2018 12:03 pm

Hi Benj
I ask you if you can solve what you wrote in the previous post
thank you

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Benj » Tue Oct 09, 2018 10:27 am

Hello,

Please give the attached files a go.

The first file needs to live in your "Flowcode 7/FCD/PIC" folder.

18F24K22.fcdx
(35.49 KiB) Downloaded 27 times


The next file needs to live in your "Flowcode 7/CAL/PIC" folder.

PIC_CAL_PWM.c
(34.96 KiB) Downloaded 31 times


If this works ok then I'll add the mod for the whole family and add to the v7 update archive as well as roll it across into v8.

Bruno
Posts: 17
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 2 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Bruno » Tue Oct 09, 2018 12:12 pm

HI Benj
Thank you for your reply.
I did what you said, but the compiler gives the following error:

Target folder: C:\Users\BRUNOS~1\Desktop\TM0
Source name: C:\Users\Bruno Sgammato\Desktop\TM0\Test_PWM_24k22.fcfx
Title:
Description:
Device: PIC.18F.18F24K22
Generated by: Flowcode v7.3.0.6
Date: Tuesday, October 09, 2018 12:58:12
Users: 1
Registered to: B.Sgammato
Licence key: 5061QD
http://www.matrixtsl.com
Avvio del compilatore...
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=18F24K22 "Test_PWM_24k22.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

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_ChangePeriod_1()
733: MX_TIMERSELECT0bits.C1TSEL = 0;
^ (192) undefined identifier "MX_TIMERSELECT0bits"
^ (196) struct/union required
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_ChangePeriod_2()
868: MX_TIMERSELECT0bits.C2TSEL = 1;
^ (192) undefined identifier "MX_TIMERSELECT0bits"
^ (196) struct/union required
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_ChangePeriod_3()
882: MX_TIMERSELECT0bits.C3TSEL = 1;
^ (192) undefined identifier "MX_TIMERSELECT0bits"
^ (196) struct/union required
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_ChangePeriod_4()
1041: MX_TIMERSELECT1bits.C5TSEL = 2;
^ (192) undefined identifier "MX_TIMERSELECT1bits"
^ (196) struct/union required
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe ha riportato il codice di errore 1

TERMINATO

regards

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Benj » Tue Oct 09, 2018 1:04 pm

Aha thanks,

Please try this instead.

PIC_CAL_PWM.c
(34.85 KiB) Downloaded 27 times

Bruno
Posts: 17
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 2 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Bruno » Tue Oct 09, 2018 1:46 pm

I tried the new CAL, and all 3 timers work perfectly :D :D

thanks for your help

best regards
These users thanked the author Bruno for the post:
Benj (Tue Oct 09, 2018 3:01 pm)
Rating: 5.56%
 

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: Pic18FxxK22 family: PMW Timer 2 only available timer

Postby Benj » Tue Oct 09, 2018 3:15 pm

Brilliant, thanks for letting me know.

I've now rolled out this to the whole K22 family and posted the files here.
viewtopic.php?f=63&t=19743&p=86234#p86234