stryd_one_codeblocks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
stryd_one_codeblocks [2006/08/05 03:39] – stryd_one | stryd_one_codeblocks [2007/10/05 23:29] (current) – stryd_one | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | :!: :!: :!: :!: :!: | ||
+ | ====== This document has been superseded and is kept for archival purposes only!!! Please see the new version! ====== | ||
+ | |||
+ | |||
+ | * Part 1 - [[windows_toolchain_core|Setup the core software toolchain for MIOS application development on Windows]] - These are the minimal Windows applications you need, to write a MIOS Application in C for your MIDIbox. | ||
+ | * Part 2 - [[windows_toolchain_ASM_ACSim|Extend your toolchain with MinGW to build the AC-Sim DOS C Simulator, or MPASM for ASM coding]] - These lesser-used options are both still important in certain situations. You will need MPASM if you would like to write applications in PIC ASM, or if you want to edit TK's ASM apps. MinGW is used to build the AC-Sim simulator, which is helpful for testing complex algorithms within your applications, | ||
+ | * Part 3 - [[windows_toolchain_codeblocks|Extend your toolchain with Code:: | ||
+ | \\ | ||
+ | :!: :!: :!: :!: :!: | ||
+ | |||
+ | |||
+ | ====== Developing MIOS Applications with Code:: | ||
+ | |||
+ | **Note** | ||
+ | Updated 18/01/07 Please check to be sure you are doing this right, c::b changed a lot since the first version of this doc - // | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | The technical jargon: | ||
+ | This is a walkthrough on the process of developing [[MIOS]] Applications primarily in C [[how_to_mix_c_and_asm|but also in ASM]] utilising the [[http:// | ||
+ | |||
+ | Please don't be put off by all that mumbo jumbo. If you're totally newbie then this document is also for you :) I've included everything you need to do, step-by-step, | ||
+ | |||
+ | I hope you find this document helpful and that you will feel free to make suggestions or criticism or corrections or any kind of modifications as you see fit :) | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ====== Install and Configure Applications ====== | ||
+ | |||
+ | ===== Sun Java J2SE ===== | ||
+ | |||
+ | Chances are you already have this... I don't recommend upgrading the existing version if you do. | ||
+ | * [[http:// | ||
+ | * Install with defaults or whatever meets your requirements. I recommend disabling automatic updates. | ||
+ | |||
+ | ===== 7zip ===== | ||
+ | |||
+ | This tool is needed to extract compressed files. If you already have winzip or winrar then you won't need this. I recommend the latest version MSI installer for ease of use. | ||
+ | * [[http:// | ||
+ | * Install the complete application using the defaults | ||
+ | |||
+ | ===== GNU PIC Utilities (GPUtils) ===== | ||
+ | |||
+ | * [[https:// | ||
+ | * Install the complete application using the ' | ||
+ | * When the installer asks you, click ' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== ActiveState ActivePerl ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * Install using defaults | ||
+ | * If you are prompted to restart your computer, then do so (yes, now... I know it's annoying!). | ||
+ | |||
+ | ===== Small Device C Compiler (SDCC) ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * Install using defaults (Note that this installs the PDF doc as well which can be very useful) | ||
+ | |||
+ | |||
+ | ===== MinGW ===== | ||
+ | MinGW contains GCC which is used to compile the simulator | ||
+ | |||
+ | * [[http:// | ||
+ | * Install, taking the ' | ||
+ | * If the installer crashes while downloading just keep repeating the above until it completes. | ||
+ | |||
+ | |||
+ | ===== GDB (GNU DeBugger) ===== | ||
+ | GDB is used to debug apps and is a must-have for MIOS development. | ||
+ | |||
+ | * [[http:// | ||
+ | * Install, taking the same default install path as MinGW (above). | ||
+ | |||
+ | |||
+ | ==== Environment Variables ==== | ||
+ | |||
+ | Normally, the necessary directories are added to you PATH environment variable during the above installations. Sometimes, they aren' | ||
+ | |||
+ | * Minimise any open windows so that you can see the desktop. | ||
+ | * Right-click on 'My Computer', | ||
+ | * Click on the ' | ||
+ | * Under either User or System variables, select the variable ' | ||
+ | * Add these entries if they don't exist (Entries should be separated by semicolons): | ||
+ | * ;C:\Program Files\ActiveState\PERL\bin\ | ||
+ | * ;C:\Program Files\SDCC\bin | ||
+ | * ;C:\Program Files\gputils\bin | ||
+ | * ; | ||
+ | |||
+ | ====== Code:: | ||
+ | |||
+ | ===== Install ===== | ||
+ | |||
+ | Full Installer package is //no longer recommended // unless you're an expert. We now need to manually install and configure [[http:// | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | ===== Code:: | ||
+ | For our purposes, CodeBlocks latest nightly build version should be installed. | ||
+ | |||
+ | * If there is an existing version then delete the share\ dir, for example C:\Program Files\CodeBlocks\share\*.* before upgrading | ||
+ | * Get link for Nightly Build from the [[http:// | ||
+ | * Unzip downloaded file to Program Directory, for example C:\Program Files\CodeBlocks\, | ||
+ | * Download a [[http:// | ||
+ | * Start Code: | ||
+ | * Code:Blocks will detect and configure installed compilers. It should find 'GNU GCC Compiler' | ||
+ | |||
+ | ===== Configure ===== | ||
+ | In order to use the [[http:// | ||
+ | |||
+ | * Select the menu ' | ||
+ | * Select ' | ||
+ | * In the box labelled ' | ||
+ | * Select the tab labelled ' | ||
+ | * From the dropdown box labelled ' | ||
+ | * Tick the box labelled ' | ||
+ | |||
+ | This should be all that is needed to have all the applications ready to go. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Project Setup ===== | ||
+ | |||
+ | Full instructions are below, but you may jump to the required section based on your requirements: | ||
+ | |||
+ | ==== Project Setup - New Application ==== | ||
+ | |||
+ | FIXME The template needs updating | ||
+ | |||
+ | If you are creating a new application, | ||
+ | |||
+ | * [[http:// | ||
+ | * Extract the contents of the zip to your user template directory. It will be C: | ||
+ | * In Code:: | ||
+ | * Select the tab labelled 'User Templates', | ||
+ | * Writing your code is up to you but once you're done, jump to the section on Compiling and Debugging for either [[# | ||
+ | |||
+ | ==== Project Setup - Existing Application or Skeleton Creation ==== | ||
+ | |||
+ | I plan to write a small application which will automatically convert a MIOS application (as downloaded from [[http:// | ||
+ | |||
+ | ==== Create Empty Project ==== | ||
+ | * Copy all files from either the [[http:// | ||
+ | * Start Code:: | ||
+ | * Open a new project (' | ||
+ | * Click ' | ||
+ | * In the box labelled ' | ||
+ | * Ensure GCC Compiler is selected | ||
+ | * If you are prompted to select a language to use, select ' | ||
+ | |||
+ | ==== Add Application files to project ==== | ||
+ | |||
+ | * The automatically created main.c needs to be deleted | ||
+ | * Select ' | ||
+ | * If you are prompted to select which build target should be used, click ' | ||
+ | |||
+ | |||
+ | ==== Configure Build Targets ==== | ||
+ | |||
+ | === AC-SIM Build Target === | ||
+ | //Skip this section if you do not need to use the simulator// | ||
+ | |||
+ | * Ensure AC-SIM files are added to the project. Follow the instructions at [[mios_c_simulator_-_debugger# | ||
+ | * Select ' | ||
+ | * Select the target ' | ||
+ | * In the box labelled ' | ||
+ | * In the box labelled ' | ||
+ | |||
+ | === MBHP Build Target === | ||
+ | //Perform the following sections to build the application for MBHP// | ||
+ | |||
+ | * Returning to ' | ||
+ | * In the box labelled ' | ||
+ | * In the box labelled ' | ||
+ | * Click ' | ||
+ | |||
+ | * Select ' | ||
+ | * Select target ' | ||
+ | * In the box labelled ' | ||
+ | * In the box labelled ' | ||
+ | * Select the ' | ||
+ | * Tick 'Use Custom Command to build this file' | ||
+ | * Type into the textbox " | ||
+ | * Click OK | ||
+ | * Click OK | ||
+ | |||
+ | |||
+ | ==== MIOS-Specific SDCC Libraries ==== | ||
+ | |||
+ | TK says: | ||
+ | If multiplications, | ||
+ | |||
+ | Linking project | ||
+ | lib/ | ||
+ | ERROR! | ||
+ | |||
+ | The common library for pic16 derivatives is not compatible to MIOS, therefore I've created a special one. [[http:// | ||
+ | |||
+ | * Download the [[http:// | ||
+ | * Create a ' | ||
+ | * Copy the ' | ||
+ | * Open the " | ||
+ | |||
+ | '' | ||
+ | FILES lib/ | ||
+ | '' | ||
+ | \\ | ||
+ | |||
+ | At this point, I highly recommend selecting ' | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | ===== AC-Sim Simulator ===== | ||
+ | |||
+ | ==== Setup ==== | ||
+ | |||
+ | Follow the instructions at [[mios_c_simulator_-_debugger|the AC-Sim WIKI page]] | ||
+ | |||
+ | ==== Compile ==== | ||
+ | |||
+ | Select the ' | ||
+ | |||
+ | ==== Debug ==== | ||
+ | |||
+ | Follow the instructions at [[mios_c_simulator_-_debugger|the AC-Sim WIKI page]] | ||
+ | |||
+ | |||
+ | ===== MBHP ===== | ||
+ | |||
+ | ==== Compile ==== | ||
+ | |||
+ | Select the ' | ||
+ | |||
+ | ==== Debug ==== | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | |||
+ | done! Make music! | ||