Go to Post P.S. No matter what happens a build season, you will always have memories. - Briansmithtown [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-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 18-01-2007, 13:14
rfolea's Avatar
rfolea rfolea is offline
Registered User
AKA: Rick Folea
no team (Forsyth Alliance)
Team Role: Mentor
 
Join Date: May 2005
Rookie Year: 2005
Location: US
Posts: 210
rfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant future
Simple Digital io

I see in the default code, in the User Initialization function, that digital_io_17 is set up as an unused output.

It is then set to 0.

I added a couple lines to set it to 1 then to 0 then to 1 then to 0:

rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 0;

No other changes have been made to the 2007 default code.
I compiled, and downloaded to the rc.

I connected a Logic analyzer and expected to see the digital line toggle a few times at startup.

Instead it simply takes on the value of the last stament I entered (a '0' in this example).

Doesn't rc_digout_17 directly drive the io pin?

What am I missing here ...
  #2   Spotlight this post!  
Unread 18-01-2007, 13:44
P1d40n3's Avatar
P1d40n3 P1d40n3 is offline
Commander Programmer
AKA: Adam Burch
FRC #0842 (Falcon Robotics)
Team Role: Programmer
 
Join Date: Aug 2006
Rookie Year: 2006
Location: Phoenix, Arizona
Posts: 14
P1d40n3 has a spectacular aura aboutP1d40n3 has a spectacular aura aboutP1d40n3 has a spectacular aura about
Re: Simple Digital io

Quote:
Originally Posted by rfolea View Post
Doesn't rc_digout_17 directly drive the io pin?

What am I missing here ...
Not quite directly. The values for all the PWM's and digital io's are only outputted to their respective pins after the Putdata(&txdata) statement. That's why it's at the end of Process_Data_From_Master_uP.
  #3   Spotlight this post!  
Unread 18-01-2007, 13:45
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Simple Digital io

Those statements are executed almost instantaneously... 100us each, in fact. This is likely too quick for you to notice. If you'd like something you'll be able to see, try putting the statement rc_digout_17 = !rc_digout_17; in your main user control loop, and that pin will toggle every 26.4ms, which is something you'll actually be able to see.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #4   Spotlight this post!  
Unread 18-01-2007, 14:05
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Simple Digital io

Quote:
Originally Posted by P1d40n3
Not quite directly. The values for all the PWM's and digital io's are only outputted to their respective pins after the Putdata(&txdata) statement. That's why it's at the end of Process_Data_From_Master_uP.
Quote:
Originally Posted by MattD View Post
If you switch it more than once before Putdata() is called, it'll only send the last one to the master processor.
Both of these statements are incorrect. The digital I/Os on the RC are directly connected to the hardware pins. In the old PBASIC days, it was true that everything went through the master. This is not the case anymore. You should be able to toggle them as many times as you want and see the change. Are you sure you configured the pin for an output first?

Guys, please take the time to make sure the things you are saying are correct. Spreading misinformation like this is only going to further confuse people who are probably already overwhelmed.
  #5   Spotlight this post!  
Unread 18-01-2007, 14:16
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,599
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Simple Digital io

Ditto Dave's post. The reason you're not seeing it is that it's toggling so fast at the startup. If you don't have your O-Scope set up properly for triggering and compensation, then it's probably just shooting by too fast to see.

For the record, here's a selection of the pins off the user processor:
All Relay pins
All digital IOs
All Serial ports
All analog inputs
PWMs 13-16

Actually I think that's it, but someone can correct me if I'm mistaken.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #6   Spotlight this post!  
Unread 18-01-2007, 14:22
rfolea's Avatar
rfolea rfolea is offline
Registered User
AKA: Rick Folea
no team (Forsyth Alliance)
Team Role: Mentor
 
Join Date: May 2005
Rookie Year: 2005
Location: US
Posts: 210
rfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant future
Re: Simple Digital io

Hi Guys,

The 'putdata' answer seems to be the way the system is behaving, but doesn't seem right because 'putdata' is only executed in User_Initialization and Process_Data_From_Master_uP().

That means anything you do in the fast routine (process data from local IO) will only be updated every 26ms, so what is the point behind having a fast routnine?

It also doesn't seem to follow the documentation (Control System Overview, Figure 1.1) which says:

Master uP
- PWMs 1-12
User Processor
- PWMs 13-16
- Analog
- Digital
- relay

I assumed that meant I had direct access/control over everything but PWMs 13-16 and had to do the 'putdata' to update PWMs 1-12 only.

I still feel like I am missing something simple here ...
  #7   Spotlight this post!  
Unread 18-01-2007, 14:26
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Simple Digital io

My mistake; I apologize for the error and will try to be more careful from now on. I didn't mean to cause any problems.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
  #8   Spotlight this post!  
Unread 18-01-2007, 14:26
rfolea's Avatar
rfolea rfolea is offline
Registered User
AKA: Rick Folea
no team (Forsyth Alliance)
Team Role: Mentor
 
Join Date: May 2005
Rookie Year: 2005
Location: US
Posts: 210
rfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant future
Re: Simple Digital io

In response to the "too fast to be seen replies" we are using a Logic Analyzer with 5 ns of resolution and a 150 MHz O-Scope - I feel very confident that that we're not missing anything ...
  #9   Spotlight this post!  
Unread 18-01-2007, 14:45
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: Simple Digital io

There's filter circuitry on the digital pins. It limits the rate at which the signal voltage can change. You're trying to change it much more rapidly than it will physically respond.
  #10   Spotlight this post!  
Unread 18-01-2007, 15:16
Dave K.'s Avatar
Dave K. Dave K. is offline
Engineer/Mentor
FRC #0930
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: WI
Posts: 91
Dave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to beholdDave K. is a splendid one to behold
Re: Simple Digital io

Quote:
Originally Posted by rfolea View Post
I see in the default code, in the User Initialization function, that digital_io_17 is set up as an unused output.

It is then set to 0.

I added a couple lines to set it to 1 then to 0 then to 1 then to 0:

rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 0;

No other changes have been made to the 2007 default code.
I compiled, and downloaded to the rc.

I connected a Logic analyzer and expected to see the digital line toggle a few times at startup.

Instead it simply takes on the value of the last stament I entered (a '0' in this example).

Doesn't rc_digout_17 directly drive the io pin?

What am I missing here ...

As Dave Flowerday pointed out, the problem is probably due to the RC filtering, but you may also want to double check that the I/O line is actually setup as an output. The default code in the User_Initialization() function does set user I/O 17 as an output, but if your code changed that to an input, it could account for the problem you are seeing.

In a separate discussion on using the I/O lines to build a SPI interface http://www.chiefdelphi.com/forums/sh...ad.php?t=49204, I calculated that when using user I/O lines 7-18, limiting the transition rates to about 140kHz would be appropriate. I/O lines 1-6 are less heavily filtered and could support transition rates up to about 1.45MHz.

Due to how the RC components are configured, the input transition rates would be about 40kHz and 300kHz respectively.

IFI's I/O RC filtering schematic can be found here: http://www.ifirobotics.com/docs/anal...al--i-o-rc.pdf.
__________________
--Dave
  #11   Spotlight this post!  
Unread 18-01-2007, 16:22
rfolea's Avatar
rfolea rfolea is offline
Registered User
AKA: Rick Folea
no team (Forsyth Alliance)
Team Role: Mentor
 
Join Date: May 2005
Rookie Year: 2005
Location: US
Posts: 210
rfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant futurerfolea has a brilliant future
Re: Simple Digital io

Hi Guys,

Everyone that said RC filtering gets the prize (find me at nationals and I'll give it to you ..)

I put the following code in to vary the width of the pulse I was sending out:

rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;

rc_digout_17 = 0;
rc_digout_17 = 1;

rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 1;

rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;

rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;

rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 0;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;
rc_digout_17 = 1;

And guess what - Only the 1st and last pulse came out regularly, and sometimes I would get the next to last pulse.

Also - the 1st pulse was narrower than the last (even though they had the same code) - probably due to being the first one to charge up the RC circitry.

I then added a 4.7K pullup to the IO and can now see all but the narrowest pulse.

The schematic of the io pins predicts this behavior exactly - thanks!

Issue closed.

The world can start spinning on it's axis again ...

- Rick
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
Simple design Mike Norton Robot Showcase 3 16-01-2007 11:58
2 simple questions RDD Rules/Strategy 4 10-01-2007 16:41
Digital Caliper as a Digital Readout on Small Mill sanddrag Technical Discussion 9 13-10-2005 22:51
simple mistakes birdman Rules/Strategy 8 10-04-2005 23:32
Simple website questionnaire jonathan lall Website Design/Showcase 28 30-07-2003 23:42


All times are GMT -5. The time now is 10:43.

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