problem in selecting the API's for a project

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I am new to psoc creator software. I have gone through the training from the website. I got some help from that training but still getting trouble in writing the framework. I am not able to write the proper api fuction or how to select the function for my project. How do i get the list of api's or the c functions?

   

For example if i want to check the status of a pin which fuction should i use?

   

Thanks.  

0 Likes
14 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you right click on component there is typically a datasheet with

   

an API section in it describing each API and its call, parameters, etc.

   

 

   

Also  there are a # of ap notes associated with the part, and a video

   

training library on web site.

   

 

   

    

   

         

   

http://www.cypress.com/?rID=93401     AN86439 - PSoC® 4 - Using GPIO Pins

   

http://www.cypress.com/?rID=57571     AN72382 - Using PSoC® 3 and PSoC 5LP GPIO Pins

   

 

   

    

   

 

   

         

   

http://www.cypress.com/?rID=38267     AN54460 - PSoC® 3, PSoC 4, and PSoC 5LP Interrupts

   

 

   

 

   

    

   

         

   

http://www.cypress.com/?id=1162&source=home_support     Video Training

   

http://www.cypress.com/psoccreator/     Creator

   

 

   

    

   

 

   

         

   

 http://www.cypress.com/?rID=60890     AN77759 - Getting Started with PSoC® 5LP

   

http://www.cypress.com/?rID=43337     AN61290 - PSoC® 3 and PSoC 5LP Hardware Design Considerations

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 hi.. i am just trying to do a simple project like when i press a switch then led should be turned on.

   

Here i am facing problem.. i want to check the status of the pin where i have assigned the switch, but i am not able to read the status. What should be done?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When you look at the warning in your program you'll see that your "if" has no body to execute because you ended it with a semi-colon. I would further suggest you to implement an else branch to switch off the LED.

   

A tip: alter every program so that there are no errors nor warnings. What kind of development kit have you got?

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This might help -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=57571     AN72382 - Using PSoC® 3 and PSoC 5LP GPIO Pins

   

 

   

 

   

Also look at system reference guide, under Creator help menu., for APIs to control

   

GPIO.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 i'm having psoc 5lp kit. Is my code which i have written is correct ? i have made the changes which u have pointed out.. still it is not working... where i have made mistake i couldnt find it.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Did you check the external connections?

   

And: The switch in your kit connects to GND afaik, so select for the input pin's mode "Resistive pull up" initial drive state "High"

   

I cannot see whether your program is correct, please upload the actual version.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 uploaded the project..

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Are you sure?

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 uploaded the project..

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You did not follow my "else"-advice.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 Thanks Bob... i have done it finally.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 yes i have done with "else" statement. if working.. but with one problem. the logic in the code is opposite.. like for 0 it showing logic 1 and for logic 1 it showing logic 0.. 

   

i have done one more project just now.. it is like if you sw1 led starts to blink and when u press sw2 led stops blinking.

   

but the switch state and the "if" statement is not matching.. logic is opposite. how o rectify it?

   

i am uploading my second project.. just have a look.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When working with the PSoC5 Kit and using some of the internals as a switch it is always advisable to have a look into the schematics (have already been installed on your system). There you will see that your switch connects to GND (0V) when pressed, so you would read a logical zero in this case. When the switch is released you will read a Hi because we defined a pullup resistor for that pin. This is nothing you could change, since that is soldered in the hardware.

   

So, when you swap the lines in the if and else branches all would be good. You even might avoid the if by writing

   

 

   

LED_Write(!SW_INP_Read()); // Write negated value of switch to LED

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 thank u Bob.. i will use this in my next project.

0 Likes