Go to Post now now, there is no such thing as reading the manual too much. I read it every night just before I go to bed. - 663.keith [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 24-01-2002, 16:19
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,648
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
Read the code...

There are parts of the code marked " (DO NOT CHANGE)" Don't change these parts of the code.

As to your questions, serin can be modified somewhat by the initializations you choose. You do this by choosing which variables the master CPU should send the STAMP2. Once you choose them (by putting 1's in the appropriate place to make the c_variablename constant equal to 1), they are fixed until you download a new program to the STAMP2.

After choosing the varialbes you want to get sent, you have to actually have your serin command match the variables requested. The most common cause of the "basic init error" LED going red is that the STAMP2 program asks for a different number of variables with the serin command than it requested via the c_variablename constants.

As to the serout command, things are much more stable. Generally speaking you have nothing to change. The only change that is allowed is that if you are dying to save a few milliseconds, you can truncate the output series. I don't recommend it because it usually means you are too close to the edge. If your code is that sensitive that this saves your program, you are probably going to go over the edge for some other reason very soon.

In the interest of full disclosure, I will show you how to truncate the serout command, even though I don't recommend it. Suppose you only needed to output p1_y, relayA, p2_y, and relayB. In this case your serout command could be shortened to:

Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB]

Finally, note that there is no changing the pins that the STAMP2 uses to communicate with the Master CPU -- for either the Serin command or the Serout command. This only makes sense since the pins are etched in copper and are difficult to move via software control ;-)

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
Interfacing a second Micro to the RC Matt Reiland Programming 3 08-06-2003 00:11
sensor doesn't work PBoss Programming 7 29-01-2003 18:39


All times are GMT -5. The time now is 02:26.

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