Difference between revisions of "Microchip tools"

From DIDEAS Wiki
Jump to: navigation, search
m (python support scripts config)
m (python support scripts config)
Line 55: Line 55:
  
  
A file that describes the directory structure of the project needs to be placed in "support_scripts"
+
A file that describes the directory structure of the project needs to be placed in "support_scripts" (which lives in the "project root directory"
 
* Edit the file "support_scripts\python_paths.py", so that variables point the root of your project tree.  
 
* 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 root of your project tree the directory that contains the directory "support_scripts"
* the string "c:\ceb\0svn" is replaced with your root.
+
* the string "c:\ceb\0svn" is replaced with your root,
  
 
=connect to the target (Pic32 or robot)=
 
=connect to the target (Pic32 or robot)=

Revision as of 15:03, 22 September 2010

  • Microchip Tools For Coding, Programming

Edit


Install software

Get the Firmware

Get source code and support scripts from SVN server (user biomech, password:biomechXXX where XXX is the primary lab room number)

  • To do this, launch SVN's repo browser (left click on a directory) find Tortoise SVN and then repo browser
  • Paste the above URL into the browser and supply the user / pass when prompted
  • Locate 'trunk' in the repo browser explorer window, then right click and select export. Use a local directory such as: "c:\my_src\project_trunk". This directory will be called the "project root" directory.
  • When the export is complete, you'll want to make a copy and check it into a your own revision control system.

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 support scripts config

The python interpreter needs to be added to the system path. Some other's explanation: Win7 Vista XP for Java

My version:

  • 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:\python26;"
    • The path variable may exist under "user variable" or "system variables"
  • Verify that python is in the system path by starting a command shell trying to run python


A file that describes the directory structure of the project needs to be placed in "support_scripts" (which lives in the "project root directory"

  • 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 directory "support_scripts"
  • the string "c:\ceb\0svn" is replaced with your root,

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.