Backup of code which uses 8-bit phase counter