Help with writing to registers for 1Hz pwm and timer interrupt

This is for a remote place where we have a microgrid powered by PV energy. We use grid tie inverters ac coupled to battery inverter. Battery inverter will regulate PV production through Frequency Shifting Power Control, so when there is excess of PV production it will gradualy increase frequency and PV inverters will start to throttle production once reached 51Hz. So the idea is to activate some heating elements that will act as dump loads to heat water before PV production is throttled and this way maximising PV production