MCP39F511 Power Monitoring IC

I am trying to read the RMS current and voltages values from a MCP39F511 IC by using Arduino, and I just found a code for that from Microchip forums but it seems it's not working, I was wondering if there is anyone who is also working with MCP39511 IC and has a way to read those RMS Values from MCP39F511!

The Arduino code I tried to use is attached.

MCP39511.ino (14.9 KB)