Hallo everyone!
I'm facing big problem with my buck-boost converter and I hope You can help me

Main requirement: Vin 20-400 V (sic!), fixed output voltage -80 V (becouse of topology it's opposite to the ground), Pout = 25 W.
It's works, but I have problems with feedback loop. Let me shortly describe the circuit and the problem:
It's typpical buck-boost topology. The PWM 61,5 kHz is generated by Atmega32 (I've got evaluation board, in final model I'm going to use smaller one) and ampliefed by typpical mosfet driver. 0,47R+33n is a snubber. What is a big problem in Buck-Boost converters is inevitability to connect PWM's generator ground to transistor's source, so 2 "grounds" are in the circuit. In my model I use external extra socket-supply (not sure if it's proper name in English, it's kind of cell phone charger) to supply Atmega and Mosfet Driver.
Problem: At the moment I use a potentiometer at evaluation board to set PWM duty cycle to keep output voltage = -80 V for various input voltage. I want to apply some feedback, sense resisotrs (see 2 resistors, i.e. 800k + 39k at output) to automaticly sense Vout and set duty cycle, but: Atmega's ground is different than supply voltage. So my -5 V on sense output resistor is measured with respect to "big" ground. With respect to "small ground" (Atmega's ground) is around |Vin|+|Vout|, so 100 ... 480 V ! What is more it changes with respect to PWM cycle.
Now is the question: what is the method to apply feedback and sense resistors to such type of converter?
