Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:17 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite Phase Correct PWM

     Page 2 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:35am 10 Jan 2023
Copy link to clipboard 
Print this post

Thanks for the explanation. Since the SYNC option is undocumented I can change it so the new version of the PWM command will be:

PWM channel, frequency, [dutyA] [,dutyB] [,phasecorrect] [,deferredstart]


Like deferredstart, phasecorrect will be a boolean (0 or 1) and the command will automatically correct for the frequency. Watch for the V5.07.07 beta thread.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5091
Posted: 09:45am 10 Jan 2023
Copy link to clipboard 
Print this post

Beautifull !!

(note that phasecorrect requires to double to frequency the PWM runs on, if that can be done in MMBasic then it is completely transparent.

Volhout

P.S. phase correct is something that virtually all PWM's support, so this likely can also be ported to CMM2. Just to keep the flagship on par with the small pico vessel...
It is really astonishing what functionality the pico has. I think there is no basic in the world with this level of peripheral support. Not even the old HPbasic.
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:57am 10 Jan 2023
Copy link to clipboard 
Print this post

  Quote  It is really astonishing what functionality the pico has.


Yes. And there are some things I haven't seen anywhere else like the sync. Basically each channel has an enable bit in its control and status register like every other chip. However, there is also a master enable register that allows a single instruction to enable any selection of channels simultaneously. This effectively means you can have a 16 output PWM if you want (16 phase clock anyone ?)
The firmware has to be a bit clever in keeping track of which channels are in use, not only for PWM, but also for audio and LCD backlight but with a bit of housekeeping the functionality is really useful.

I just wish they would bring out a version of the chip with a fixed ADC as that is its real weakness at the moment.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 10:36am 10 Jan 2023
Copy link to clipboard 
Print this post

I would be amazed if they are not working on a upgraded version, simply because this one has been so well accepted, realising that over the last few months it has almost been the only option! but anyway, just the concept of the PIO and how it's been implemented does as you say give it amazingly flexible functionality.
Personally I'm hoping for a bit more ram and a few more PIO blocks, better RTC, upgraded ADC or two? but maybe they'll come up with something even nicer :-) All Pi! in the sky, they could equally well be working on their own replacement for the BCM27XX 28XX, even though they imply they are not, time will tell.
Regards,
Kevin.
Edited 2023-01-10 20:38 by Bleep
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025