Pico PWM Frequency

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
chipfryer27
Valued Contributor
Posts: 1148
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Flowcode v10 Pico PWM Frequency

Post by chipfryer27 »

Hi

I've been playing with a Pico when I get time, and there is an issue with the PWM.

If I set it for a frequency of 5KHz then I get an actual frequency of 20Hz

Flowcode PWM=5KHz.jpg
Flowcode PWM=5KHz.jpg (62.49 KiB) Viewed 644 times
Analyser PWM=20Hz.jpg
Analyser PWM=20Hz.jpg (30.63 KiB) Viewed 644 times

Experimenting, if I set the component for a freqency of ~1.288MHz the I can get 5KHz.


Flowcode PWM=1288659Hz.jpg
Flowcode PWM=1288659Hz.jpg (27.88 KiB) Viewed 644 times
PWM=5KHz Analyser.jpg
PWM=5KHz Analyser.jpg (37.08 KiB) Viewed 644 times


5KHz_PWM.fcfx
(8.79 KiB) Downloaded 38 times

Just thought I'd let you know.

Regards

chipfryer27
Valued Contributor
Posts: 1148
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Pico PWM Frequency

Post by chipfryer27 »

Hi

It's as if whatever is entered is then shifted >>8

Regards

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Pico PWM Frequency

Post by medelec35 »

Hi Iain
Thank you for the report.
I believe I have fixed the frequency for the 10bit PWM.
If you want to use the 10bit, I have attached the modified cal file.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PICO
save the attached CAL in the above location.
Note: As PWM is 16bit, don't use 8bit set duty as the range will be severely limited.
Attachments
PICO_CAL_PWM.c
(4.8 KiB) Downloaded 42 times
Martin

chipfryer27
Valued Contributor
Posts: 1148
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Pico PWM Frequency

Post by chipfryer27 »

Hi Martin

Thanks, I'll try that tomorrow. I was using the 10-bit option.

Regards

chipfryer27
Valued Contributor
Posts: 1148
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 285 times
Been thanked: 412 times

Re: Pico PWM Frequency

Post by chipfryer27 »

Hi

Working fine now

FC_PWM.jpg
FC_PWM.jpg (18.3 KiB) Viewed 587 times
PWM Output.jpg
PWM Output.jpg (32.51 KiB) Viewed 587 times

Thanks.

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: Pico PWM Frequency

Post by medelec35 »

Hi Iain.
That's great, thanks for the update
I will ask for the modified file to be pushed to the update system.
Martin

Post Reply