Dynamically adjustable voltage driven from timer #549
Phat-Dad-Racing
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Just sharing something that I found useful. TBH, not using a whole lot of this core's functions, but I thought I'd share anyway.
I wanted to generate a controlled PWM signal with adjustable voltage output. I've experimented with a few options, but remembered that the DB has an internal opamp that is also event system-enabled. So, with very minimal code, attached TCA overflow and CMP events to enable/disable on the opamp which seems to respond a bit faster than the DAC. Feed the voltage from the DAC into the opamp configured as voltage follower and it seems to work fine for my needs (relatively low frequencies: 50Hz ~ 1500Hz). The opamp output is only slightly delayed and I think has an acceptable rise time.
As I said, mostly FYI - but if people know smarter ways, I'm all ears.

In this picture, CH1 is tracking the digital pin connected directly to TCA0, CH2 is tracking the opamp output.
Also, I do not understand settling time...
Beta Was this translation helpful? Give feedback.
All reactions