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
Pic18FxxK22 family: PMW Timer 2 only available timer
Moderator: Benj
Re: Pic18FxxK22 family: PMW Timer 2 only available timer
Hi Benj
I ask you if you can solve what you wrote in the previous post
thank you
I ask you if you can solve what you wrote in the previous post
thank you
- 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: Pic18FxxK22 family: PMW Timer 2 only available timer
Hello,
Please give the attached files a go.
The first file needs to live in your "Flowcode 7/FCD/PIC" folder.
The next file needs to live in your "Flowcode 7/CAL/PIC" folder.
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.
Please give the attached files a go.
The first file needs to live in your "Flowcode 7/FCD/PIC" folder.
The next file needs to live in your "Flowcode 7/CAL/PIC" folder.
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.
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: Pic18FxxK22 family: PMW Timer 2 only available timer
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
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
- 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: Pic18FxxK22 family: PMW Timer 2 only available timer
Aha thanks,
Please try this instead.
Please try this instead.
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: Pic18FxxK22 family: PMW Timer 2 only available timer
I tried the new CAL, and all 3 timers work perfectly
thanks for your help
best regards
thanks for your help
best regards
- 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: Pic18FxxK22 family: PMW Timer 2 only available timer
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
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
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