swapan
Full Member level 4
Hi guys,
While trying to make a stabiliser using PIC (circuit diagram collected from this forum) I could not got any way how to take ADC result from a half-wave rectified and pulsating DC source. The circuit diagram is as follows. Mean while, I have thought a way like this. I take sample at certain interval. compare it with previously taken one. If present sample is higher than previous, then save the present, otherwise previous will prevail. Thus taking sample for a considerable period, say more than 10ms, there will be one peak value of the pulsati
View attachment steblizer adc.pdf
While trying to make a stabiliser using PIC (circuit diagram collected from this forum) I could not got any way how to take ADC result from a half-wave rectified and pulsating DC source. The circuit diagram is as follows. Mean while, I have thought a way like this. I take sample at certain interval. compare it with previously taken one. If present sample is higher than previous, then save the present, otherwise previous will prevail. Thus taking sample for a considerable period, say more than 10ms, there will be one peak value of the pulsati
Code:
void Get_value () {
unsigned int adv, cnt;
ADS = ADC_Read(0);
for (cnt = 0; cnt < 200; cnt++)
{
Delay_us(100);
adv = ADC_Read(0);
if (adv > ADS)
ADS = adv;
else
ADS = ADS;
}
}
View attachment steblizer adc.pdf