Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Delay time accuracy of CyDelay()/CyDelayUs() with PSoC3 device
Question: Why there are so much error in using CyDelay() to generate fixed time delay?
The CyDelay functions - CyDelay(), CyDelayUs() implement simple software-based delay loops. The loops are designed to compensate for bus clock frequency and some other factors, but there are additional factors that may also influence the actual time spent in the loop. The delay time of each function can be calculated by counting up the assembly instruction implemention time.
In case of a more accurate delay time demanded, hardware(PWM, Timer) mode should be considered.