View Full Version : Cypress Tutorial?
peter1626
18-01-2011, 14:23
I have been looking around for a few hours but I cant seem to find any tutorials on how to wire and program the Cypress PSoC to use as a third joystick for the driver station. Specifically, I want to add a potentiometer and a few buttons, is this possible? If so how can it be done?
My last question is how do you program LabView to read this information?
Thanks for any help!
Mark McLeod
18-01-2011, 14:32
Look at the back of the Cypress board and you'll see the pins labeled that you wire your swiches and potentiometers to:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=8352&d=1264090529
Wirewrap, a prototype board, or purchasing a special mount from AndyMark can be used to connect your switches.
There's no programming necessary on the Cypress or Driver Station.
If you look on the Driver Station I/O tab you can see if it's working and even change some of the characteristics of how each contact is handled.
In LabVIEW you check your switch settings using:
Driver Station Get Digital Input
Driver Station Get Analog InputYou'll find them on the block diagram pallete at: WPI Robotics Library -> Driver Station -> Compatibility IO
peter1626
18-01-2011, 19:15
Thanks for all the help!
I have just a few more questions...
Do you need to have the 9v battery, or is the usb power sufficient?
Can you connect a LED as an indicator light to Digital Out?
I remember reading something about programing the PSoC with a FRC_IO_v2.hex, do you have to do this or did I misread something?
Joe Ross
18-01-2011, 19:28
FRC_IO_v2.hex, do you have to do this or did I misread something?
You do have to flash it. See How to Configure your I/O Module (http://usfirst.org/frc/kitofparts)
Mark McLeod
18-01-2011, 22:58
You don't need the 9v battery. The Cypress board will use the battery or the USB power, not both anyway.
DO connect the Cypress board directly to your Classmate, NOT through any USB hub. It does draw a lot of power and last year a lot of teams had it drop out when match time came.
You can connect an LED to Digital out using an appropriate resistor.
Chris Hibner
22-01-2011, 18:16
You do have to flash it. See How to Configure your I/O Module (http://usfirst.org/frc/kitofparts)
Unfortunately when I tried this today, programming failed. It said that FRC_IO_v2.hex was not compatible with our First Touch. I'm searching around here to figure out what I need to do...
Ray Gitchell
22-01-2011, 21:13
Chris,
Make sure you are using a psoc 3. I am pretty sure we ordered one from Cypress, but were delivered a psoc 5. Apparently similar boards, but different processors. Thus, we are looking into the legality and compatibility of using the psoc 5, 'cause we see the psoc 3 is not unavailable. (at least the last time I checked)
Please post if you find out different, as we are getting a similar error when we try to download the latest code from FIRST for psoc 3.
Thanks, RayG
Chris Hibner
22-01-2011, 21:40
Chris,
Make sure you are using a psoc 3. I am pretty sure we ordered one from Cypress, but were delivered a psoc 5. Apparently similar boards, but different processors. Thus, we are looking into the legality and compatibility of using the psoc 5, 'cause we see the psoc 3 is not unavailable. (at least the last time I checked)
Please post if you find out different, as we are getting a similar error when we try to download the latest code from FIRST for psoc 3.
Thanks, RayG
The board we're using is the one that came in the kit from 2 years ago. Us being a veteran team, we have to reuse an old one. We haven't used any special inputs at the driver's station since FIRST switched to the NI system, so this thing has been packed away and I haven't really given it a second thought. But anyway, it is the one we got in the 2009 kit - it was just packed away and we dug it out a couple days ago.
I got the error just as we were being kicked out of the school, so I didn't have time to write it down, but it was something along the lines of this (heavily paraphrased):
"Programming failed: the XXXX.xxx was created for (something I can't remember) v32, and the (something I can't remember) you are trying to program is v31."
It seems like our board is so old that the new firmware isn't suited for it. Of course, I could be wrong. As I said, we were getting the boot as this was happening and all of that stuff is still at the school so I can't do any real testing. I'm thinking that if I recompile the open-source code with the software that I installed from the CD we had, it will solve the problem. I was hoping that someone else saw this problem and had a solution so I didn't have to spend a lot of time (which I don't really have right now) tracking this down.
Ray Gitchell
22-01-2011, 23:43
No, sorry, not the same issue, although our solutions may be similar (rebuild with appropriate toolset).
Perhaps you can install the old CD on a separate computer and load the previous year's .hex file to the board.
I am afraid we may have to port the code to a variant processor, as the psoc5 uses a different compiler and probably different header files. We don't want to tear up previous driver stations, as we use them for promotions and recruiting. ;-(
Thanks for the response, RayG
rwood359
23-01-2011, 04:30
Look at the back of the Cypress board and you'll see the pins labeled that you wire your swiches and potentiometers to:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=8352&d=1264090529
This covers the compatibility mode I/O. Where are the extra connections for the Enhanced mode?
I am interested in the Button Inputs.
Mark McLeod
23-01-2011, 13:05
Hi Randy,
Enhanced Mode is set via the Driver Station (I/O tab -> Enhanced).
Tell it you want to use enhanced mode and what you want each pin to be.
I've attached an example that sets up 16 button inputs and shows the pin assignment corresponding to the markings on the back of the Cypress board.
rwood359
23-01-2011, 18:00
Hi Randy,
Enhanced Mode is set via the Driver Station (I/O tab -> Enhanced).
Tell it you want to use enhanced mode and what you want each pin to be.
I've attached an example that sets up 16 button inputs and shows the pin assignment corresponding to the markings on the back of the Cypress board.
Hi Mark,
I found information on the 16 DIOs. After you select the Enhanced mode, the Operator's display has the 16 DIOs plus 8(?from memory) Buttons and 8 LEDs. I think that LEDS are the tiny LEDs on the Cypress board. What I am looking for is: What are the Buttons, how do they work and how do I connect to them, if they are additional inputs?
Thanks
Mark McLeod
23-01-2011, 21:48
That information is in the Cypress Board Pinout (http://team358.org//files/programming/ControlSystem2009-/Cypress%20IO%20Pinout%20tables.pdf) but I don't see Button 1 called out.
In the attached, I believe the Buttons are the 5-element Slider on the board itself, and the LEDs are shown.
There's also a simple new product from e-stop called a CCI. It looks like a joystick to your software but gives you 12 digital inputs and 4 analog inputs. Simpler to use than a Cypress though not as flexible. http://www.estoprobotics.com/estore/index.php?_a=viewProd&productId=33
No, sorry, not the same issue, although our solutions may be similar (rebuild with appropriate toolset).
Perhaps you can install the old CD on a separate computer and load the previous year's .hex file to the board.
I am afraid we may have to port the code to a variant processor, as the psoc5 uses a different compiler and probably different header files. We don't want to tear up previous driver stations, as we use them for promotions and recruiting. ;-(
Thanks for the response, RayG
As long as you are using the board that shipped in the kit a year ago, then the firmware should work for you. It has not been recompiled since then (no bugs reported since beta last year). If you can provide the exact error, I may be able to help you figure our what's going wrong. If I had to guess based on what you've told us so far, it would be that you downloaded a newer version of the programmer than the board supports, though I've never actually seen a complaint like that from the programmer software.
-Joe
rwood359
24-01-2011, 06:13
That information is in the Cypress Board Pinout (http://team358.org//files/programming/ControlSystem2009-/Cypress%20IO%20Pinout%20tables.pdf) but I don't see Button 1 called out.
In the attached, I believe the Buttons are the 5-element Slider on the board itself, and the LEDs are shown.
Thanks, I was hoping for more I/O. Maybe Dale's device will help.
There's also a simple new product from e-stop called a CCI. It looks like a joystick to your software but gives you 12 digital inputs and 4 analog inputs. Simpler to use than a Cypress though not as flexible. http://www.estoprobotics.com/estore/index.php?_a=viewProd&productId=33
Looks good. Thanks for the information. I wish that the site had shipping cost information. That's always an issue for Hawaii teams. Five dollars for an item and $40 shipping.
Thanks, I was hoping for more I/O. Maybe Dale's device will help.
I'm very curious what you're doing that you need more I/O than the Cypress gives you. Perhaps I can help you figure out how to use more of the I/O on the Cypress board to accomplish what you need.
-Joe
eStop Robotics
24-01-2011, 15:34
Greetings from eStop Robotics!
Many thanks to Dale for suggesting our new product the CCI (Custom Controls Interface)!!!
As far as shipping costs go, we ship USPS flat rate boxes. Shipping to HI or any other State is about $5 for the smallest box, 10$ for the next size up. We're in PA, USPS will get it to HI in 4 days.
The CCI has 12 digital inputs and 4 analog inputs. No special SW or drivers to install. It works with your Driver Station PC out of the box. Your cRio programming is also no different than using a joystick, the same functions are used for the CCI as a regular joystick.
http://www.estoprobotics.com/estore/index.php?_a=viewProd&productId=33
Good Luck to all the teams!!!
And to add to that, I entered our order from E-Stop yesterday (Sunday) and it was packaged that night going out in Monday's mail!
rwood359
24-01-2011, 17:22
I'm very curious what you're doing that you need more I/O than the Cypress gives you. Perhaps I can help you figure out how to use more of the I/O on the Cypress board to accomplish what you need.
-Joe
We have quite a few autonomous and operational modes. We are looking at driving a LED for each mode. Once the Control team and Drive team agree on what we want we'll have a real requirement. At this point, I think that we might exceed the basic 16 DIO. If we have a real requirement for more, I'll take you up on for offer. As of know we'll wait and see what the kids come up with.
rwood359
24-01-2011, 17:26
Greetings from eStop Robotics!
As far as shipping costs go, we ship USPS flat rate boxes. Shipping to HI or any other State is about $5 for the smallest box, 10$ for the next size up. We're in PA, USPS will get it to HI in 4 days.
http://www.estoprobotics.com/estore/index.php?_a=viewProd&productId=33
Good Luck to all the teams!!!
Thanks for the information. I love people who use USPS. So many sites only will use 2nd day air to ship to us.
I'm going to order one just to have in my personal tool box.
Joe Ross
24-01-2011, 19:09
We have quite a few autonomous and operational modes. We are looking at driving a LED for each mode. Once the Control team and Drive team agree on what we want we'll have a real requirement. At this point, I think that we might exceed the basic 16 DIO. If we have a real requirement for more, I'll take you up on for offer. As of know we'll wait and see what the kids come up with.
We store our autonomous modes as an enum, and display that on the dashboard and/or the user messages on the driver station. I think we're limited to 255 that way.
Chris Hibner
25-01-2011, 15:28
I tried reprogramming the device again last night. Here is the error I'm getting:
"The hex file was built for silicon revision ES2, but the acquired device is revision ES1. Use PSoC Creator to generate a hex file for the proper device."
I downloaded the source code, but I having yet to get it to compile - many errors, lack of time.
The IO module configuration document mentions a FRC_IO_v1.hex, but that did not come on our Classmate Image. FIRST Forge only has v2 for download. Does anyone have v1 available?
I tried reprogramming the device again last night. Here is the error I'm getting:
"The hex file was built for silicon revision ES2, but the acquired device is revision ES1. Use PSoC Creator to generate a hex file for the proper device."
I downloaded the source code, but I having yet to get it to compile - many errors, lack of time.
The IO module configuration document mentions a FRC_IO_v1.hex, but that did not come on our Classmate Image. FIRST Forge only has v2 for download. Does anyone have v1 available?
v1 was also for the ES2 silicon. I suggest you contact Cypress to get your board replaced. I'm not sure if they ever (meant to have) shipped ES1 processors.
-Joe
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.