Go to Post It's far easier to find ambiguity in the rules than to write them. - MikeE [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 23-01-2002, 19:19
Ulibrium Ulibrium is offline
Registered User
#0920 (Lancers)
 
Join Date: Jan 2002
Location: Philadelphia, PA
Posts: 29
Ulibrium is an unknown quantity at this point
Send a message via AIM to Ulibrium
Master uP Initialization Routine

What's all of this:

tempA CON c_p3_x <<1 + c_p4_x <<1 + c_p1_x <<1 + c_p2_x <<1 + c_rc_swB
dataInitA CON tempA <<1 + c_rc_swA <<1 + c_oi_swB <<1 + c_oi_swA
tempB CON c_sensor4 <<1 + c_sensor3 <<1 + c_p1_y <<1 + c_p2_y <<1 + c_sensor2
dataInitB CON tempB <<1 + c_sensor1 <<1 + c_packet_num <<1 + c_PB_mode
tempC CON c_batt_volt <<1 + c_sensor7 <<1 + c_p1_wheel <<1 + c_p2_wheel <<1 + c_sensor6
dataInitC CON tempC <<1 + c_sensor5 <<1 + c_p3_y <<1 + c_p4_y
tempD CON c_res01 <<1 + c_delta_t <<1 + c_p3_aux <<1 + c_p4_aux <<1 + c_p1_aux
dataInitD CON tempD <<1 + c_p2_aux <<1 + c_p3_wheel <<1 + c_p4_wheel

Output COMA
low COMA
low COMB
Wait_init: if IN3 = 1 then Wait_init:
Shiftout COMB,COMA,1, [dataInitA,dataInitB,dataInitC,dataInitD,dataInitVo lt]
Input COMA
high COMB

Does it actually effect the I/O processor? Let's say I keep all the c_constants 0... does it make a difference? Does it have an effect on the order of variables that the SERIN command takes?
__________________
Three mathematicians slave over a board full of tensor calculus. One looks to the other and asks... "do you remember what we sent out to prove?"
  #2   Spotlight this post!  
Unread 23-01-2002, 19:44
Matt Reiland's Avatar
Matt Reiland Matt Reiland is offline
'The' drive behind the drive
None #0226 (TEC CReW Hammerheads)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1999
Location: Troy Michigan
Posts: 712
Matt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond repute
As far as I know the order of the variables is set no matter if you change the c_CONstants to 1 or 0. If you have selected a variable to be a CON 0 then that variable in the serin command is skipped over (you omit it completely). I wouldn't change the code that you pasted in your message.
  #3   Spotlight this post!  
Unread 23-01-2002, 21:39
thedillybar thedillybar is offline
Registered User
#0894 (Chargers)
 
Join Date: Jan 2002
Location: Flint, MI
Posts: 56
thedillybar is an unknown quantity at this point
Send a message via AIM to thedillybar
It's just combining the variables in your program to 4 large variables so it can send it faster over the modem. There's no need to modify it that I can think of.
  #4   Spotlight this post!  
Unread 23-01-2002, 22:22
s_alaniz s_alaniz is offline
Registered User
#0057 (Leopards)
 
Join Date: Jun 2001
Location: Houston, Tx
Posts: 73
s_alaniz is an unknown quantity at this point
EEK!

If you look at the diagram in the innovation FIRST controller manual, there is a block diagram somewhere in the front that shows there are three processors in the RC. The Main processor, the Basic stamp you program, and a slave output processor. The code you're looking at instructs the Basic Stamp HOW to communicate with the main processor. It would be a serious mistake to change that code! But it makes for interesting reading.


Best Wishes


Steve Alaniz


"What good is technology if you can't abuse it?" - Ted Forth
  #5   Spotlight this post!  
Unread 24-01-2002, 09:13
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
The STAMP2/SX processor within the robot controller does not have the variable space to retrieve every possible input value for your program to use. Therefore, the block of code you mentioned is required to tell the Master CPU which variables you want sent to your code in the SERIN command. To do this, set the corresponding constant for each value you want to use in the "Define Constants for Initialization" section to 1. Note, as it has been previously mentioned, the order these variables arrive is FIXED(see the comments above serin in the default code), but the constants determine which of the possible variables you will recieve.

General rule for looking at the default code: If it says "do not change", DON'T
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #6   Spotlight this post!  
Unread 24-01-2002, 16:43
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,631
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Order what you want, eat what you order...

I agree with Steve and Nate. I have this to add, though.

Basically you have a menu to pick from by setting the c_variablename constanst to 1 or 0. Once you pick from the menu, your choices get sent to the kitchen via the shiftout command you are asking about. It is your job to make sure you order what you wanted because that is what the master CPU is going to send you 40 times a second for the rest of your life (or until you reprogram your STAMP2).

As to your particular question, all those lines of code are turning your menu choices into the right string to output via the shiftout command.

Basically, by shifting left and adding in new constants that are either 1 or 0, you are building up a constant that has 1's and 0's in the right place for the shiftout command.

If you are a coding "tough guy" you can set the bits directly by just assigning dataInitA etc. to something in one step (e.g. dataInitA=$F8). While it is possible to do this, it is silly and very likely to cause you grief.

In the end, the best thing is to use the code as Innovation First intended.

Joe J.
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
initialization program and speed controllers rosebud Programming 15 05-10-2004 03:35
Image Discuss: Stack Master CD47-Bot Robot Showcase 13 04-03-2003 21:47
Team 1002: Master Strategy Real Deal Robot Showcase 3 25-02-2003 08:48
my master plan (mwahahahahaha) archiver 2001 4 23-06-2002 22:04
Pre-Match/Post- Match Pit Routine Mark_lyons General Forum 14 31-03-2002 15:19


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

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