After many failed trials of using a Potentiometer to adjust PIC output (DAC) and (ADC), I'm thinking to try making a variable RC Oscillator and get the clock change to get some variable PWM output. Is this sounds rational or not ?
That is a complicated way to get variable frequency PWM. Is that what you want? You won't be able to (easily) change the duty cycle of the PWM with a changing oscillator frequency.
When you fail in something that simple should you really change your plans to more complicated one?
Why did you fail? Did you have trouble with coding and programming the PIC?
In fact at the beginning I had no problem with programming, because I was following N.G. tutorial, may be the problem was with my circuit "analog board", it took a lot of my time and effort.
lately I found some direct and simple ways to test analog abilities for PIC using simple voltage reference and LED to show that it deems and bright. It is in this case where I had problem with programming since I don’t know which register I have to deal with.
What in mined is how to use PIC to control a load ( LED or even LCD segments), by adjusting a Potintiometer, to show a kind of inication in response to the POT changing. This a PIC analog issue, isnt it ?
You do realize that changing the frequency of PWM signal does not change the average voltage? It does not make a LED shine brighter or dimmer. You need to change the duty cycle of PWM in order to control load.
But your idea of changing the speed of the RC oscillator with potentiometer is perfectly good if you want to make a LED blink faster and slower.
any way I told you the idea just poped up in my mined and I post it here, but our discussion reminded me about my failure to use PIC in any Analog In or Out applications. I may start a fresh thread seeking advices regarding that.
I don't want to get rid of you. Just answered your original question Your idea is perfectly good and rational if you want to control the frequency of PWM. I'm just not convinced that controlling the frequency of PWM is what you really want to do. You said you wanted to control PWM.. and that is a little bit confusing because there are two things to control; frequency and duty-cycle. You can't control duty-cycle by varying the oscillator frequency.
No problem misterT, I was just joking. Thank you for your help, and as I said I'll start a new thread regarding PIC analog implementations later because I'm doing a couple of projects for now, and I'll PM you to participate.