The PIC16F15344 PWM component can only be set to 8-bit mode.
Moderator: Benj
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Ben,
I would like to use the PWM periphery of the PIC16F15344 MCU in 10-bits mode.
The PWM component macro only supports 8-bits mode.
Is it possible to upgrade to 10 bits?
Thank you in advance,
Lagoda
I would like to use the PWM periphery of the PIC16F15344 MCU in 10-bits mode.
The PWM component macro only supports 8-bits mode.
Is it possible to upgrade to 10 bits?
Thank you in advance,
Lagoda
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
If you use the SetDutyCycle10Bit macro this should hopefully allow a 10-bit value 0-1023 to be accepted. Let me know if it's not working on hardware.
If you use the SetDutyCycle10Bit macro this should hopefully allow a 10-bit value 0-1023 to be accepted. Let me know if it's not working on hardware.
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
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Ben,
Thanks for the quick response.
I forgot about this option.
I tried the PWM macro with a PIC16F15324 MCU on a CURIOSITY board.
The PWM output is not working.
I also tried it with 8 Bit resolution, but it doesn't do anything.
What I have noticed is that the PWM macro offers 6 channels for use, but the MCU has only 4 channels.
Would you do to investigate what's wrong?
Lagoda
Thanks for the quick response.
I forgot about this option.
I tried the PWM macro with a PIC16F15324 MCU on a CURIOSITY board.
The PWM output is not working.
I also tried it with 8 Bit resolution, but it doesn't do anything.
What I have noticed is that the PWM macro offers 6 channels for use, but the MCU has only 4 channels.
Would you do to investigate what's wrong?
Lagoda
- Attachments
-
- PWM_test_8Bit_16F15324.fcfx
- (9.57 KiB) Downloaded 210 times
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
Have you tried channels 1 and 3? Channels 1-2 are CCP based outputs. Channels 3-6 are PWM based outputs, hence 6 available PWM type outputs.
Have you tried channels 1 and 3? Channels 1-2 are CCP based outputs. Channels 3-6 are PWM based outputs, hence 6 available PWM type outputs.
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
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Ben,
I also tried Channel 3 and Channel 4, but they don't work either.
Lagoda
I also tried Channel 3 and Channel 4, but they don't work either.
Lagoda
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Ben,
I found something.
The content of the T2CLKCON register is 0x00 so the selection of the clock source is incorrect (T2CKIPPS)
If I write 0x01 (Fosc / 4) into this register, the PWM signal appears on the selected port.
I only checked the proportions of the waveform with an old oscilloscope, but it looks good.
I hope this will help you in the repair.
Best Regards,
Lagoda
I found something.
The content of the T2CLKCON register is 0x00 so the selection of the clock source is incorrect (T2CKIPPS)
If I write 0x01 (Fosc / 4) into this register, the PWM signal appears on the selected port.
I only checked the proportions of the waveform with an old oscilloscope, but it looks good.
I hope this will help you in the repair.
Best Regards,
Lagoda
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
Brilliant that's great glad you have it solved and many thanks for letting us know.
I'm making a fix for the issue now and will roll it out to the update system tomorrow.
Brilliant that's great glad you have it solved and many thanks for letting us know.
I'm making a fix for the issue now and will roll it out to the update system tomorrow.
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
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
Are you running 8.1 with the latest updates.
I've looked at the code and just found this.
Looking at the 16F15344 device definition and the MX_PWM_NEW_TMR_CONF2 is being defined correctly?
You can check this by viewing the C code in Flowcode and right near the top should be this.
Are you running 8.1 with the latest updates.
I've looked at the code and just found this.
Code: Select all
#ifdef MX_PWM_NEW_TMR_CONF2
T2CLKCON = 1; //FOSC/4
#endif
You can check this by viewing the C code in Flowcode and right near the top should be this.
Code: Select all
#define MX_PIC
#define MX_CAL_PIC
#define MX_CLK_SPEED 19660800
#define FCP_NULL Unconnected_Port
#define MX_PWM_NEW_TMR_CONF2
#include <xc.h>
#include <math.h>
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
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Ben,
In my C file, this line looks like this:
#define MX_PWM_NEW_TMR_CONF
(If I overwrite CONF2 then it works. )
In my C file, this line looks like this:
#define MX_PWM_NEW_TMR_CONF
(If I overwrite CONF2 then it works. )
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hmm, Are you running 8.1 with the latest updates? Maybe it's an old bug that's been fixed
You can get 8.1 from here.
https://www.matrixtsl.com/flowcode/download/
You can get 8.1 from here.
https://www.matrixtsl.com/flowcode/download/
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
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi,
This version works for me. Before testing, I updated the Flowcode program.
It is also installed on multiple computers and each has a faulty result.
I did not modify the files that are part of Flowcode.
This version works for me. Before testing, I updated the Flowcode program.
It is also installed on multiple computers and each has a faulty result.
I did not modify the files that are part of Flowcode.
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
Ok that looks like the latest version. If you open a project and then click on Help -> Check for updates then this should show you any files used in your project with fixes or improvements.
If you change the "Files in use" at the bottom of the window to "full database" then this will show you the latest of everything.
Ok that looks like the latest version. If you open a project and then click on Help -> Check for updates then this should show you any files used in your project with fixes or improvements.
If you change the "Files in use" at the bottom of the window to "full database" then this will show you the latest of everything.
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
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
OK.
I used the "Full database" option and now I have a fresh and crisp Flowcode program.
And I restarted it after updating.
The result is the same as before.
Are you getting a flawless C file from the file (PWM_test_8Bit_16F15324.fcfx) I attached?
I used the "Full database" option and now I have a fresh and crisp Flowcode program.
And I restarted it after updating.
The result is the same as before.
Are you getting a flawless C file from the file (PWM_test_8Bit_16F15324.fcfx) I attached?
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hello Ben,
I think you have quite a lot of parallel tasks now.
Fixing this problem is not urgent for me, because I manually fix the wrong part in the C file and it will work. (I already know what to change. )
Thanks for the help.
Have a nice weekend!
Lagoda
I think you have quite a lot of parallel tasks now.
Fixing this problem is not urgent for me, because I manually fix the wrong part in the C file and it will work. (I already know what to change. )
Thanks for the help.
Have a nice weekend!
Lagoda
- 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: The PIC16F15344 PWM component can only be set to 8-bit mode.
Hi Lagoda,
Yes one or two on the go, support is not one of the main ones
I went through the definitions again this morning and checked that all the 16(L)F153xx family had the correct PWM definition. Most were ok but a couple were incorrect so these have now been sorted.
Hope you have a good weekend too.
I think you have quite a lot of parallel tasks now.
Yes one or two on the go, support is not one of the main ones
I went through the definitions again this morning and checked that all the 16(L)F153xx family had the correct PWM definition. Most were ok but a couple were incorrect so these have now been sorted.
Hopefully a new update will solve the issue but yes it's nice to have a workaround so you're not waiting on me.Fixing this problem is not urgent for me, because I manually fix the wrong part in the C file and it will work. (I already know what to change. )
Hope you have a good weekend too.
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