Anonymous
Not applicable
Jul 06, 2014
11:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 06, 2014
11:14 PM
I want to control 4 computer fans using touch slider
How can i connect the pwm to touch slider ?
3 Replies
Jul 07, 2014
01:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2014
01:48 AM
Duty cycle of a pwm is controlled by the compare value. Duty cycle = (Period + 1)/(Compare + 1) * 100%
So you just read the slider position and set the compare value accordingly.
Bob
Jul 07, 2014
05:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2014
05:37 AM
Using A/D, that tells you slider position, essentially.
Then using a loop, or DMA, you feed that value to compare register of PWM.
When PWM finishes its current cycle it will update the comparison
used to new value. In case of PWM immeadiate update occurs.
Regards, Dana.
Jul 07, 2014
10:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 07, 2014
10:28 AM
@dana: no need to use the ADC for the touch slider, there is a nice API for that 🙂