I am working on a project that requires phase locking (digitally) of an output signal from a sensor to the reference signal which needs to be done on STM32 microcontroller. I am new to this area, and just read some basic theory behind phase locked loop and direct digital synthesizer, however, I am lost to even get started.
I want to break down my task into generating sinewaves for DDS and then design a PLL in the microcontroller.
To get started, I thought of generating a sine wave based on a Look up table, that i can either import generated from other program/ create a function to generate directly in the stm32cubeIDE. However, this doesn't work because we have a waveform of a fixed frequency. For a PLL, we should be able to change the output frequency and we could do it either changing size of lookup table, value of prescaler or ARR. But for a PLL, how do we do this without having to change the values manually?
If anyone has idea in this topic, could you please guide me to get started and provide me some more insights to this topic ?