You are here

Simple Delay Function | Cypress Semiconductor

Simple Delay Function

Summary: 1 Reply, Latest post by graa on 03 Mar 2011 02:10 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
cwinning2011's picture
2 posts

Can anyone explain explain to me how to set up a simple delay function? Is there a #include delay.h that goes up top?

I have the delay.h header file in my source code.

Is this the correct way to write the delay function?

if((PRT0DR & 0x02) == 0x02)


  PRT1DR = 0x01;


  PRT1DR = ~0x01;


Any help would be greatly appreciated.

Thank you

graa's picture
Cypress Employee
223 posts

Yes.  You need to include the delay.asm and delay.h files found in the below KB article.


This KB has a zip file that has delay.asm and delay.h files.  Include them in your project.  And include the .h file using the "#include delay.h" line of code.


Best Regards,


Log in to post new comments.