Re: Need guidence for programming a DS1821C+
Since it takes 4 clock cycles to complete a single operation, divide the oscillator frequency by 4 to get the number of operations the PIC can perform in a second:
4,000,000/4 = 1,000,000 operations per second.
Take the inverse of the number of operations per second to get the time it takes to perform a single operation:
1/1,000,000 = 0.000001 seconds = 0.001 milliseconds = 1 microsecond.
So yes, four NOPs will delay for 4 microseconds when operating at 4 MHz.
At 20 MHz, each NOP will delay for 200 nanoseconds.
Best Regards,
Paul
The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.
Bookmarks