Tuesday, December 03, 2024
DIY Oscillator using PIC12F1571
video upload by alloutofsync
"I used this weekend to create a square wave oscillator that operates with the PIC12F1571, which is an extremely affordable CPU available for just $0.71 each.
Since it was my first time using PWM, I spent an entire day generating a square wave at the desired frequency. The required settings and their interconnections were so complex to me, so that I had to carefully investigate each one as I went, which was quite challenging.
The next day, I spent working on ensuring that the output sound smoothly followed the CV input. To convert the CV input into a frequency assuming 1V/Oct, exponential calculations are typically used. However, the PIC12F1571 has limited program memory, so I couldn't use a floating-point math library. I had no choice but to approximate the calculation of powers of two using a Taylor series expansion and rely solely on integer arithmetic. Initially, I approximated up to the second-order term, but the accuracy was insufficient at higher frequencies. Eventually, I extended the approximation to the fourth-order term, which gave excellent results.
While testing with the Pico3 sequencer, I noticed that when the RATE was set to the maximum, the output failed to keep up with the changes. Increasing the PIC's clock frequency from 1MHz to 4MHz resolved the issue, and it followed the changes without any problems.
At this point, about 70% of the program memory has already been used, so I'm not sure how much further I can expand. At the very least, I want to implement duty cycle adjustment. If possible, I’d also like to use an additional PWM channel to detune and combine the signals for richer synthesis."
PREVIOUS PAGE
NEXT PAGE
HOME
© Matrixsynth - All posts are presented here for informative, historical and educative purposes as applicable within fair use.
MATRIXSYNTH is supported by affiliate links that use cookies to track clickthroughs and sales. See the privacy policy for details.
MATRIXSYNTH - EVERYTHING SYNTH













© Matrixsynth - All posts are presented here for informative, historical and educative purposes as applicable within fair use.
MATRIXSYNTH is supported by affiliate links that use cookies to track clickthroughs and sales. See the privacy policy for details.
MATRIXSYNTH - EVERYTHING SYNTH
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: comments that insult people will be removed. Critique on gear is allowed. Do not ask if listings are still available. Click through auction links to check yourself. Posts and pics remain for historical purposes. To reduce spam, comments for posts older than one week are not displayed until approved (usually same day).