Go to Post When it comes to FIRST (you've all heard the cliche) -- we're all winners. When it comes to the competition: to the engineering design challenge, we're NOT all winners -- some solutions are better than others. - JVN [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 19-03-2005, 16:56
Gary Bonner Gary Bonner is offline
Registered User
FRC #3974
 
Join Date: Jan 2002
Rookie Year: 2000
Location: PA
Posts: 120
Gary Bonner has a spectacular aura aboutGary Bonner has a spectacular aura about
User_Byte

Are the User_Byte variables just for displaying info through the Dashboard? Are they all used to display breaker panel data? Can any value be put in them? I haven’t found any documentation on them.

Thanks
  #2   Spotlight this post!  
Unread 19-03-2005, 17:23
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: User_Byte

User_Byte1 can be displayed on the LCD on the OI by pressing the select button until you see a 'u' before the numbers. All 6 of them can be seen on the Dashboard.

The default code stores the last breaker tripped in User_Byte1 (only works if you plug the breaker panel into the RC). Any 8-bit value can be stored in any of the User_Bytes. I use two of them to send out one pot value. I store the top 8 bits in one User_Byte and the last two bits in another.

I'll see you guys at Drexel. If you need any more help do hesitate to ask MOE. I'm sure you can find us (we are the green people under the giant Tower of MOEdor )
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 19-03-2005 at 17:27.
  #3   Spotlight this post!  
Unread 20-03-2005, 09:21
Gary Bonner Gary Bonner is offline
Registered User
FRC #3974
 
Join Date: Jan 2002
Rookie Year: 2000
Location: PA
Posts: 120
Gary Bonner has a spectacular aura aboutGary Bonner has a spectacular aura about
Re: User_Byte

What does this function do? It uses all the user_byte variables.

Thanks

Code:
/*******************************************************************************
* FUNCTION NAME: Handle_Panel_Data
* PURPOSE:       State machine for incomming Breaker Panel data.  
*
*
* NOTE:          Normally device specific code should reside in another file but
*                for the purpose of simplification we chose to put it here. 
*
* CALLED FROM:   CheckUartInts
* ARGUMENTS:     1
*     Argument       Type             IO   Description
*     --------       -------------    --   -----------
*     data           unsigned char    I    incoming data byte
* LIMITATIONS:   The data from the breaker panel does not contain a checksum.
*				 See the breaker-panel-packet-definitions.pdf file for more info.
*******************************************************************************/

void Handle_Panel_Data(unsigned char data)  
{
  switch (IntState)
  {
    case 0:  // 1st 0xC9
      IntState = 0;
      if (data == 0xC9) IntState = 1;
      break;
    case 1 : // 2nd 0x17
      IntState = 0;
      if (data == 0x17) IntState = 2;
      break;
    case 2 : //get DATA1
      dataIn.data1Byte.allbits = data;
      txdata.user_byte3 = data;
      aBreakerWasTripped = (int) dataIn.data1Byte.bitselect.tripped;
      IntState = 3;
      break;
    case 3 : //get DATA2
      dataIn.data2 = data;
      txdata.user_byte4 = data;
      IntState = 4;
      break;
    case 4 : //get DATA3
      dataIn.data3 = data;
      txdata.user_byte5 = data;
      IntState = 5;
      break;
    case 5 : //get DATA4
      dataIn.data4 = data;
      txdata.user_byte6 = data;
      IntState = 0;
      break;
    default:
      IntState= 0;
      break;
  }
}
  #4   Spotlight this post!  
Unread 20-03-2005, 09:46
BrianBSL BrianBSL is offline
Registered User
FRC #0190
 
Join Date: Sep 2004
Rookie Year: 2000
Location: Worcester, MA
Posts: 251
BrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud of
Re: User_Byte

Note that in order to pass inspection this year, your user byte must show the master firmware revision #, which is its default value, so be prepared to switch it back to this if you use it for something custom. (They are having a lot of problems with teams with old firmware I guess.)
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


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

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