Go to Post An explanation of the reasoning behind design decisions will almost always result in a more thorough understanding of the solution than analysis alone can obtain. - Travis Covington [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 20-01-2004, 08:22
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Beacon Code on Full Size RC?

OK, strange question, but can the beacon code be quickly and easily transferred to the full size RC?

My team's mentor is going to be on a business trip for a few days, and we'd like to test the IR code using the edubot as a robot, and the RC as the beacon, but we're not sure if you can easily transfer the code.

And if someone already asked this, um, yeah, I'm just stupid then .
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #2   Spotlight this post!  
Unread 20-01-2004, 11:16
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by Ian W.
OK, strange question, but can the beacon code be quickly and easily transferred to the full size RC?

My team's mentor is going to be on a business trip for a few days, and we'd like to test the IR code using the edubot as a robot, and the RC as the beacon, but we're not sure if you can easily transfer the code.

And if someone already asked this, um, yeah, I'm just stupid then .
Yes, it looks pretty easy to do.
The biggest difference is you'll have to change the beacon code to use two of the PWMs 13-16 rather than the PWMs 1 & 2 used on the EDU controller.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 20-01-2004, 11:46
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
Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by Ian W.
OK, strange question, but can the beacon code be quickly and easily transferred to the full size RC?

My team's mentor is going to be on a business trip for a few days, and we'd like to test the IR code using the edubot as a robot, and the RC as the beacon, but we're not sure if you can easily transfer the code.

And if someone already asked this, um, yeah, I'm just stupid then .
Yes, it should work just fine using these steps:
1) Drop a copy of beacon.c and beacon.h into a directory containing a fresh copy of the default EDU-RC code.
2) Use the project wizard to create a new project with the default code and beacon files.
3) Edit user_routines.c adding #include <beacon.h> in the #include area near the top and then a call to to Initialize_Beacon() in User_Initialization().
4) Change the call to Setup_PWM_Output_Type() to look like this: Setup_PWM_Output_Type(USER_CCP,USER_CCP,IFI_PWM,IF I_PWM);
5) You may also need to comment out the call to Generate_Pwms() in Process_Data_From_Master_uP().
6) While you're there, comment out the Default_Routine() and printf() calls in Process_Data_From_Master_uP().
7) Build and load the new .hex file.
8) Beacon type-0 should be on PWM13 and type-1 should be on PWM14.

Let us know if it works.

BTW, the tracking code works just fine on the EDU-RC. Here's a copy that'll get you started.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #4   Spotlight this post!  
Unread 20-01-2004, 16:51
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Re: Beacon Code on Full Size RC?

I'll try, but I didn't get a chance to grab the RC, so I'm not sure if I can do anything with this. Kind of frustrating, when you can't do anything for half a week... :-\
__________________
AIM --> Woloi
Email --> ian@woloschin.com
  #5   Spotlight this post!  
Unread 22-01-2004, 18:18
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Question Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by Kevin Watson
1) Drop a copy of beacon.c and beacon.h into a directory containing a fresh copy of the default EDU-RC code.
im assuming you mean the default FRC code here... we tried this, and it didnt work. running the program gives the error code "USER VIOLATION: Timeout on Packet Number (Infinite Loop or No call to PutData)" on the dashboard viewer. adding some debugging printf statements, we found that it initializes correctly and loops through the main loop several times, and then halts with that message. the odd thing is, it halts in the middle of the printf statement... i dont know if this is normal or what, but it gives the same error message with or without the printfs in there, so i dont think thats the problem. any ideas?
  #6   Spotlight this post!  
