Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4924

Delay function timing not matching.

$
0
0
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.

Code (Text):
  1. //...
Delay function timing not matching.

Viewing all articles
Browse latest Browse all 4924

Trending Articles