I have used Pigpio library to generate pulses on rasp pi2 since last year. The all thing have worked quite good. But 3 days ago, the my rasp appear faults and it don't accept me use more. So I must install programming again as well as format SD card. But when I generate 40khz pules is that oscilloscope only dislay about 32.55khz. I using wavePWM library of pigpio. Please give me how to resolve this problem. This is code that I used:
/*
import pigpio
import wavePWM
from socket import*
import numpy
import numpy as np
import pickle
import operator
import sys, struct
pi = pigpio.pi()
if not pi.connected:
exit(0)
"""
This code demonstrates four different methods of setting
the pulse start and length.
"""
pwm = wavePWM.PWM(pi) # Use default frequency
pwm.set_frequency(40000)
cl = pwm.get_cycle_length()
# Method 2.
pwm.set_pulse_start_and_length_in_micros(2,0, 12.5) // 2 is GPIO pin that generate 40khz, 0 is time delay and 12.5 is duty cycle 50%.
pwm.update() # Apply all the changes.
time.sleep(120)
for g in GPIO:
pwm.set_pulse_length_in_micros(g, 0)
pwm.update()
time.sleep(1)
pwm.cancel()
pi.stop()