Error Crossing page boundary

  • Nezs

    Nezs - 2008-06-18


    I'm pretty new to C and PIC programming and this may sound a bit silly but i dont know how to link several .c files for organizing the code page and RAM banks. The manual for SDCC explains briefly but i dont really know how to do it. I tried searching for linking in the web but the results refers to linking object files, lkr, etc.

    Can someone help me or link me an example please?

    Thank you

    • rudolf

      rudolf - 2008-06-18

      Hi Nezs

      here is an example, how I do it to generate file2.hex:

      $ sdcc -mpic14 -p16f628  --opt-code-size -c file1.c
      $ sdcc -mpic14 -p16f628  --opt-code-size -c file2.c

      $ sdcc -L /usr/local/share/sdcc/lib/pic -mpic14 -p16f628 file2.c file1.o

      header of file2.c:

      /* Define processor and include header file. */
      #define __16f628
      #define clock_speed  16000000

      /* Setup chip configuration */
      typedef unsigned int config;
      config at 0x2007 __CONFIG = _CP_OFF &
                                  _WDT_ON &
                                  _BODEN_OFF &
                                  _PWRTE_OFF &
                                  _ER_OSC_CLKOUT &
                                  _MCLRE_OFF &
                                  _LVP_OFF &


      header of file1.c:
      #define __16f628

      good luck,

      • Nezs

        Nezs - 2008-06-19

        Hi rudolf,

        Thanks for the code sample. I really appreciate your help.
        I will try it out and hopefully, be able to solve any problems that i face :)
        Thanks again!


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks