Urahara
Member
Hi
I hv a 4MHz crystal on my board. Would like to do a 0.1sec delay using the Delay10KTCYx function found in delay.h of C18. My calculation as follows :
Instruction Cycle = 4,000,000/4 = 1,000,000 per sec
No of 10KTCY needed for 1 sec = 1,000,000/10,000 = 100
Therefore No of 10KTCY for 0.1 sec = 10
I hence pass the value of 10 when I call this function.
But it seems to be slower than the actual timing.
Did I do wrong somewhere? Comments welcome. Thks!
I hv a 4MHz crystal on my board. Would like to do a 0.1sec delay using the Delay10KTCYx function found in delay.h of C18. My calculation as follows :
Instruction Cycle = 4,000,000/4 = 1,000,000 per sec
No of 10KTCY needed for 1 sec = 1,000,000/10,000 = 100
Therefore No of 10KTCY for 0.1 sec = 10
I hence pass the value of 10 when I call this function.
But it seems to be slower than the actual timing.
Did I do wrong somewhere? Comments welcome. Thks!