With the help of ADC i am able sense ac currents.
1. I want calculate max of the current value sensed.
2. Need to stop the program if current exceeds some value instantly.
Please help me in this regard.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
With the help of ADC i am able sense ac currents.
1. I want calculate max of the current value sensed.
2. Need to stop the program if current exceeds some value instantly.
Please help me in this regard.
Hi,
1. I would recommend that you trigger a CPU interrupt with the EOC (end of conversion) signal from the ADC. In that interrupt, update a global variable with the value from the ADC result register only if new ADC result is higher than the old value of the global variable. This way, the global variable will always be the highest value obtained from the ADC.
2. Is there something specific that you want to stop when the current exceeds a certain value? You could reset the device or shutdown a certain peripheral on the device. The method for how to do that would vary depending on what you want to achieve.
Best Regards,
Ben Collier