Interfacing with GPIO to Motors,4066, etc

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


Hi Cricketbee!

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 :slight_smile:
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.

In your case how did you call PWM

I should’ve remembered earlier that hardware PWM is still a work in progress: Feature: Hardware PWM by stephenhensley · Pull Request #568 · electro-smith/libDaisy · GitHub
So I think that PR can provide information about you were originally wondering about.

What we have so far is the software PWM with led.h.
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.

yes this is exactly what i was wondering if the HW pwm was being implemented. thanks for the PR to check out!

1 Like

This PR Is huge if it is in a working state !

as 1. it solves me wanting to use more timers on the daisy and

  1. 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.

thanks as always

1 Like

We would be happy to have you experiment/test with it!
Keep us posted for sure :slight_smile:

1 Like