I have previously shown how to calculate the values for the sine table: http://www.blogspot.com/2016/01/generation-and-implementation-of-sine.html I have also shown how to implement SPWM in PIC16: http://www.blogspot.com/2016/10/generation-of-sine-wave-using-spwm-in_10.html Now I will show how to implement feedback for SPWM. Due to various limitations in PIC16, such as ADC speed, instruction time and the ALU, it is extremely difficult, if not impossible, to calculate in real time the values required for feedback in sinusoidal pulse width modulation (SPWM). Thus, to implement feedback, a different approach must be used. That approach would be to retrieve the values from a sine table that contains the duty cycle values for a specific duty cycle. Here is one sine table I used, for example: const unsigned char sin_table[416]={ 0, 16, 32, 47, 62, 77, 91, 103, 115, 126, 136, 144, 151, 156, 160, 162, 163, 162, 160, 156, 151, 144, 136, 126, 115, 103, 91, 77, 62, 47, 32, 16, //65% 0, 17, 33, 49...