Author Topic: RPi PWM GPIO Waveform Stability  (Read 1162 times)

0 Members and 1 Guest are viewing this topic.

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 3895
  • Country: us
RPi PWM GPIO Waveform Stability
« on: December 22, 2021, 05:00:24 pm »
We have a RPi 400 (and 4) that is used as a controller using Python. GPIO 18 (pin 12) is used as a variable clock source to create a 1Hz to 10KHz programmable clock. Using the standard RPi GPIO PWM method produces a clock that has quite a bit of somewhat random period variations, and doing a search for a more stable output comes up with a hardware PMW mode vs. the standard mode but without details on how to implement in the RPi 4 using Python.

Does anyone have a simple RPi 4 with Python solution?

Best,
« Last Edit: December 22, 2021, 05:38:20 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online thm_w

  • Super Contributor
  • ***
  • Posts: 7179
  • Country: ca
  • Non-expert
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 
The following users thanked this post: mawyatt

Offline mawyattTopic starter

  • Super Contributor
  • ***
  • Posts: 3895
  • Country: us
Re: RPi PWM GPIO Waveform Stability
« Reply #2 on: December 23, 2021, 12:38:29 am »

Already having trouble with pigpiod but didn't know why, got the error message not recognized by OS. After reviewing raspberrypi forum you pointed out, the thread indicated things changed with the I/O structure in the RPi 4 and the DMA worked differently, thus effecting the pigpio. We updated and upgraded Raspbien OS, then the OS would recognize sudo pigpiod and now we can use the pi.hardware_PWM() command.

So it seems this issue has been corrected with the RPi 4 in the latest OS upgrade/update.

Thanks for the help, much appreciated :-+

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf