Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3
Moderator:
RKRM

Post Reply
Follow this topic



Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

sjac14 posted on 09 Apr 2011 10:38 AM PST
Member
6 Forum Posts

I want to use the Delay10msTimes function from the article here http://www.cypress.com/?id=4&rID=47960 .

I unzipped the delay.asm and delay.h files and included them in my project.  I included the .h file using the "#include <delay.h>" line of code.

The code in the "delay.h" won't compile.  I get the following warnings & errors:
WARNING: DELAY.H:12: unknown #pragma, line ignored
WARNING: DELAY.H:13: unknown #pragma, line ignored
WARNING: DELAY.H:14: unknown #pragma, line ignored
ERROR: DELAY.H:19: syntax error near 'Multiple', expected ')'
ERROR: DELAY.H:20: syntax error near 'TenMstimes', expected ')'

I want to create a 1 second pulse on a pin.  I was going to do this with the following code:

Timer_Reset_1_Write(1);  //Set the PIN High
Delay10msTimes(100);     //Wait 1 second
Timer_Reset_1_Write(0);  //Set the PIN Low
 




Re: Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

lkoziarz posted on 09 Apr 2011 08:14 PM PST
Member
7 Forum Posts
That application note is for PSoC1. The cyutil.h file in a PSoC3 creator project automatically gives you: Delay(msec),DelayUs(microseconds), and DelayCycles(clock cycles). Just call Delay(1000); and you'll be in a software delay for one second.

Re: Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

U2 posted on 10 Apr 2011 11:49 PM PST
Cypress Employee
589 Forum Posts

As mentoined by lkoziarz the Knowledge base article is related to PSoC1. For PSoC3 however the delay functions are generated by PSoC Creator. The functions include:

  • CyDelay(uint32 milliseconds), that generates delay in multiples of milliseconds
  • CyDelayUs(uint16 microseconds), that generates delay in multiples of microseconds
  • void CyDelayCycles(uint32 cycles), Delay by the specified number of cycles using a software delay loop.
  • void CyDelayFreq(uint32 freq) , Sets clock frequency for CyDelay.

The references and explanation for the same can be found in the "System Reference Guide". The same can be accessed from PSoC Creator, Help --> Documentation --> System Reference Guide.

The definitions for these functions in PSoC creator can be found in "CyLib.c".

-U2



Re: Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

lkoziarz posted on 11 Apr 2011 05:15 AM PST
Member
7 Forum Posts

 Thanks for clarifying the subroutine names, I was going from memory.  When you get that version of PSoC Creator for Linux ready, it will be quicker for me to have it handy all the time...  =)



Re: Trouble using the Delay10msTimes function from "Delay.h" in PSoC 3

sjac14 posted on 12 Apr 2011 12:12 PM PST
Member
6 Forum Posts

Thank you for the responses. If I were to implement the same delay in PSoC5 I would then need to look at the System Reference Guide in order to find the appropriate function and header file?

 

 

 

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20