Go to Post Our team is using a video camera with frame-by-frame analysis to figure out all the characteristics of the foam ball. If the Boeing engineer says it's possible, I'm going to believe him. - sciencenerd [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 Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-01-2005, 18:41
nehalita's Avatar
nehalita nehalita is offline
Robots are friends
AKA: tagger fanatic
FRC #1345 (Platinum Dragons); FRC# 97 (RoboRuminants)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Ft. Laud, FL
Posts: 870
nehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond repute
Send a message via AIM to nehalita Send a message via MSN to nehalita Send a message via Yahoo to nehalita
Thumbs up Re: Programming - Getting Started

this helped me soooo much. thank you all. this is our second yr competing and this is my first year in FIRST. i have a java background and a simple C background from 8th grade...but it was so long ago.

I'm the only one in charge of programming so when i was handed all these Cd's and codes and links and websites, i was pretty overwhelmed. i just learned about this today and I've spend the majority of the day looking through posts to answer my Q's

is there anyone here that i can directly e-mail or talk to if i have questions? (warning: I'm like a pet, i demand a lot of attn: i have questions everyday....or close to it)

also, everyone speaks about a "dongle" and i saw the picture and everything. but what exactly IS it?
__________________
"Relativity applies to physics, not ethics." Thank you Einstein
MIT '10

Proud Member of H.I.L.
The PLATINUM DRAGONS are on FIRE!
  #2   Spotlight this post!  
Unread 15-01-2005, 19:27
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Programming - Getting Started

Quote:
Originally Posted by nehalita
also, everyone speaks about a "dongle" and i saw the picture and everything. but what exactly IS it?
The Operator Interface (OI) has a 15-pin Competition Port connector in the middle of the top. Pins on that connector are used when running on a competition field to enable or disable the robot, select the radio modem frequency, and control autonomous mode. The field also supplies power to the OI through that port.

Teams are permitted to connect to four specific pins on the Competition Port, in order to 1) enable additional frequencies for practicing with multiple robots, 2) activate autonomous mode for testing, and 3) disable the robot. Most teams build a box with two or three switches that connects to the port. That box is called a dongle. The Competition Port Pinout Guide shows how to construct one.
  #3   Spotlight this post!  
Unread 27-01-2005, 12:21
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,753
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: Programming - Getting Started

Here's an updated version for this year with 2005 links included.

Programming Quick Start
  • Beginners need the following to program the FIRST robot:
v FRC (Full-size Robot Controller) RC Default Code

v Microchip MPLAB & C compiler



v IFI_Loader
v A standard serial cable
v A Windows PC with a serial port or USB-to-serial converter


  • MPLAB is the FIRST supplied Windows based development environment (edit, compile, debug) that runs on your desktop computer and is usually provided to each team on a compact disk in the Robovation kit. MPLAB v7.0 is also free on-line at the Microchip website http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName =en019469&part=SW007002 , but the C compiler is not free except via the Robovation CD and is normally only available online as a time-limited trial copy or for purchase. For a limited time the latest compiler is available from a link on http://www.usfirst.org/ (bottom left of the page where it says “Microchip Software downloads”). After the link is removed the latest compiler must be obtained through FIRST.Manuals for using MPLAB come on the FIRST CD.
  • Check the IFI website periodically for updates to the software that corrects issues and fixes problems. For instance, the first update that must be performed is the downloading of a new Master Controller “patch” http://www.ifirobotics.com/docs/master-software-ver10.zip . Follow directions included with the download.
  • The programming language used is “C” or PIC assembly. Tutorials in C can be found on the web, in your local bookstore or on the FIRST website, e.g.,
v C Programming Resource Library http://www.usfirst.org/robotics/C_help.htm has a great overview of the programming process.
v Learn C Programming - Developed by Carnegie Mellon and the National Robotics Engineering Consortium specifically for FIRST, this interactive website will get your team prepared for the FIRST Robotics Competition. http://www.rec.ri.cmu.edu/education/robot_builder/

