Difference between revisions of "Microchip tools"

From DIDEAS Wiki
Jump to: navigation, search
m (Install software)
m (Install software)
Line 13: Line 13:
  
 
*Install development support tools (SVN client, [http://winmerge.org/ win merge], grep, [http://www.baremetalsoft.com/baregrep/ Baregrep], Visual Studio for IDE, editor, etc.)  [http://web.media.mit.edu/~cbarn/dspic/support/ Dev support]   
 
*Install development support tools (SVN client, [http://winmerge.org/ win merge], grep, [http://www.baremetalsoft.com/baregrep/ Baregrep], Visual Studio for IDE, editor, etc.)  [http://web.media.mit.edu/~cbarn/dspic/support/ Dev support]   
*checkout source code and support scripts from [https://bmech2.media.mit.edu:8443/svn/ric_powerfoot/trunk/  SVN server]
+
*checkout source code and support scripts from [https://bmech2.media.mit.edu:8443/svn/ric_powerfoot/trunk/  SVN server] (user biomech, password:biomechXXX where XXX is the primary lab room number)
**user biomech, password:biomechXXX where XXX is the primary lab room number.
 
 
*[http://www.media.mit.edu/~cbarn/dspic Top level tools]
 
*[http://www.media.mit.edu/~cbarn/dspic Top level tools]
 
*Install [http://www.ftdichip.com/Drivers/CDM/CDM20600.exe drivers for FTDI CHIP FT2232H] [http://www.ftdichip.com/Drivers/CDM/CDM20600.exe]
 
*Install [http://www.ftdichip.com/Drivers/CDM/CDM20600.exe drivers for FTDI CHIP FT2232H] [http://www.ftdichip.com/Drivers/CDM/CDM20600.exe]

Revision as of 18:42, 21 September 2010

  • Microchip Tools For Coding, Programming

Edit


PIC32 tools setup

Install software

config

mplab IDE config

  • This IDE can be used to both edit and compile/build/program

To load a PF project, the default settings of the MPLAB IDE need to be changed:

  1. open "MPLAB IDE"
  2. Under Configure -> Settings select the "projects" tab
  3. Uncheck the "use one-to-one project-workspace model"

Some other suggested changes:

  • From the "other" tab, select "automatically reload"
  • From the "workspace" tab, select "no", "reload last workspace", and "always show full path"

Some programmer settings could also be changedLLLLL9

  • Select Programmer -> settings and then "Program after successful build"

After this works, try to open and compile a workspace/project.

  1. From MPLAB IDE, select "File, Open Workspace"
  2. Navigate to "trunk/StateController" and open "sc_workspace_mit.mcw" (or similar)
  3. Ignore complaint about files having been relocated.
  4. after it opens, press "Ctrl F10" to do a "make clean" followed by "make all"

python config

A file that describes the directory structure of the project needs to be placed in c:\

  • Edit the file "support_scripts\python_paths.py", so that variables point the root of your project tree.
  • The root of your project tree the directory that contains the directories "support_scripts" and "pf_python"
  • the string "c:\ceb\0svn" is replaced with your root.
  • Afterward, copy it to c:\

The python interpreter needs to be added to the system path:

  • Ctrl click "My Computer" and then select "Properties"
  • From the new object, select the "Advanced" tab
  • Select "Environment Variables"
  • To the "PATH" variable, append "c:\python25;"
    • The path variable may exist under "user variable" or "system variables"
  • Verify that python is in the system path by starting a DOS prompt and running python

connect to the target (Pic32 or robot)

All the tools below live in the directory "support_scripts". Open a command shell and CD to that directory. Python is needed to run them and should be in your path.

wifi_fast.py

wifi_fast.py is the primary utility for receiving real-time telemetry from the target. It makes connection to the target via either a standard RS-232 serial port, or via a TCP connection. Once connected it reads telemetry, can log the data to a file, and can send the data via UDP for real-time plotting. It also sends keyboard characters to the target which can then be read via the C function 'getchar'.

  • get help with wifi_fast.py -h


via a wired connection

via a wireless connection

From the support scripts folder run :

  • FOR S3 : wifi_fast.py -i 216 -F -f xx -V dataport
  • FOR S5 : wifi_fast.py -i 218 -F -f xx -V dataport

do_command.py

do_command.py is used to send 'special' commands to the robot.

do_command.py -h

robo_config.py

robo_config.py is used to read / write the robot's EEPROM and to read some the data structures in RAM.

robo_config.py -h

other tools

dataport

  • in the SC file "dataport.c" there is the statement : switch(sc_dp.dataport_select)
    • for each case, there are a number of assignment of robot variables to variables of the form "pf[n]".
    • the special command "157" is used to set the value of the variable "sc_dp.dataport_select"
    • thus the command "do_command.py -i IP_ADDRESS -s 157 1" sets dataport select to 1.