User Tools

Site Tools


c_tips_and_tricks_for_pic_programming

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
c_tips_and_tricks_for_pic_programming [2008/04/05 21:03]
stryd_one Added info for the gpasm toolchain
c_tips_and_tricks_for_pic_programming [2008/05/02 16:40]
stryd_one Updated
Line 15: Line 15:
 \\ \\
 \\ \\
 +
 ==== MIOS LIBSDCC Library ==== ==== MIOS LIBSDCC Library ====
  
-If that still is not enough or you have no time and a lot of processing power / space available on your PIC, you can include the **libsdcc library**:  +If that still is not enough or you have no time and a lot of processing power / space available on your PIC, you can include the **libsdcc library**. ​Using the new MIOS GPUtils structurethis will be included automatically as required
-\\ +
-If multiplications,​ divisions, pointer operations, etcare used in the .c code, the linker may fail due to missing functions, which are part of the libsdcc.lib library. The common library for pic16 derivatives is not compatible to MIOS, therefore I've created a special one which can be downloaded from [[http://​www.ucapps.de/​mios/​mios_libsdcc_v2_5_0.zip|here]]. Read the README.txt file for further details. [[http://​www.ucapps.de/​mios_c.html|TK on the C-Page]] // +
-You Should specify your custom linker script in the makefile if using the new gpasm based mios toolchain+
-\\+
 When using the library, sometimes the compiler will optimise multiplications to bitshifts (as demonstrated above) automatically. You can check the output files to see if this has occurred, but it is recommended to code the bitshifts manually, to be sure. When using the library, sometimes the compiler will optimise multiplications to bitshifts (as demonstrated above) automatically. You can check the output files to see if this has occurred, but it is recommended to code the bitshifts manually, to be sure.
  
Line 27: Line 25:
 \\ \\
  
-====== Bitfields, Unions & Structs ​======+==== Bitfields, Unions & Structs ====
  
   * Avoid using huge int- or char-arrays when you just need to store some ON/OFF values. Use a bitfield instead   * Avoid using huge int- or char-arrays when you just need to store some ON/OFF values. Use a bitfield instead
Line 59: Line 57:
  
 \\ \\
 +
 ====== C Functions ====== ====== C Functions ======
  
c_tips_and_tricks_for_pic_programming.txt · Last modified: 2011/09/15 07:14 by ichaljhe