Go to Post FIRST- its a pandemic in all our schools. - Akash Rastogi [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 Rating: Thread Rating: 9 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 28-10-2004, 15:02
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
Programming - Getting Started

With the advent of a new season and the influx of new programmers-to-be I decided to do a 1 or 2 page write-up on just how a programmer new to FIRST can get started. I wrote this up to bootstrap rookie team programmers. Sort of a how does one get started when they know absolutely nothing about where to even start programming the FIRST controller. It’s not intended to replace the IFI documentation, it’s more to direct new programmers to it. I tried to stay away from most "how to program" type stuff and more advanced topics like the Linux/Windows debate and configuration management. This is just to get newbies rolling. Anyone have suggestions, additions, corrections. Everything is up for debate.

P.S. I have enough tips now to continue the recent trend in “lists”, but I’ve created three lists: One for programming tips, another for tips specific to just the control system, and the third for quick starting new FIRST programmers.

Programming Quick Start
  1. Beginners need the following to program the FIRST robot:
    • FRC (Full-size Robot Controller) RC Default Code
    • Microchip MPLAB & C compiler
    • IFI_Loader
    • A standard serial cable
    • A Windows PC with a serial port or USB-to-serial converter
  2. All default code, updates, documentation, and support information is available at http://innovationfirst.com/FIRSTRobotics/documentation.htm, the Innovation FIRST (IFI) website, The default code “FRC RC Default Code” comes ready for basic driving and with a variety of sample I/O usages.
  3. 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 is free on-line at the Microchip website http://www.microchip.com/, but the C compiler is not free except via the Robovation CD and is only available online as a time-limited trial copy or for purchase. Manuals for using MPLAB come on the FIRST CD.
  4. IFI_Loader (from the CD or IFI website above) is used to download the compiled code into the RC via a serial cable from your desktop or laptop computer.
  5. Check the IFI website periodically for updates to the software that corrects issues fixes problems.
  6. 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.,
  7. 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.
  8. Documentation is your friend. Take the time to at least leaf through each manual, so you have an idea of where information can be found. Most of the basic information beginners require can be found in the IFI documents or MPLAB documents:
    • IFI Programming Reference Guide – basic how to program and download to the RC, hookup switches and sensors and do normal robot operations.
    • IFI RC Default Code Reference Guide – description of how the default code is structured and where users can add their own custom code.
    • MPLAB v6.xx Getting Started – basic how to use MPLAB and set options.
    • MPLAB C18 Users Guide – table of max numbers each variable type will store, compiler options, error messages, detailed descriptions of pragmas and some other advanced topics.
    • MPLAB C18 Libraries – details on timers, interrupts, and various other utility functions available to the programmer.
    • More advanced documents are also available, e.g., 18Fxx20 Data Sheet (& Errata)– PIC assembly instruction set and details on EEPROM and other chip specific topics, and several others.
  9. Programming limits to the 2004 RC:
    • 30,720 bytes 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 file.
    • 120 bytes of variables within a 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 MPLAB will generate for you.
  10. Common beginner problems include improper MPLAB project setup, trying to pack too much code into the controller, printf misunderstands, using too small a variable type to hold the largest possible intermediate as well as the largest final value of a calculation, and lack of proper variable typecasting.
  11. 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 : 28-10-2004 at 19:30.
 


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 13:27.

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