Go to Post When you score a Supercell on your own alliance it has a tendency to sway a match... - EricLeifermann [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 12-01-2008, 23:10
jratcliff jratcliff is offline
Registered User
no team
 
Join Date: Jan 2008
Location: Lake Saint Louis, Missouri, USA
Posts: 10
jratcliff will become famous soon enoughjratcliff will become famous soon enough
Help, I'm a world class computer programming genius yet I'm totally lost.

Hey guys, I'm looking for help in getting started on things here. My son is a Freshman in high school and is beginning first robotics this year. His team doesn't really have any programming expertise to speak of and it looks like I have been drafted to help out.

I have been drafted because I am an expert professional computer programmer. I have been programming computers in assembly language, C and C++ for about 30 years. One of the first computers I programmed was an Altair, where you had to actually program the computer by setting each instruction in binary via a set of switches and pressing a button. Output was a set of LED lights.

So, color me surprised when in 2008 I find that high school kids are still programming low-level embedded systems as 'beginner projects'.

I have written a couple of best selling computer games for Electronic Arts, shipped games on numerous platforms and microprocessors, and more recently was the lead engine programmer for the massively multi player online game 'Planetside' for Sony Online Entertainment.

So, of course, I am posting a message in this forum, generally to a bunch of teenagers, asking, please, for some help.

Now, surely I don't need any help programming, that I know all about. What I want to know, is where in the heck is the documentation for the very, very, hardware specific features of programming these kits for the FRC competition?

This week I purchased a VEX Robotics kit and my son, Alex, put the whole thing together. Today we installed MPLAB and experimented with compiling and running some sample code.

This raised a huge number of questions. When you read the sample code provided it is filled with 'comments' that make references to obscure acronyms which I cannot find documented anywhere.

I currently have the MPLAB compiler, assembler, and linker. I can compile, link, and debug code both on the simulator and the robot controller itself. I have the MPLAB C documentation which, for the record, is quite excellent. I purchased this week a number of books about programming PIC microcontrollers and I am familiarizing myself with them.

Still, I have a number of questions. As I read source code, documentaiton, and messages here on the forum it appears to presume a massive amount of knowledge about acroynyms that I can't find documented anywhere. When beginners post questions on the forum they are generally referred to reference material on the C programming language. That's all well and good, but where is the reference material on the arcane oddities of getting the transmitter/receiver to talk to the microchip and the microchip to control inputs, outputs, and motors?

Let me give you a specific example. In the sample source code provided with the VEX as a 'learning tool' for new programmers you can find the following section of code:

/*
Example: The following would generate a 40KHz PWM with a 50% duty cycle
on the CCP2 pin (PWM OUT 1):
*/

/**
Setup_Who_Controls_Pwms(USER,USER,MASTER,MASTER,MA STER,MASTER,MASTER,MASTER);
CCP2CON = 0x3C;
PR2 = 0xF9;
CCPR2L = 0x7F;
T2CON = 0;
T2CONbits.TMR2ON = 1;
Setup_PWM_Output_Type(USER_CCP,IFI_PWM,IFI_PWM,IFI _PWM);
**/


This is, of course, remarkably non-useful to the new programmer. It raises a long series of important questions. In addition to wondering what the heck a 'PWM' is, and what it's good for, we have a lot of other questions.

(1) Where is the source code to the logic that runs when 'MASTER' is set to true? Is this, perhaps, in firmware and we don't have the source?
(2) What is 'CCP2CON' and why are we setting it to 0x3C? (No documentation)
(3) What is 'PR2' and why are we setting it to 0xF9?
(4) What is CCPR2L and why are we setting it to '0x7F'?
(5) What is 'TTCON' and why are we setting it to 0?
(6) What is 'T2CONbits.TMR2ON' and why are we setting it to zero?

Apparently, even in sample code for teenage programmers new to the FRC competition we are to assume they know what 'PWM', 'TTON', "CCPR2', and 'PR2' mean!???

Where is the missing piece of documentation in all of this?

I do have some very specific questions:

(1) Can I run the same code I compile and link with my VEX controller on the teams FRC controller?
(2) Kevin, of kevin.org, provides some amazing looking sample framework code. Can I run this on a VEX or is it for FRC only? Is there enough in Kevin's framework to run a basic robot on a frame, or does it still require a lot of code?
(3) Where can I find documentation about all of the device specific acronyms, what they mean, and how are they used?

For example, where is an explanation of (A) how to read all of the incoming signals from the remote control and (B) send output signals to all of the motors? Are these the same or different between the FRC controller and the VEX controller?

I feel like, after having read enormous amounts of documentation, reviewed a lot of source code, and gone over numerous reference books on how to program the PIC microcontroller, I still don't know how to make a motor turn when somebody moves a joystick button on the controller.

Just what am I missing??

Thanks,

John and Alex
 


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
AHHH! I'm a lost newbie! I need help! lkdjm Programming 8 28-01-2006 08:41
i'm in the charleston area, and i'm looking to help out a team near here... dickymon General Forum 2 05-08-2002 16:40
OK...so I'm totally out of the loop... Markfuscius 3D Animation and Competition 8 03-02-2002 02:39


All times are GMT -5. The time now is 13:51.

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