Go to Post Smokey the Fisher Price motor says only YOU can prevent rule infractions. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 24-02-2011, 08:35
dmitch's Avatar
dmitch dmitch is offline
Chief Head Electrical Guy
AKA: Daniel Mitchell
FRC #1997 (Stag Robotics)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Bishop Miege High School
Posts: 142
dmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the roughdmitch is a jewel in the rough
Cypress I/O Module

Our teams robot design is rather complicated this year so our coach wants me to simplify as much as possible. I was thinking about using the Cypress I/O Module to incorporate some push switches for various functions on our robot. I will be using switches that act as light switches (on/off) and possibly some pushbutton switches. I was also thinking about incorporating analog inputs.
A. How do I connect these to the board.
B. How do I program them in c++.
C. How do I program them in the Cypress Coding application.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 24-02-2011, 12:12
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: Cypress I/O Module

Hello, alright, well first of all, save this image as a reference:

http://www.chiefdelphi.com/forums/at...2&d=1264090529

You need it to know what and where the inputs are on the Cypress. Next, make sure your cypress is plugged in, and download their firmware update (I believe from their website), and apply the latest firmware update to your Cypress through the Cypress PSoC Programmer. That is the last of their software that you will be needing. Next, lets take your limit switch as an example, you need to wire it to the cypress. There should be two outputs on your switch, a.k.a something along the lines of two screws, etc. Switches are digital inputs, they require absolutely no power, therefore the VDDIO on the cypress is useless to you for that purpose. Wire on output from the switch to a GND port on the cypress, and wire the other screw from the switch to port P4_4 (Digital Input 1) on the Cypress. Finally, in C++, you do the following anywhere you want your switch to be used:


Code:
DriverStation *ds = DriverStation::GetInstance();
int limitswitch = ds->GetDigitalInput(1);
To check whether the switch is on (1) or off (0), open up your driver station, go the IO tab and look at the digital inputs. If the button is green for Digital In 1, then your code will make limitswitch = 1, and if it is dull, it will make the variable 0. You can use this to make your robot switch functionalities. Good luck!
Reply With Quote
  #3   Spotlight this post!  
Unread 24-02-2011, 14:06
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Cypress I/O Module

Quote:
Originally Posted by PranavSathy View Post
...Next, make sure your cypress is plugged in, and download their firmware update (I believe from their website), and apply the latest firmware update to your Cypress through the Cypress PSoC Programmer...
It was my understanding that updating the PSoC will make the Driver Station software fail to recognize it. The specific firmware supplied by FIRST is what you need to use. I haven't actually verified this, because I have no desire to break what is now working.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-02-2011, 15:02
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Cypress I/O Module

I have been told to get the FIRST update that has the correct firmware too. But I was never able to locate the correct update that contains that firmware. Would somebody post a link to the update please? Thanks.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 24-02-2011, 15:14
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,754
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Cypress I/O Module

The FRC specific Cypress firmware gets installed with the Driver Station Update,
then you'll find it on your computer:

C:\Documents and Settings\All Users\Documents\FRC\FRC_IO.v2.hex
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi