Total Noob Needs Help

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

cross mob
Anonymous
Not applicable

Hello. I'm a total noob when it comes to programming the PSoC. I am a junior in high school and a member of the schools Robotics Club. I was charged with the task of working with the PSoC. I came up with a really great idea, but I need to learn the basics first. So, can anyone help me?

0 Likes
11 Replies
TeHe_281121
Level 3
Level 3

May I suggest the following:

   

1. Work through the online training. For PSoC3 look here www.cypress.com/

   

2. Read the TRM (Technical Reference Manual), as this is where the meat lies. www.cypress.com/

   

3. Read and work through Application Notes. If someone has done it before, learn from them. www.cypress.com/

   

4. Newsgroups. Always search the newsgroups like this one, before asking a question, as it was probabally asked and answered before.

   

5. A few other resources worth mentioning,

   

PSoC Developer forums www.psocdeveloper.com/forums/index.php
Planet PSoC www.planetpsoc.com/
 

0 Likes
Anonymous
Not applicable

By the way, I forgot to mention that I need to know how to use the pins on the PSoC. If I don't know how to use the pins, then my idea is screwed(forgive the language).

0 Likes
Anonymous
Not applicable

Hello Luffy. 

   

I am a mentor on FRC team 1983.   If the previous post did not get you going you may contact me directly at

   

therepairshop@hotmail.com  with your specific questions.   I am not a programming expert but have worked quite a bit with the PSOC kit board used by the FRC teams. 

   

PSOC Creator is easy to learn and just fooling around with it and the sample programs should get you going.  One thing that I woulsd suggest is to not let Creator update itself while you are working with the FRC project.  Doing so will cause communication problems with the driver station.  You will have to reinstall the package again.   Hopefully that will be fixed this year. 

   

Good Luck

   

Jim

   

Team 1983

0 Likes
Anonymous
Not applicable

 I learned about the updating thing earlier. The projects wouldn't be generated correctly. BTW, if you know how to use the pushbutton that's built into the PSoC in the First Touch Starter Kit. If you can give me some sample code for that, it would be very appreciated. Thank you.

0 Likes
Anonymous
Not applicable

BTW, I didn't notice this earlier, but Luffy and Tsukiyo are the me. Same person. so if there is any confusion, sorry.

0 Likes
Anonymous
Not applicable

Do you prefer Luffy or Tsukiyo ?

   

The button on the PSOC3 starter kit board is connected to P15[3].   You can see this connection in the First Touch Starter kit guide section 5.1.  There is a full schematic of the board that is very useful. 

   

Create a new project.

   

From the component catalog / Ports and Pins section place a digital input pin in the design window. Open the pins configuration box by double clicking on the pin.

   

Name the pin Button

   

On the "TYPE" tab set the pin as a digital input with hardware connection box checked.

   

On the "General" tab select drive mode "Resistive pull down"

   

Place two more pins in the design window.

   

Name them LED1 and LED2

   

Set the type to digital output and the drive mode to Strong drive for both pins.

   

From the Logic section place a not gate in the design window.

   

Now use the wire tool to connect the button to LED1

   

then connect the button to the input side (large end) of the not gate and from the output of the not gate to LED2.

   

Switch the view in Creator to display the design.cydwr window.  On the "Pins" tab.

   

Goto the pins assignment window set the button on P15[3],   set LED1 on P2[0],  and LED2 onP2[1].

   

Now build the design from the "Build" menu and program the board from the "Debug" menu.

   

Disconnect and them reconnect the USB cable and press the button.

   

Good Luck

   

Jim

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

The above example will turn on LED1 or LED2 depending on the switch state.  It is all done in hardware and no programming is required.

   

To use the button in software code add another pin to the above diagram.

   

Name it LED3 and make its a digital output pin, Do not check the hardware connection box this time.

   

Set the drive mode to Strong drive.  Configure it to use P2[2] 

   

Edit you main.c file as in attatched.

   

Now when you run the project the 3rd Led will be controlled by the button using the software API.

   

Jim

0 Likes
Anonymous
Not applicable

 Thank you for the info. I just needed to know how to use the pushbutton in my code because I was going to use it to tell the program to finish.

0 Likes
Anonymous
Not applicable

I hope I expained it well.  It is difficult to judge how much detail someone may need.  Keep playing with the starter kit.  I thinks its one of the best learing tools I've seen.  I realy hope they keep it in this years kit of parts. 

   

What team are you on ?

   

Jim

   

First Mentor

   

Skunkworks  Team 1983

   

DesMoines WA

0 Likes
Anonymous
Not applicable

Team Paradise 1165

   

Paradise Valley High School

   

Phoenix, AZ

0 Likes
Anonymous
Not applicable

BTW, I don't have a "Pins and Ports" tab on my component selector screen. What do I do?

0 Likes