Go to Post Quality has nothing to do with desire – you can’t wish quality. Quality has nothing to do with time, or money, or the other guy’s attitude. Quality has everything to do with craftsmanship. - Jack Jones [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2009, 10:27 PM
Chipawa's Avatar
Chipawa Chipawa is offline
Registered User
AKA: Mr. Tucker, AKA Chip
FRC #1111 (Powerhawks)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Annapolis, MD
Posts: 41
Chipawa is an unknown quantity at this point
Allocation of PWM and GPIO Channels

We have a lot of motors and limit switches on this year's robot. Is there any reason we cannot use (for example) PWM channels 1-8 and GPIO channels 1-8 from the same digital sidecar?

And if so, how do you address those channels in code?

We're programming in C++. I'm not a programmer, but I understand that you have to specify a slot and a channel number for each signal. I'm just not sure how you differentiate between a PWM channel and a GPIO channel. Any help would be appreciated.
__________________

2010 DC Engineering Innovation Award
2010 DC Spirit Award
2008 Chesapeake Finalist
2008 Chesapeake Rockwell Automation Innovation in Controls award
  #2   Spotlight this post!  
Unread 02-09-2009, 10:35 PM
wt200999's Avatar
wt200999 wt200999 is online now
Registered User
AKA: Will
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Dallas, Texas
Posts: 211
wt200999 will become famous soon enoughwt200999 will become famous soon enough
Send a message via MSN to wt200999
Re: Allocation of PWM and GPIO Channels

You can use all of the inputs without having to worry about conflicts. When you specify the slot and channel number (or if you are using the default slots just the channel number) the object you specify it for will tell whether it is a GPIO or a PWM.
__________________
FIRST LEGO League 2005
FRC Team 870 Student 2006 - 2009
FRC Team 870 College Student 2009 - 2013
FRC Team 3005 Mentor 2014

  #3   Spotlight this post!  
Unread 02-10-2009, 01:13 PM
Chipawa's Avatar
Chipawa Chipawa is offline
Registered User
AKA: Mr. Tucker, AKA Chip
FRC #1111 (Powerhawks)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Annapolis, MD
Posts: 41
Chipawa is an unknown quantity at this point
Re: Allocation of PWM and GPIO Channels

Thanks for the reply. Glad there are no conflicts.

Quote:
the object you specify it for will tell whether it is a GPIO or a PWM.
I'm still not sure how you differentiate between a GPIO and a PWM. Is there a separate "GPIO #" and "PWM #"?
__________________

2010 DC Engineering Innovation Award
2010 DC Spirit Award
2008 Chesapeake Finalist
2008 Chesapeake Rockwell Automation Innovation in Controls award
  #4   Spotlight this post!  
Unread 02-10-2009, 02:21 PM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 858
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Allocation of PWM and GPIO Channels

The digital side card has 10 PWM ports for driving victors / jaguars. If you need more PWM ports you can add a second digital side card. If you have some low current motors (CIM or Fisher Price must be connected to a speed control) that run in an on/off fashion you can drive them with a spike according to <R54>.

edit: Also all the Spikes and Speed Controls must be connected to the designated port, you cannot drive them with GPIO.
__________________
Intelitek Support

[BFIRST Team 146 Blue Lightning - Alumni[/b]
FIRST Team 40 Checkmate

Last edited by Kingofl337 : 02-10-2009 at 02:24 PM.
  #5   Spotlight this post!  
Unread 02-10-2009, 02:31 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,596
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Allocation of PWM and GPIO Channels

Quote:
Originally Posted by Chipawa View Post
I'm still not sure how you differentiate between a GPIO and a PWM. Is there a separate "GPIO #" and "PWM #"?
If you open a Jaguar or Victor or Servo object, it will know that you intend to connect it to a PWM output. If you open a Encoder or switch or etc object, it will know that you intend to connect it to GPIO. If you open a relay object, it will know that you intend to connect it to a relay output.
  #6   Spotlight this post!  
Unread 02-10-2009, 02:34 PM
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: 7,798
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
Send a message via AIM to Alan Anderson
Re: Allocation of PWM and GPIO Channels

Quote:
Originally Posted by Chipawa View Post
I'm still not sure how you differentiate between a GPIO and a PWM. Is there a separate "GPIO #" and "PWM #"?
You differentiate between them by choosing Digital I/O classes vs. PWM (Victor, Jaguar, Servo) classes. There are also separate Relay numbers, Analog numbers, and Solenoid numbers.
  #7   Spotlight this post!  
Unread 02-10-2009, 04:25 PM
Chipawa's Avatar
Chipawa Chipawa is offline
Registered User
AKA: Mr. Tucker, AKA Chip
FRC #1111 (Powerhawks)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Annapolis, MD
Posts: 41
Chipawa is an unknown quantity at this point
Re: Allocation of PWM and GPIO Channels

Thanks for the help all. We are trying to cut weight where possible, so we're trying to stick to just one digital sidecar. Looks like we'll be able make it work.
__________________

2010 DC Engineering Innovation Award
2010 DC Spirit Award
2008 Chesapeake Finalist
2008 Chesapeake Rockwell Automation Innovation in Controls award
  #8   Spotlight this post!  
Unread 02-10-2009, 11:36 PM
RoboMaster's Avatar
RoboMaster RoboMaster is offline
Alum, former programmer&co-captain
FRC #2472 (The Centurions)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Minnesota, Twin Cities
Posts: 268
RoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant future
Re: Allocation of PWM and GPIO Channels

Well, you are programming in C, so this might be of little help, but this is what I have noticed in LabVIEW:

You can open up the Set and Get VIs (VIs, or SubVIs, are like functions in C) for the PWM input/output plugs and see what they actually do to make controlling the PWM signals. They actually use the Counter VIs to make/read the signal that is going through the pins to sense the ups and downs, ultimately a PWM signal. Then they handle sending/recieving signals through the port similar to a regular digital input-output port.

I would suggest looking into this on the C side and see if you can look into the functions that allow you to control PWM signals. I'll bet they too use counting processes to read/write a PWM signal from scratch. Then you can make your own code that does the same or copy and paste some of those formulas' code, but instead modify it so that it is controlling a digital input/output port/slot/pins.

I hope this makes sense. Cheers!
__________________
My engineering blog: noeticbrainwaves.blogspot.com

I'm not slacking, my code's compiling
...and I'm using LabVIEW
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashboard Analog Meters and GPIO? Geek_Girl Programming 1 12-17-2008 08:50 AM
Dynamic Memory Allocation Woes slavik262 Programming 7 02-12-2008 03:15 PM
Random Allocation of Trackballs fabalafae Rules/Strategy 7 01-07-2008 08:31 AM
Please help: Memory allocation problem dealing with sections RbtGal1351 Programming 10 03-14-2006 01:58 PM
Split topic - How many channels can the current (2004) Oi's and Rc's Handle? Elgin Clock Control System 6 01-02-2005 01:02 PM


All times are GMT -5. The time now is 05:24 PM.

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


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