Hi,
I am using MPLABX and XC8, with PIC18F14K22.
I am trying to use the __delay_ms () function to set a delay time. It does delay, but not for the expected time.
Below is the code im using, I would expect that whatever number I insert into the delay function would delay for that many milliseconds. Instead, if I enter 125, it actually delays for about 500 milliseconds. If I enter 185, it delays for about 750 milliseconds.
Could you explain what I doing wrong please.
Thanks.
Delay function timing not matching.
I am using MPLABX and XC8, with PIC18F14K22.
I am trying to use the __delay_ms () function to set a delay time. It does delay, but not for the expected time.
Below is the code im using, I would expect that whatever number I insert into the delay function would delay for that many milliseconds. Instead, if I enter 125, it actually delays for about 500 milliseconds. If I enter 185, it delays for about 750 milliseconds.
Could you explain what I doing wrong please.
Thanks.
Code (Text):
- //...