PIC24FJxxGB002 and GA002

Any bugs you encounter with Flowcode should be discussed here.
alanwms
Posts: 117
http://meble-kuchenne.info.pl
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

PIC24FJxxGB002 and GA002

Post by alanwms »

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.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: PIC24FJxxGB002 and GA002

Post by BenR »

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.

alanwms
Posts: 117
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

Re: PIC24FJxxGB002 and GA002

Post by alanwms »

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.
Attachments
Test 3.fcfx
(29.53 KiB) Downloaded 149 times
Last edited by alanwms on Tue Feb 23, 2021 7:21 pm, edited 1 time in total.

alanwms
Posts: 117
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

Re: PIC24FJxxGB002 and GA002

Post by alanwms »

I checked the remap pin Yes/no selection. It is greyed out. The pin IS remapped to B8

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: PIC24FJxxGB002 and GA002

Post by p.erasmus »

alanwms 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.
Hi
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


P1.jpg
P1.jpg (59.34 KiB) Viewed 4512 times

Hope this helps
:D
Regards Peter - QME Electronics

alanwms
Posts: 117
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

Re: PIC24FJxxGB002 and GA002

Post by alanwms »

Thanks. The PIC24 family "GB" allows me to select 5 timers. I run the simulator, and have independent control over the pwm values.

Do I miss something?

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: PIC24FJxxGB002 and GA002

Post by p.erasmus »

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

P1.jpg
P1.jpg (19.37 KiB) Viewed 4487 times
Regards Peter - QME Electronics

alanwms
Posts: 117
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

Re: PIC24FJxxGB002 and GA002

Post by alanwms »

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.

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: PIC24FJxxGB002 and GA002

Post by p.erasmus »

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 :D
if one is working you will get to do the others as well :D Let us try together to solve this and the exact device number you are using
Regards Peter - QME Electronics

alanwms
Posts: 117
Joined: Fri Dec 04, 2020 2:29 pm
Has thanked: 24 times
Been thanked: 7 times

Re: PIC24FJxxGB002 and GA002

Post by alanwms »

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)
Attachments
Schematic snapshot.jpg
Schematic snapshot.jpg (116.73 KiB) Viewed 4464 times
GB Program LED Driver.fcfx
(33.95 KiB) Downloaded 144 times

Post Reply