I have been attempting to get 4 individual PWM signals using the PIC24FJ64GA002, nad I notice that the selection for timers only includes 2 timers. When I switch the target to the PIC"GB" version, I see 4 timer selections.
I looked at the Data Sheet. Both of these devices include 5 - 16bit timers and 5 PWM devices.
Needless to say, I can't get my PWM signals to operate.
I have selected individual channels for each of 4 PWM components, and even tried to program the "GA" as the "GB" with individual timers selected since there are 4 to choose from.
Is this a bug or am I missing something? Meantime, I will be ordering the GB chip to determine if that will work.
PIC24FJxxGB002 and GA002
-
- Posts: 133
- http://meble-kuchenne.info.pl
- Joined: Fri Dec 04, 2020 2:29 pm
- Has thanked: 26 times
- Been thanked: 7 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: PIC24FJxxGB002 and GA002
Hello,
I've had a look through the device definitions and the devices in the family should all have 5 PWM channels, Timers 2 and 3 as well as the prescalers are correct for what the device offers.
I've also looked at the CAL PWM C file and that also matches what is in the datasheet so it looks like the code is correct.
Have you selected a remap pin for each PWM channel via the component properties?
Please can you attach a project that demonstrates the problem and I'll see if I can help further.
I've had a look through the device definitions and the devices in the family should all have 5 PWM channels, Timers 2 and 3 as well as the prescalers are correct for what the device offers.
I've also looked at the CAL PWM C file and that also matches what is in the datasheet so it looks like the code is correct.
Have you selected a remap pin for each PWM channel via the component properties?
Please can you attach a project that demonstrates the problem and I'll see if I can help further.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: PIC24FJxxGB002 and GA002
Hello Ben.
See attached file. It is a mess based on attempting to get things running. I have 2 concerns.
I have 4 PWM channels and want them to be independent - With only 2 timers available to pick from, I think only two can be independent.FC9 gives me 2 timer selections for the pic24fjxxGA and 4 for the PIC24fjxxGB product. I'm confused since both data sheets indicate more than 2 timers. I will be installing the GB product, and hoping this goes away as an issue.
I am also attempting to measure an analog input - Should be a simple matter. I have put 2.5 volts DC directly onto the GA pin AN10 pin 25, and get zero. Any help would be appreciated. - Update - I changed the clock selection on the analog, and the an inputs started to work.
As an aside note - The pop up comments don't stay on the screen long enough to read. Short notes are ok, but the longer ones go away. Just thought that feedback would be beneficial. Ben.
See attached file. It is a mess based on attempting to get things running. I have 2 concerns.
I have 4 PWM channels and want them to be independent - With only 2 timers available to pick from, I think only two can be independent.FC9 gives me 2 timer selections for the pic24fjxxGA and 4 for the PIC24fjxxGB product. I'm confused since both data sheets indicate more than 2 timers. I will be installing the GB product, and hoping this goes away as an issue.
I am also attempting to measure an analog input - Should be a simple matter. I have put 2.5 volts DC directly onto the GA pin AN10 pin 25, and get zero. Any help would be appreciated. - Update - I changed the clock selection on the analog, and the an inputs started to work.
As an aside note - The pop up comments don't stay on the screen long enough to read. Short notes are ok, but the longer ones go away. Just thought that feedback would be beneficial. Ben.
- Attachments
-
- Test 3.fcfx
- (29.53 KiB) Downloaded 586 times
Last edited by alanwms on Tue Feb 23, 2021 7:21 pm, edited 1 time in total.
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: PIC24FJxxGB002 and GA002
Hialanwms wrote: ↑Tue Feb 23, 2021 4:52 pm
I have 4 PWM channels and want them to be independent - With only 2 timers available to pick from, I think only two can be independent.FC9 gives me 2 timer selections for the pic24fjxxGA and 4 for the PIC24fjxxGB product. I'm confused since both data sheets indicate more than 2 timers. I will be installing the GB product, and hoping this goes away as an issue.
Yes the device has more than 2 Timers however for the output Compare module of the dsPIC33 and PIC24 Family you can only select Timer 2 or 3 as the time base ,This with 2 timers and 4 PWM's you can have 2 different frequencies as the Family only allow for 2 timers to be connected to the OCxCON register. This is my understanding of the Manual, See the reference manual 7000515A
Hope this helps

Regards Peter - QME Electronics
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: PIC24FJxxGB002 and GA002
Yes that is correct as you will see from the Datasheet you can select 5 timers one for each output Compare module therefore 5 different frequency PWM signal this is Possible on the GB family not the GA family
Regards Peter - QME Electronics
Re: PIC24FJxxGB002 and GA002
Thankyou Peter. That makes me feel good! I thought I was going nuts. Currently, I can't get PWM signals on the pins. It works on the sim but I don't see signals on the scope.
I suspect something to do with the config, but I have exhausted those empirically since the details are elusive to me. I have enabled the PWM components, and setup the registers with a nominal value - I see the signals on sim but not on the hardware.
Do you have any thoughts? I will continue investigating.
I suspect something to do with the config, but I have exhausted those empirically since the details are elusive to me. I have enabled the PWM components, and setup the registers with a nominal value - I see the signals on sim but not on the hardware.
Do you have any thoughts? I will continue investigating.
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: PIC24FJxxGB002 and GA002
Hi.
Yes they are tricky little devices,
What clock frequency are you using and what PWM frequency you want send me 1 frequency and your clock frequency and I will try to help you
if one is working you will get to do the others as well
Let us try together to solve this and the exact device number you are using
Yes they are tricky little devices,
What clock frequency are you using and what PWM frequency you want send me 1 frequency and your clock frequency and I will try to help you

if one is working you will get to do the others as well

Regards Peter - QME Electronics
Re: PIC24FJxxGB002 and GA002
Perfect thank you - I have done a little experiment, and found that I can get pin 7 to produce the PWM when I assign to that pin, but not the others. I have attached my FC9 file and schematic portion for reference.
It's looking maybe the reassignment of pins is not working? Pins 16.17, and 18 are scope dead.
Not too concerned about the frequency, just want a signal. I'm using inductors and will need to run around 6 - 10khz. I am boosting and bucking from 150v DC power supply to obtain 234V and 96 V respectively. That stuff is working (Tested on a channel I could get running)
It's looking maybe the reassignment of pins is not working? Pins 16.17, and 18 are scope dead.
Not too concerned about the frequency, just want a signal. I'm using inductors and will need to run around 6 - 10khz. I am boosting and bucking from 150v DC power supply to obtain 234V and 96 V respectively. That stuff is working (Tested on a channel I could get running)
- Attachments
-
- Schematic snapshot.jpg (116.73 KiB) Viewed 8872 times
-
- GB Program LED Driver.fcfx
- (33.95 KiB) Downloaded 401 times