gordon77
Posts: 5680
Joined: Sun Aug 05, 2012 3:12 pm

Pico pwm duty range

Fri May 07, 2021 8:16 am

Why does this example say the range is 0 to 65025 when 0 to 65535 appears to work ?

https://projects.raspberrypi.org/en/pro ... the-pico/7

User avatar
joan
Posts: 15619
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pico pwm duty range

Fri May 07, 2021 8:46 am

I think it is just an example. Does it say it's the maximum range permitted.

Indeed it does. A mistake then.

User avatar
B.Goode
Posts: 12074
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pico pwm duty range

Fri May 07, 2021 9:35 am

{ misunderstanding - removed }
Last edited by B.Goode on Fri May 07, 2021 3:49 pm, edited 1 time in total.

gordon77
Posts: 5680
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pico pwm duty range

Fri May 07, 2021 10:42 am

B.Goode wrote:
Fri May 07, 2021 9:35 am
The generic uPython docs just say 'an integer'.

https://docs.micropython.org/en/latest/ ... hlight=pwm




Perhaps it should be raised as a Documentation Issue here: https://github.com/raspberrypilearning/ ... issues/new
Cheers, it also says "value in the range 0 to 65535 inclusive." :D

User avatar
B.Goode
Posts: 12074
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pico pwm duty range

Fri May 07, 2021 11:16 am

{ misunderstanding - removed }
Last edited by B.Goode on Fri May 07, 2021 3:49 pm, edited 1 time in total.

gordon77
Posts: 5680
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pico pwm duty range

Fri May 07, 2021 3:36 pm

B.Goode wrote:
Fri May 07, 2021 11:16 am

Pedantically, isn't that for the Duty Cycle, not the Frequency?
Where did it say it was the frequency ?

User avatar
B.Goode
Posts: 12074
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Pico pwm duty range

Fri May 07, 2021 3:54 pm

Apologies. I misread the original Project page, which begins a paragraph talking about frequency (in bold type) and then segues into talking about duty cycle with no similar emphasis.

The salient point is that there seems to be no justification for the limit implied in the Project text.

Return to “General programming discussion”