This is jogging my memory a bit now... I thought I had it all working perfectly with atmega164 in the past and I did.
But now I migrated to atxmega32A4 and all the problems came back lol...
Ok with atmega164 I used a PWM and 6 pins with an AND gate to only PWM the 3 high side mosfets. Then I read the bemf using resistor deviders plus a small value capacitor to filter the reading. It all worked perfectly.
Now with atxmega32A4 I am using pattern generation, where ALL 6 pins are PWMed (no AND gate required). I dont seem to have any option for only PWMing the high side pins. I have to do ALL of them. Now I sort of remember from all the readings I did back then, that this is kind of not suitable for reading BEMFs at the PWM pulse? Does anyone have a clearer view on this?