View Single Post
  #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,817
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.