- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use PSoC Designer 5.1
CY8C29466 devide
How to do a dealy in language C ? Could I use some library ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the LCD-Module-library are some delay-functions for PSoC1. When using an LCD-Module you can search for "delay" to get hands on them.
By the way: I recommend you to update to designer 5.2, there are some improvements.
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Keep in mind PSOC 1 internal clock is not highly accurate, so if you
need precise delays, an external Xtal or precision clock is necessary.
http://www.cypress.com/?rID=2773
http://www.cypress.com/?docID=35967
http://www.cypress.com/?docID=34285
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can use this library - http://www.cypress.com/?id=4&rID=47960
You will find two files delay.h and delay.c which you can include in your project.
Afterwwards, just call the function to insert a delay in execution. The functions are CPU speed independant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you don't want high accuracy.
you can use CyDelay() and CyDelayUs() which should be in CyLib.
CyDelay(X) is for Xms, X is unsigned long
CyDelayUs(X) is for Xus, X is unsigned int
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the earlier post -
Yes, you can use this library - http://www.cypress.com/?id=4&rID=47960
You will find two files delay.h and delay.c which you can include in your project.
Afterwwards, just call the function to insert a delay in execution. The functions are CPU speed independant.
These functions are corrected for the clock selected, but not the clock accuracy itself.
Eg they are corrected if you pick a 6, 12, 24 Mhz clock, but not the accuracy of that
clock. Only a xtal derived clock will give you precision delays.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which header file should I include to invoke CyDelay and CyDelayUs functions.
Thanks and Regards
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyDelay() and CyDelayUs() are to be found in the PSoC 3, 4 and 5 world, not in PSoC1. When using a PSoC1 and Designer follow the hints in this thread, when using a PSoC3/4/5 and Creator you do not need to include any extra file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes you are right I'm using PSoc designer. I did include delay.asm and delay.h in my project and its working fine.
However I need 1us delay also, is there any library functions ?
Thanks & Regards,
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will have to use a timer, counter, or one shot module.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
I used NOP instruction inorder to achieve the small delay required and it was also clock independent.
asm("NOP");
Regards,
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NOPs are not clock independent, they rely on the execution speed of the processor which is defineable with the clock speed.
For some more general functions have a look here: www.cypress.com/
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Delay accuracy will be +/- 2.5%, see datasheet -