Go to Post You can never have enough FIRST! :D - Koko Ed [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 16-01-2002, 18:34
Ghetto_Child's Avatar
Ghetto_Child Ghetto_Child is offline
Registered User
#0253 (Mills Robotics Team)
 
Join Date: Jan 2002
Location: millbrae, CA
Posts: 51
Ghetto_Child is an unknown quantity at this point
Talking Pbasic argument question...

Can anyone define the argument for Serout (255,255...)? What do the 255's mean? Thanks.
  #2   Spotlight this post!  
Unread 16-01-2002, 19:13
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
The 255's are simply signals to the output cpu telling it that this is the start of the stream of bytes.

If the o/p cpu were not to receive them (maybe it missed them on powerup), it woud sit there listening for 255,255. Once received (the next time the Stamp sends an output stream), the bits would be pigeonholed properly as bit 'n' from the start, bit 'n+1' and so on.
  #3   Spotlight this post!  
Unread 16-01-2002, 20:35
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
Why a PWM value should NEVER be 255...

This is also why you should always limit your PWM values to 254 -- NEVER allow them to be 255.

If you look at the output order, there is always a PWM value output between things that could possibly be a value of 255 (for instance you may want all relays ON, in this case relayA may be all 1's which is $FF or 255. If this was next to another thing, say relayB that could also be 255, the master CPU would think, "A HA, This is the start of the data stream" But, Innovation First cleverly put a PWM value in between RelayA and RelayB. So, the only way to make a "255, 255" sequience is to foolishly allow the PWM value to equal 255.

This problem can cause very subtle errors. MOST of the time everything is right as rain, then BOOM! Thunder and lighting! your code crashes.

Do yourself a favor, make sure you get good at limiting the values of your PWM outputs to 0-254.

Joe J.
  #4   Spotlight this post!  
Unread 16-01-2002, 22:09
Unsung FIRST Hero
Warren Boudreau Warren Boudreau is offline
Registered User
FRC #0180 (Team SPAM)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Stuart, FL
Posts: 354
Warren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond repute
Last year, we spent a day trying to figure out why our robot would suddenly do a little dance and make the light blink on and off whenever we commanded full forward. We reduced the limit to 254 and it went away. Some software religious thing, I figured. It wasn't until after shipping that I was able to go back and realized that the 255,255 was the serial output initialization identifier. Everytime the second STAMP processor sees a 255,255 it thinks that there is a new stream of data so the next byte is PWM1 and the one after that is RelayA, etc.

The good thing was that I was able to help out another team at Nationals with this tidbit of information and they were able to get their 'bot up and working. They were quite grateful.
__________________
Warren B

Pool Noodles. They're not just for bumpers anymore.
  #5   Spotlight this post!  
Unread 18-01-2002, 02:50
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
If it helps, the robot controller to operator interface data stream is documented in the dashboard port specification that is located on InnovationFIRST's website. We also have a link to it on our team's website: http://www.cvhsrobotics.org/resources.htm

Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org

Last edited by Kevin Watson : 18-01-2002 at 02:53.
  #6   Spotlight this post!  
Unread 19-01-2002, 15:12
Ghetto_Child's Avatar
Ghetto_Child Ghetto_Child is offline
Registered User
#0253 (Mills Robotics Team)
 
Join Date: Jan 2002
Location: millbrae, CA
Posts: 51
Ghetto_Child is an unknown quantity at this point
that helps

thank you everyone!
  #7   Spotlight this post!  
Unread 17-02-2002, 00:28
GhettoTech GhettoTech is offline
Registered User
#0300 (Ghetto Techs)
 
Join Date: Feb 2002
Location: Philadelphia
Posts: 21
GhettoTech is an unknown quantity at this point
Send a message via AIM to GhettoTech
Just for the fun of it... has anyone tried to force the controller to send out a value of 256? Or turned a byte variable into a word and given it some random signal of 300? After reading this post I thought about trying it and I plan to try it durring the off season. Just wondering if anyone has already tried it.
  #8   Spotlight this post!  
Unread 17-02-2002, 20:14
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,604
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Quote:
Originally posted by GhettoTech
Just for the fun of it... has anyone tried to force the controller to send out a value of 256? Or turned a byte variable into a word and given it some random signal of 300? After reading this post I thought about trying it and I plan to try it durring the off season. Just wondering if anyone has already tried it.
Before you go messing up your robot, you should read the section of the PBASIC manual about math, and you will find your answer.
  #9   Spotlight this post!  
Unread 17-02-2002, 21:06
Manoel's Avatar
Manoel Manoel is offline
Registered User
FRC #0383 (Brazilian Machine)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Porto Alegre, RS, Brazil
Posts: 608
Manoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond reputeManoel has a reputation beyond repute
Send a message via ICQ to Manoel Send a message via MSN to Manoel
256 would become 0, since it works much like a car's odometer, if you go past the limit it starts all over again.
__________________
Manoel Flores da Cunha
Mentor
Brazilian Machine
Team # 383
  #10   Spotlight this post!  
Unread 17-02-2002, 22:44
GhettoTech GhettoTech is offline
Registered User
#0300 (Ghetto Techs)
 
Join Date: Feb 2002
Location: Philadelphia
Posts: 21
GhettoTech is an unknown quantity at this point
Send a message via AIM to GhettoTech
Quote:
Before you go messing up your robot, you should read the section of the PBASIC manual about math, and you will find your answer.
I have read, re-read and recently reviewed the PBASIC manual's section on math, but I still don't know what will happen to the robot controller if, for example, I were to take the p1_y variable and change it from a byte variable, into a word variable, and give it a value larger than 254. Will any extended bits be trunkated before going through the serout command?
  #11   Spotlight this post!  
Unread 18-02-2002, 09:23
JHBurch JHBurch is offline
Registered User
#0045 (TechnoKats)
 
Join Date: Nov 2001
Location: Kokomo, IN
Posts: 10
JHBurch is an unknown quantity at this point
I'm not sure why you would want to do this, but I guess curiosity is a good thing. More than likely, the robot controller would see the first byte of your new p1_y word variable as the p1_y byte and the second byte as whatever the next variable is supposed to be, like RelayA. My only question then would be which byte of the word variable would the serout command send first, the high byte or the low byte? I didn't see an answer after a quick perusal of the Stamp Manual, let us know if you find out.
__________________
Jeff Burch
TechnoKats #45
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
PBASIC Syntax Question Raven_Writer Programming 4 20-08-2003 08:07
Question Obtaining Pbasic 2.5 PyroPhin Programming 3 18-01-2003 01:26
pbasic question Mike375 Programming 14 15-01-2003 06:54
PBasic Question Melissa H. Programming 28 17-11-2002 18:53
Another PBASIC Question Ian W. Programming 4 31-01-2002 21:36


All times are GMT -5. The time now is 08:23.

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