Unread 23-01-2004, 02:24
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
Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by doy
im assuming you mean the default FRC code here... we tried this, and it didnt work. running the program gives the error code "USER VIOLATION: Timeout on Packet Number (Infinite Loop or No call to PutData)" on the dashboard viewer. adding some debugging printf statements, we found that it initializes correctly and loops through the main loop several times, and then halts with that message. the odd thing is, it halts in the middle of the printf statement... i dont know if this is normal or what, but it gives the same error message with or without the printfs in there, so i dont think thats the problem. any ideas?
Hmmm... I'll try to have a look at it tomorrow (Friday). BTW, did you try it with and without the call to Generate_Pwms()?

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 23-01-2004, 13:14
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by Kevin Watson
Hmmm... I'll try to have a look at it tomorrow (Friday). BTW, did you try it with and without the call to Generate_Pwms()?

-Kevin
i just tested it with
Code:
#define _FRC_BOARD
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
in Process_Data_From_Master_uP() and it gives the same error... should i have to #define that? if i dont, Generate_Pwms() requires 8 argument, and i dont know what the difference is.

something we just found out is that when we reset the rc, the program light starts flashing green and red alternately, the code error light on the oi goes off, the pwm1 and 2 lights turn on, and the error on the dashboard goes away, but the infrared beacon doesnt go on, and all i can see on the pwm outputs on an oscilloscope looks like just 60 hz noise, so i dont think anything is actually being outputted. ill do some more testing tomorrow, but advice would be greatly appreciated.
  #8   Spotlight this post!  
Unread 23-01-2004, 14:10
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Beacon Code on Full Size RC?

Quote:
Originally Posted by doy
i just tested it with
Code:
#define _FRC_BOARD
Generate_Pwms(pwm13,pwm14,pwm15,pwm16);
in Process_Data_From_Master_uP() and it gives the same error... should i have to #define that? if i dont, Generate_Pwms() requires 8 argument, and i dont know what the difference is.
I don't think that's right. Ex:
Code:
const int SomeVal = 321;
#define SomeAlias SomeVal

void SomeSub(void)
{
 if (SomeVal == SomeAlias)
  Code_Allways_Executes();
 if (SomeVal <> SomeAlias)
  Code_Never_Executes;
}
Which is compiled as:
Code:
const int SomeVal = 321;

void SomeSub(void)
{
 if (SomeVal == SomeVal)
  Code_Allways_Executes();
 if (SomeVal <> SomeVal)
  Code_Never_Executes;
}
Get it?

Of course, I don't know all the ins and outs of C, so check the FRC default code.
  #9   Spotlight this post!  
Unread 23-01-2004, 23:04
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Re: Beacon Code on Full Size RC?

no... this is in ifi_utilities.h:
Code:
#ifdef _FRC_BOARD
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_13,unsigned char pwm_14,
                   unsigned char pwm_15,unsigned char pwm_16);
#else
  /* located in ifi_library.lib */
void Generate_Pwms(unsigned char pwm_1,unsigned char pwm_2,
                   unsigned char pwm_3,unsigned char pwm_4,
                   unsigned char pwm_5,unsigned char pwm_6,
                   unsigned char pwm_7,unsigned char pwm_8);
#endif
so if _FRC_BOARD is defined, Generate_Pwms() takes 4 arguments, otherwise it takes 8. since the code initially had 4 arguments named pwm13, pwm14, pwm15, and pwm16, i assumed that the 4 argument call was the one that should be called, so i #defined _FRC_BOARD.
  #10   Spotlight this post!  
Unread 24-01-2004, 12:41
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Re: Beacon Code on Full Size RC?

okay, we figured it out... in user_routines_fast.c we actually have to add the interrupt handler thats in the beacon project but not in the frc default code. it works now!

edit: well, it compiles and runs without errors, but the waveform isnt correct... ill keep working on it

edit: okay, well, no one ever told me the output would be on pwm13 and 14 for the frc... it works now(: this should be very helpful for us.

Last edited by doy : 24-01-2004 at 16:05.
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
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
InfraRed autonomous code ... mtrawls Programming 1 11-01-2004 00:25
Autonomous code PBoss Programming 7 14-01-2003 15:29
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46
Patent source code? Kyle Fenton Chit-Chat 3 20-10-2001 17:53


All times are GMT -5. The time now is 01: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