Problem on 24FJ256GA106 and PWM
Moderator: Benj
-
- Posts: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Problem on 24FJ256GA106 and PWM
Hi !
I have troubles when compiling on Flowcode 4 for dsPIC with an 24FJ256GA106 and PWM macro.
Is it possible to have a look at this ?
Thank you for your help
I have troubles when compiling on Flowcode 4 for dsPIC with an 24FJ256GA106 and PWM macro.
Is it possible to have a look at this ?
Thank you for your help
- Attachments
-
- PWM test.fcf_pic16
- (5.5 KiB) Downloaded 319 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: Problem on 24FJ256GA106 and PWM
Hello,
I think if you add this C code to the defines section of the supplementary code window available from the project options window then it should fix the issue.
I think if you add this C code to the defines section of the supplementary code window available from the project options window then it should fix the issue.
Code: Select all
#define OC1CON OC1CON1
#define OC2CON OC2CON1
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: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Yeah, it compiles well !
Thank you for the tip. I don't know if it works in the real life because I don't have my bord yet but I will post here as soon as I can.
Bye
Thank you for the tip. I don't know if it works in the real life because I don't have my bord yet but I will post here as soon as I can.
Bye
- 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: Problem on 24FJ256GA106 and PWM
Ok no problem, let me know how you get on.
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: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Hello and best wishes for this new year
I think there is still a problem.
The program compile well but I can't see anything on the right pin.
I want to have my PWM on RP2/RD8 pin so I added this line in your pwm.c file :
RPOR1bits.RP2R = 0x12;
Nothing nothing nothing...
Do you have any idea ?
Thank you
I think there is still a problem.
The program compile well but I can't see anything on the right pin.
I want to have my PWM on RP2/RD8 pin so I added this line in your pwm.c file :
RPOR1bits.RP2R = 0x12;
Nothing nothing nothing...
Do you have any idea ?
Thank you
Last edited by Mathy on Wed Jan 09, 2013 9:17 am, edited 1 time in total.
-
- Posts: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Is it possible to the MM staff to have a look quickly on that ?
I'm blocked on my SPI accelerometer in flowcode 5 for PIC and now with PWM functionality with flowcode 4 for Dspic.
All my electronic board are already manufactured by Eurocircuits and now I have to load the program but it is impossible due to flowcode bugsssss
If you tell me that it is my problem and sort this out, OK. But if I could use some features of the software I purchased, it would be better.
Thank you for understanding.
I'm blocked on my SPI accelerometer in flowcode 5 for PIC and now with PWM functionality with flowcode 4 for Dspic.
All my electronic board are already manufactured by Eurocircuits and now I have to load the program but it is impossible due to flowcode bugsssss
If you tell me that it is my problem and sort this out, OK. But if I could use some features of the software I purchased, it would be better.
Thank you for understanding.
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Hi
You need to set it to 12 hex,, i.e. 0x12 or 18 decimal.
Regards,
Leigh
You need to set it to 12 hex,, i.e. 0x12 or 18 decimal.
Regards,
Leigh
Code: Select all
RPOR1bits.RP2R = 0x12;
-
- Posts: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Hi,
Thank you for your tips but I already edit my post because of this stupid mistake
But, no way, even if I set the right value, nothing happen
Thank you for your tips but I already edit my post because of this stupid mistake
But, no way, even if I set the right value, nothing happen
-
- Posts: 333
- Joined: Mon Oct 05, 2009 2:39 pm
- Has thanked: 30 times
- Been thanked: 33 times
- Contact:
Re: Problem on 24FJ256GA106 and PWM
Hello,
Just for information, I think there is really a bug with Flowcode and the 24FJ256GA106 ( I don't know if other 16bit PIC MCU are concerned ).
Because writing completely the PWM function in C and including it in my Flowcode program and it works like a charm !
So problem solved for me.
I have to see now what is going wrong with your accelerometer component in SPI mode with Flowcode 5 for 8bit PIC.
Have a nice day.
Just for information, I think there is really a bug with Flowcode and the 24FJ256GA106 ( I don't know if other 16bit PIC MCU are concerned ).
Because writing completely the PWM function in C and including it in my Flowcode program and it works like a charm !
So problem solved for me.
I have to see now what is going wrong with your accelerometer component in SPI mode with Flowcode 5 for 8bit PIC.
Have a nice day.
- 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: Problem on 24FJ256GA106 and PWM
Hello,
I see you are using PWM channel 3 which in the latest release I think should default to pin RP20 or 0x14.
Can you check this pin to see if PWM is working there as your setting could be being overridden by the Flowcode FCD and CAL setup.
It should be possible to change the default PWM pin by editing the FCD file and changing these lines of code in the [defines].
To what ever RP pin you require.
I see you are using PWM channel 3 which in the latest release I think should default to pin RP20 or 0x14.
Can you check this pin to see if PWM is working there as your setting could be being overridden by the Flowcode FCD and CAL setup.
It should be possible to change the default PWM pin by editing the FCD file and changing these lines of code in the [defines].
Code: Select all
Define139=#define MX_PWM_1_RP_OC 0x0012
Code: Select all
Define149=#define MX_PWM_3_RP_OC 0x0014
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