Hi MARS
I am not sure that I am understanding your issue correctly. From what I can gather, I assume that you need a rounded value for PF which just says 0,1 or 0.5 based on whichever is closer and not accurately state the result, say 0.866 for example. Am I right? If not, kindly elaborate with examples. Because if this is the issue, then this is something that has to be done on the MCU after the PF is calculated based on the above formula.
Also, I would say that the LSB count of 40 for the energy result is very small. I think the current level is very low. Try to increase the LINCYC value to get more LSBs and hence more accurate results.
Regards
hmani