unsigned integer arithmetic work accurately in a MIPS CPU,
you get the remaining 32 bits when integer sum or difference overflow, or underflow.
The difference from signed integer arithmetic, is that unsigned arithmetic do not cause an arithmetic exception when the value roll around.
There is however some pitfalls with updating the Compare register:
If Interrupt service is disabled for too long, or interrupt processing in higher priority interrupts,
take too long, or Flash program memory writing is done,
then the next interrupt time may have passed before the new Compare value is entered.
If that happen, then the next interrupt will not happen until the core timer roll around again.
If several interrupt services with different priority are used,
then design interrupt priorities, such that small and time-critical interrupts have the highest priority.
It is possible to make code to check both Compare register, and Count register, to ensure that the next interrupt time have not passed already.
As far as I know, Harmony version 3 have not been released. There is pre-release code available for download.
They are working on Harmony code for SAM / ATSAM devices, and/or PIC32CX devices that have ARM/Cortex cpu core.
post edited by Mysil - 2019/03/23 00:03:13