To stop the microcontroller on the Xth pass through a function, winIDEA offers option conditional breakpoints: each time the breakpoint is passed the expression (if present) will be evaluated and if it evaluates to true, it will count as one more pass. When the breakpoint is passed as many times as specified in the pass count, the breakpoint will be hit and the CPU will be stopped.
Open Debug | Breakpoints.
CPU stops each time a conditional breakpoint is passed to evaluate the condition and then resumes the CPU.