v FIRST Robovation - A Primer for Success Learning Modules http://www.usfirst.org/robotics/robovation/primer/index.html

  • Newer laptops no longer come with serial ports. If you have this problem one solution is to use a USB/Serial converter. Various models are available at Radio Shack, CompUSA, or online, however, some models can be temperamental and they generally take longer to download than a built-in serial port (60sec vs 10 sec). Good results have been reported using: Bafo Technologies BF-810 (~$15) and a Radio Shack USB-to-Serial port cable #26-183 ($42).
v c18_getting_started_2.4.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB_C18_Getting_Started_51295d.pdf
v c18_libraries_2.4.pdf – details on timers, interrupts, and various other utility functions available to the programmer. http://ww1.microchip.com/downloads/en/DeviceDoc/C18_Lib_51297d.pdf

v c18_users_guide_2.4.pdf - table of max numbers each variable type will store, compiler options, error messages, detailed descriptions of pragmas and some other advanced topics. http://ww1.microchip.com/downloads/en/DeviceDoc/C18_UG__51288e.pdf

v Microchip pic18f8520 data sheet - PIC assembly instruction set and details on EEPROM and other chip specific topics, and several others. http://ww1.microchip.com/downloads/en/DeviceDoc/39609b.pdf and mistakes in the datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/80157d.pdf

v Microchip PICmicro 18C MCU Family Reference Manual – all things great and small (in excruciating detail) about the processor we use. http://ww1.microchip.com/downloads/en/DeviceDoc/39500a.pdf

v MPLAB Quick Start Guide.pdf - basic how to use MPLAB and set options. http://ww1.microchip.com/downloads/en/DeviceDoc/51281d.pdf

v MPLAB Users Guide.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/51519a.pdf

  • Programming limits to the 2004 RC:
    • 30,720 bytes of program space is available to the user, after 2004 IFI code.
    • 1,343 bytes of ram available to the user, after 2004 code overhead.
    • 256 bytes of global variables available within any one MPLAB project file, such as user_routines.c
    • 120 bytes of variables can be declared within any single routine.
  • The program and data space your code has used can be checked either by the status line at the bottom of the IFI_Loader window or via the optional .map file that you can set MPLAB to generate for you. Note: the .map file lists % of program space used, but the user will have only 90% available to him or her. The .hex is ASCII and file size is no indication of code size.
Visit the ChiefDelphi Programming forum for discussions on all programming topics, problems, and issues http://www.chiefdelphi.com/forums
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-01-2005 at 12:29.
  #4   Spotlight this post!  
Unread 01-02-2005, 16:06
katkana katkana is offline
that programmer chick
AKA: Gillian Koch
FRC #1412 (Mercedes Metalheads)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Hackensack
Posts: 28
katkana is on a distinguished road
Send a message via AIM to katkana
Re: Programming - Getting Started

*waves hand* hi... I'm another of the newbies with little (read, none) experience working with C. I am also the only one on my team doing the programming dance. At the moment I'm teaching myself from whatever tutorials I can find, but if anyone can spare a moment or ten through e-mail or IM to answer my questions, I would be muchly indebted to you.

AIM- daemonlvr856
e-mail- krystal_dragon9@yahoo.com

THANK YOU!!!

~kat
  #5   Spotlight this post!  
Unread 09-02-2005, 19:02
695programmer 695programmer is offline
Registered User
#0695
 
Join Date: Jan 2005
Location: beachwood
Posts: 3
695programmer is an unknown quantity at this point
Send a message via AIM to 695programmer
Question Re: Programming - Getting Started

I'm another newbie, with probably less experience than the other two and just as hopeful maybe someone could give me some time cause i'm running into problems i don't know how to solve. Any help is welcome via im or e-mail or anything.

Team 695
  #6   Spotlight this post!  
Unread 09-02-2005, 19:37
695programmer 695programmer is offline
Registered User
#0695
 
