I have been doing some digging in the Daisy Hardware code and I see that some of the timers are implemented though there is a note about how some of the the advanced timer PWM controls are not
my main question is whether or not any of the GPIO pins currently free on the daisy could be used for
PWM control of the charge and discharge of a capacitor via a 4066 or DG switch chip
PWM audio
Pwm control of Motors etc
I’m really sorry for the delay in response. You can certainly use the GPIO pins for PWM, and I think what you listed off should be possible.
I found a small servo motor while cleaning so I just now hooked it up to my Daisy and I got it to move via PWM
Nothing deep with the code nor circuitry (I would need to amplify the 3V3 signal to get something robust!).
Have you encountered an issue while implementing those things with the Daisy’s PWM?
no i certainly have note encountered any issue— was really just wondering as I had not tried. Just curiosity as I am trying to figure out if the Daisy can handle different things.
I have only interacted with PWM on the arduino so I began searching in the Daisy folders for PWM and could not find anything.
because the HAL functions are behind a curtain with Daisy I usually first go to see if there is some intermediate function.
What we have so far is the software PWM with led.h. https://electro-smith.github.io/libDaisy/led_8h.html
That’s what I used to get a servo moving, but it sounds like hardware PWM is more suited for doing that. Coming from Arduino, I didn’t know that there was software and hardware PWMs, so I need to learn more about the differences.
as 1. it solves me wanting to use more timers on the daisy and
it implements match compare…
i have just spent the last two days looking through the current libdaisy and was stumped BUT somehow I forgot to take a look at the PR as I mistakenly thought it was just being created and was not very far along.
I will try to contact people on discord and see if I can understand the limitations etc. I am still not sure if any of the TIM objects would be “breaking”. having timers as outlined here would would be huge for many things
I will happily see if i can start experimenting with this next week.
I would love to make some experiments with servo and DC motors using PWM output capabilities. Any progress/recomendarion on this?
I really cannot understand that difference between hardware and software PWM. I have been working with this on Arduino and I would like to make some experiments on Daisy Seed.
I’m also looking to control a DC motor speed using a potentiometer controlled PWM but just wanted to clarify I was implementing the digital PWM correctly. In short, the code should look something along the lines of this?
This should drive PWM corresponding to the potentiometer ADC value (between 0-1) at a frequency of 40kHz? However, in my implementation, it does not control motor speed at all, more of an on/off