Time in uS to Execute

Thread Starter

T.Jackson

Joined Nov 22, 2011
328
mikroC question:

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

DerStrom8

Joined Feb 20, 2011
2,390
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).
 

joeyd999

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