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/05/16 04:49] – stryd_one | stryd_one_codeblocks [2007/10/05 23:29] (current) – stryd_one | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Update: IT WORKS! YAY! | + | :!: :!: :!: :!: :!: |
- | Stay tuned for the template file and updates to this doco :) | + | ====== This document has been superseded and is kept for archival purposes only!!! Please see the new version! ====== |
- | Hi All, | + | * 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:: | ||
+ | \\ | ||
+ | :!: :!: :!: :!: :!: | ||
- | This is a walkthrough on developing new apps. | ||
- | I'll be working on Windows XP in C with Code:: | + | ====== Developing MIOS Applications |
+ | **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 - // | ||
+ | \\ | ||
+ | \\ | ||
- | Install&configure apps | + | 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:// | ||
- | sun java j2se | + | 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, |
- | http://www.java.com/ | + | |
- | default install | + | |
+ | 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 :) | ||
- | https:// | + | \\ |
+ | \\ | ||
- | gputils-win32 | + | ====== Install and Configure Applications ====== |
- | defaults (complete) | + | |
- | yes add to path | + | |
- | http:// | + | ===== Sun Java J2SE ===== |
- | Defaults, changed path to c:\program files\activestate\perl | + | Chances are you already have this... I don't recommend upgrading the existing version if you do. |
- | restart | + | * [[http:// |
+ | * Install with defaults or whatever meets your requirements. I recommend disabling automatic updates. | ||
- | http:// | + | ===== 7zip ===== |
- | sdcc | + | |
- | default install | + | |
- | Ensure paths are in your environment variables | + | This tool is needed to extract compressed files. If you already have winzip or winrar then you won' |
- | my computer right click properties advanced environment | + | * [[http:// |
- | add these entries if they don' | + | * Install the complete application using the defaults |
- | ;C:\Program Files\ActiveState\PERL\bin\ | + | ===== GNU PIC Utilities (GPUtils) ===== |
- | ;C:\Program Files\SDCC\bin | + | |
- | ;C:\Program Files\gputils\bin | + | |
+ | * [[https:// | ||
+ | * Install the complete application using the ' | ||
+ | * When the installer asks you, click ' | ||
- | http:// | ||
- | download full installer, use defaults | ||
- | Codeblocks nightly - RC2 no good... | ||
- | gets links from forum http:// | ||
- | delete share dir eg C:\Program Files\CodeBlocks\share | ||
- | unzip file, copy to program dir eg C:\Program Files\CodeBlocks\ and overwrite | ||
- | wxwidgets dll | ||
- | http:// | ||
- | start from skeleton | + | ===== ActiveState ActivePerl ===== |
- | new project | + | * [[http:// |
- | tick 'show file-based templates' | + | * Install using defaults |
- | click SDCC Application | + | * If you are prompted |
- | choose directory with skeleton app | + | |
- | in ' | + | |
- | OK | + | |
- | Yes to messages stating that the directory already exists | + | |
- | Project... Add Files, Select All, Click Add | + | |
- | Project... Properties, Targets tab, Click Add, Name ' | + | |
- | Type = Commands Only | + | |
- | Tick main.c | + | |
- | Project... Properties, Targets tab, Click Add, Name 'MB-ACSim' OK | + | |
- | Type = Console Application | + | |
- | Tick debug.c | + | |
- | OK to close project properties | + | |
- | Project... Properties | + | |
- | select target ' | + | |
- | select target ' | + | |
- | selected compiler dropdown list select 'SDCC Compiler', | + | |
- | Select file main.c, click Selected File Properties | + | |
- | Advanced Tab, Custom Build Box, For this compiler select | + | |
- | Tick 'Use Custom Command to build this file' | + | |
- | type make.bat | + | |
- | OK | + | |
+ | ===== Small Device C Compiler (SDCC) ===== | ||
- | http://www.ucapps.de/mios/mios_libsdcc_v2_5_0.zip | + | * [[http://sourceforge.net/ |
- | o create a ' | + | * Install using defaults (Note that this installs |
- | o copy the 'libsdcc.lib' file into this directory | + | |
- | o open the " | + | |
- | line below the " | + | |
- | '' | ||
- | FILES lib/ | ||
- | '' | ||
+ | ===== MinGW ===== | ||
+ | MinGW contains GCC which is used to compile the simulator | ||
- | http://www.midibox.org/dokuwiki/doku.php?id=mios_c_simulator_-_debugger\\ | + | * [[http:// |
- | edit application (skeleton) main.c\\ | + | * Install, taking the ' |
- | replace\\ | + | * If the installer crashes while downloading just keep repeating the above until it completes. |
- | '' | + | |
- | include | + | |
+ | ===== 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://www.gnu.org/software/gdb/|GDB (GNU DeBugger)]] and [[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:\Documents and Settings\<your username> | ||
+ | * 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 | ||
+ | * Select ' | ||
+ | * If you are prompted to select which build target should be used, click 'Select All' | ||
+ | |||
+ | |||
+ | ==== 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/ | ||
+ | '' | ||
\\ | \\ | ||
- | with\\ | ||
- | ''# | ||
- | #include " | ||
- | #include " | ||
- | # | ||
- | replace in all files | + | At this point, I highly recommend selecting ' |
- | #import <carbon\carbon.h> | + | \\ |
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
- | with | + | ===== AC-Sim Simulator ===== |
- | #import < | + | ==== Setup ==== |
+ | Follow the instructions at [[mios_c_simulator_-_debugger|the AC-Sim WIKI page]] | ||
+ | ==== Compile ==== | ||
- | debug (simulated) | + | Select the ' |
- | upload | + | ==== Debug ==== |
- | debug (core) | + | Follow the instructions at [[mios_c_simulator_-_debugger|the AC-Sim WIKI page]] |
- | http:// | ||
+ | ===== MBHP ===== | ||
+ | |||
+ | ==== Compile ==== | ||
+ | |||
+ | Select the ' | ||
+ | |||
+ | ==== Debug ==== | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
done! Make music! | done! Make music! | ||
stryd_one_codeblocks.txt · Last modified: 2007/10/05 23:29 by stryd_one