Join Date: Jan 2005
Location: beachwood
Posts: 3
695programmer is an unknown quantity at this point
Send a message via AIM to 695programmer
Re: Programming - Getting Started

I have another one i forgot about, when I try to build the error is that it can't locate the build tool, any insight?
  #7   Spotlight this post!  
Unread 16-02-2005, 02:53
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Programming - Getting Started

I really am a newbie. Heres proof. Can I call the function Limit_Mix as it exists in the v2.4 code from the autonomous mode section of user_routines_fast.c? I was under the impression that I can, but when I just tried to compile it gave me warnings about no function prototype (whatever that is ), but it seems to have compiled anyway. Anyone?
  #8   Spotlight this post!  
Unread 19-02-2005, 12:19
Matt_Kitts's Avatar
Matt_Kitts Matt_Kitts is offline
Registered User
AKA: Kitts
FRC #1370 (Blue Charge)
Team Role: Mechanical
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Middletown, DE
Posts: 16
Matt_Kitts is on a distinguished road
Send a message via AIM to Matt_Kitts Send a message via Yahoo to Matt_Kitts
Re: Programming - Getting Started

can anyone help me out with programming the buttons on the joy sticks`
  #9   Spotlight this post!  
Unread 20-02-2005, 01:53
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,753
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: Programming - Getting Started

Quote:
Originally Posted by Matt_Kitts
can anyone help me out with programming the buttons on the joy sticks`
Each OI joystick port has the 2005 KoP joystick buttons available in the default code as follows:
For Joystick Port 1:
  • p1_sw_top - thumb button
  • p1_sw_trig - trigger button
  • p1_sw_aux1 - button to the left of the "hat" switch on the front face
  • p1_sw_aux2 - button to the right of the "hat" switch on the front face
The other Port buttons follow the same naming convention, e.g.,
p2_sw_top would be on joystick Port 2, p3_sw_top on Port 3, etc.

They are used in your code like this:
Code:
if (p2_sw_top == 1)
printf("Hello FIRST\r");
else
printf("Goodbye cruel world\r");
There are also two analog inputs unused by the KoP joystick and the analog "hat" switch (that returns odd values).
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 20-02-2005 at 01:59.
  #10   Spotlight this post!  
Unread 22-09-2005, 18:21
RIgnazio RIgnazio is offline
Registered User
no team
Team Role: Webmaster
 
Join Date: Jan 2005
Rookie Year: 2004
Location: .
Posts: 45
RIgnazio will become famous soon enough
Exclamation Re: Programming - Getting Started

Quote:
also, everyone speaks about a "dongle" and i saw the picture and everything. but what exactly IS it?
A dongle can be made with a RS-232 (serial) end, specifically the metal part. If you look at it, there are pins you can solder wires too. What you should do is solder a wire to each pin that would complete the circuit in the Pin Layout for the RC. Now, instead of just attaching a wire and having done it (the easy way) attach a push button switch that is normally in the off or open position. When you press it, (15 seconds), it will simulate the signal that the FIRST computer sends to the robots to start autnomous. When you let go, autonomous will be over and the robot will be live.

Now, why do you say use a switch you may wonder? And why use a normally off/open switch? If your robot goes on an evil plot to kill you and you start to run away, you will let go of the switch, and the robot won't do autonomous anymore.

OK, newcomers, there are a few tips that I myself have:

1. Programming takes time. If it doesn't work correctly/compile on the first attempt, and you can't figure out what is wrong, Save the file, close out MPLAB, and go do something for an hour then come back. It will probably hit you then.

2. Pay attention to the default code. It is your friend. It will tell you just about absolutely everything you need to know to program the robot.

3. Autonomous mode is not hard, you just need to think about it. Remember, there is a 40ms clock in the RC, so 1 second = 26.2ms. This would be a good time for a calculator.

4. NEVER DELETE OLD CODE.

5. Always put new code, even if you're only changing a comment, in a new folder. SAVE AN ENTIRE SEPARATE COPY!

