PIC analogue output
Posted: Thu Jan 29, 2009 10:17 am
Can’t find a Microchip Application Note on how to do an accurate analogue output. I postulate that using a PWM output smoothed with a capacitor gives an approximate output. If I want it accurate I can read the capacitor voltage with an analogue input, then fine tune the PWM to achieve the exact voltage needed. Successive approximation is the technical term for this I think.
Doing this slowly may not be too difficult. My response required time is about 0.1 secs. But doing it faster whilst avoid oscillation /instability, especially when the PIC has to fit in other tasks along the way, would be a challenge.
Anyone got a standard Flowcode routine to do this?
Beats me why no/few PICs have analogue outputs. If the answer is because the above is easy to do why do Microchip not make it more public how to do it.
Doing this slowly may not be too difficult. My response required time is about 0.1 secs. But doing it faster whilst avoid oscillation /instability, especially when the PIC has to fit in other tasks along the way, would be a challenge.
Anyone got a standard Flowcode routine to do this?
Beats me why no/few PICs have analogue outputs. If the answer is because the above is easy to do why do Microchip not make it more public how to do it.