Git Product home page Git Product logo

elecanisms's Introduction

Master

======

Master repository for ENGR3199 includes C and Python source code and supporting files

Running Code

In order to use this code for a PIC24FJ128GB206 using Olin's board, read below

My System: OSX 10.11 El Capitan Latest homebrew installed

Setting up system w/ MPLab

  • Install xc-16 (The 16-bit compiler compatible with this chip from microchip. Note: must use the XC16 Compiler v1.25 to work!
  • Install MPLabX 3.20 from microchip
  • Install pyusb's tar file via walac's github
    • Extract tar file, navigate into newly created directory and run:
      python setup.py install
      
  • Install libusb by running
brew install libusb

Setting up MPLabX to compile your code

  • From MPLabX, open a new project. Give it a name <PROJECT_NAME>
    • For setup, choose a PIC-24-FJ-128GB-206 (Without the dashes) as the device (To make it easier to find, choose 16-bit MCUs in the Family filtering section)
    • Choose XC-16 (v1.25) for your compilers
  • Import all files necessary for the code
  • Source Files: Include all .c code here, in this case blink.c
  • Header Files: Include all .h code here, in this case: common.h, config.h, timer.c, timer.h, ui.c, and ui.h
  • Linker Files: Include .gld file here, in this case: app_p24FJ128GB206.gld
  • From MPLabX, click the hammer button at the top to BUILD the project. If the output says "Build Successful," then a .hex file will be generated that is used on the board.

Pushing code to the board

  • Navigate to the directory of the github install run bootloadergui.py python site_scons/booatloadergui.py
  • Connect the PIC to your computer in bootloader mode.
  • In order to enter bootloader from the device, hold the bootloader button before connecting.
  • Alternatively, hold the bootloader while resetting
  • In Bootloader GUI, click "Connect". It should now be connected to your board.
  • Import Hex (Command+I) from MPLabX's build directory <USER>/MPLABXProjects/<PROJECT_NAME>/dist/default/production/ Default name of the hex is: <PROJECT_NAME>.X.production.hex
  • In Bootloader GUI, click "Write".
  • To see code working, click "Disconnect/Run"

Minimum requirements for uploading new code through GUI

Assumes MPLabX are both open and the environment is set up through the above.

  • Reset board into bootloader mode
  • Compile code in MPLabX with Build or Build/Clean
  • Load .hex file from bootloadergui.py
  • Reconnect device from bootloader gui
  • Write code
  • Disconnect/Run

elecanisms's People

Contributors

bminch avatar mtkwock avatar amhoov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.