Time in uS to Execute

Thread Starter


Joined Nov 22, 2011
mikroC question:

Does anyone have any idea as to how long: i = UART1_Read(); -- takes to execute on a 20MHz / 5MIPS PIC MCU?


Joined Feb 20, 2011
Are you using MPLAB? If you are, I'd suggest you use MPLAB SIM and the stopwatch feature. Put a breakpoint right before the command and right after it. Run to the first BP, reset the stopwatch, run until it reaches the next BP, and read the stopwatch. It should tell you how many instruction cycles it used and how long it took. Make sure your debugger settings are set to the right values, though (i.e. frequency, etc).


Joined Jun 6, 2011
Further, from where do you get the expectation that each call to UART1_Read() will consume a consistent number of instruction cycles?