how to calculate the RMS value of an AC signal (220v,50c/s) using micro-controller. i m using stm32f3 controller and its A/D convertor has 72MHZ clock frequency.
You can digitize samples of the waveform at a high frequency, square them, then feed that into a low-pass filter. Take the square root of the output of the LPF.
The cutoff frequency (and order) of the low pass filter is a trade-off between output ripple and response time (for example, after the input waveform changes). A simple IIR low pass filter might be sufficient.
Since you know the mains frequency there are faster-responding filters such as the boxcar filter Andy suggests, assuming you have enough RAM to support that approach and arrange things to have an integer number of samples in a power line cycle.
Take a bunch of consecutive samples (say 100). Square each one numerically. Add them all together to produce an accumulated value. Divide by the number of samples and finally take the square root.
That's the basic method. If you want a rolling RMS value then for each new sample remove the oldest (squared) from the accumulated value and add the new one squared to the accumulated value.
RMS is basically the same as calculating standard deviation: -
Except you don't need to know \$\bar x\$ (mean value) because in RMS it's assumed to be zero.
If the signal is a sine wave, for best precision you should adjust the sampling frequency to the input signal, to have a constant number of samples per period, for example by detecting zero crossings.
I did this many years ago for a power analysis equipment (which calculates harmonics, distortion, phases...).