The mechanism by which the microcontroller is operated by the program is :
"The CPU reads the program written in the memory and works according to the instruction".
Let's take a look at the CPU, instructions, and the data flow.
In this way, If one task is completed, the next instruction is read from the next address in memory.
Then, the microcontroller operates by repeating 1 to 3.