6. NEVER DELETE OLD CODE.

Those should be your ground rules. Enjoy

Last edited by RIgnazio : 23-09-2005 at 10:15. Reason: 40ms is wrong, it should be 26.2ms
  #11   Spotlight this post!  
Unread 22-09-2005, 23:15
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Programming - Getting Started

Quote:
Originally Posted by RIgnazio
If your robot goes on an evil plot to kill you and you start to run away, you will let go of the switch, and the robot won't do autonomous anymore.
Funny, the guy we had holding our kill switch seemed oddly fascinated with the robots attempt to kill our teachers 7 year old son, so fascinated he held the switch tightly, preventing us from intervening and killing it. Until of course we realized we could just..unplug the dongle...yeeeeah.

Quote:
Originally Posted by RIgnazio
3. Autonomous mode is not hard, you just need to think about it. Remember, there is a 40ms clock in the RC, so 1 second = 40ms. This would be a good time for a calculator.
I'm assuming you meant 1 cycle = 26.2ms

I'm not sure where you got 40ms, but my memory is bad, and I remember two loops running in the RC, perhaps you're referring to a separate one than I am.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #12   Spotlight this post!  
Unread 30-09-2005, 17:04
Budster Budster is offline
Registered User
#1073
Team Role: Mentor
 
Join Date: Jan 2005
Location: Hollis-Brookline, NH
Posts: 4
Budster is an unknown quantity at this point
Re: Programming - Getting Started

>> 3. Autonomous mode is not hard, you just need to think about it. Remember, there is a 40ms clock in the RC, so 1 second = 26.2ms. This would be a good time for a calculator.

Maybe it should read 40MHZ clock in the RC.
There is a 26.2ms sample time in the outer/main loop where you get new input from the operator station so in 1 second that is 40hz, i.e. 40 samples per second (actually is 28.167...hz, but 40hz is probably close enough)? Not really sure what the intent was, I'm having trouble parsing the line.

Bud
  #13   Spotlight this post!  
Unread 18-10-2005, 07:23
mallot1243's Avatar
mallot1243 mallot1243 is offline
Registered User
FRC #1243
 
Join Date: Apr 2004
Rookie Year: 2004
Location: Swartz Creek, MI
Posts: 27
mallot1243 is an unknown quantity at this point
Re: Programming - Getting Started

who knows which files are allowed to be transferred to the bot. ie <stdio.c>
  #14   Spotlight this post!  
Unread 18-10-2005, 10:55
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,753
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: Programming - Getting Started

Quote:
Originally Posted by mallot1243
who knows which files are allowed to be transferred to the bot. ie <stdio.c>
You are allowed to use any files in your project you like, even write your own as long as you include the ifi required libraries and supporting include files.

However, be aware that the PIC is limited in it's capabilities and will not support or fully support the functions you may want to use in a typical stdio.c file. You can't just drag one in from a PC and expect it to work. You can check the documentation (C:\mcc18\doc) to see what is supported by the C18 compiler.
The document that might interest you for the C18 v2.4 compiler is at:
http://ww1.microchip.com/downloads/e...Lib_51297d.pdf
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 18-10-2005 at 11:27.
  #15   Spotlight this post!  
Unread 19-10-2005, 12:07
mallot1243's Avatar
mallot1243 mallot1243 is offline
Registered User
FRC #1243
 
Join Date: Apr 2004
Rookie Year: 2004
Location: Swartz Creek, MI
Posts: 27
mallot1243 is an unknown quantity at this point
Re: Programming - Getting Started

thanx
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
Book on C programming - suggestions? wun Programming 18 14-01-2005 00:12
Help needed for getting started! chantilly_team Programming 4 27-10-2004 08:29
Autonomous Programming Competition Signup List SilverStar Programming 36 13-05-2004 15:09
Robot Programming Education phrontist Programming 11 03-05-2004 07:32


All times are GMT -5. The time now is 11:32.

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