Go Down

Topic: Multi-channel High Frequency PWM with registers and phase shift capabilities (Read 5455 times) previous topic - next topic

HermannSW

vcgencmd "measure_clock" is really helpful in determining Pi Zero PWM clock. After reboot it is 0, after enabling and different settings it gives the current clock. For 1 not 9.6MHz but 5KHz gets selected, that seems to be the reason why tc_lib was not able to determine the period:
Code: [Select]
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=0
pi@raspberrypi01:~ $ gpio pwmc 0
gpio: clock must be between 0 and 4096
pi@raspberrypi01:~ $ gpio pwmc 4096
gpio: clock must be between 0 and 4096
pi@raspberrypi01:~ $ gpio pwmc 1
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=5000
pi@raspberrypi01:~ $ gpio pwmc 2
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=9600000
pi@raspberrypi01:~ $ gpio pwmc 3
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=6400000
pi@raspberrypi01:~ $ gpio pwmc 4
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=4800000
pi@raspberrypi01:~ $ gpio pwmc 4095
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=5000
pi@raspberrypi01:~ $ gpio pwmc 3590
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=5000
pi@raspberrypi01:~ $ gpio pwmc 3589
pi@raspberrypi01:~ $ vcgencmd measure_clock pwm
frequency(25)=6000
pi@raspberrypi01:~ $


Hermann.

HermannSW

Got a 100MHz logic analyzer today, and used it to verify the 26.21MHz measured averaged in previous posting. The logic analyzer measured 26.26MHz, quite close to the 26.21MHz measured via tc_lib. Details in this posting:
http://forum.arduino.cc/index.php?topic=417851.msg2888554#msg2888554
(right click for detailed view)


Hermann.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy