3 Replies Latest reply on Sep 8, 2014 10:45 AM by KellyLewis

    Two Questions in Porting Project from Arduino

    KellyLewis

      Greetings everyone.

       

      I am looking for two answers that will help me port my code from Arduino developments to Galileo (1 or 2).   I have already taken care of most of the port, so these questions come at the end of a lot of digging.

       

      1.  What is the structure of the memory?  Partially, I need to know when a variable is created on the stack/heap or if it is a global variable ( in .bss ). 

       

      In the Arduino AVR tool chain, the interesting system variable is "extern int __heap_start".  (Memory is organized as BSS -- HEAP -- STACK)

      In the Arduino SAM tool chain, the interesting system variable is "extern int  _end".  (meaning the end of .bss and Memory is organized as BSS -- HEAP -- STACK)

       

      What is there to look for in this x86 toolchain.  What is the structure.

       

       

      2.  I2C bus Speed.   In the Arduino AVR, there is a register I modify to change the bus speed.  In the Arduino SAM, they have a method in the wire library that I can call to set the speed.

       

      I need to know how to change the speed here.  My application depends on this.  I have looked at the Arduino abstraction layer and I see "i2c.c" and the file operations required to make changes / setting up the class (IOCTL)   But there is no information that I could find on the bus speed.   I need more information. 

       

      Thanks in advance for your help.

        • 1. Re: Two Questions in Porting Project from Arduino
          JPMontero_Intel

          Hi KellyLewis

           

          For the memory check the Intel® Quark SoC X1000 Datasheet https://communities.intel.com/docs/DOC-23092 in section 6. I think 6.1.1.3 might interest you. Regarding I2C there are you speeds you can set, Standard (100Kb/s) and Fast(400Kb/s), both of them are controlled by the control register IC_CON (section 19.5.1.1), more information on this can be found also in the Quark datasheet section 19.5. Please let me know if this is what you are looking for.

           

          Regards,
          JPMontero_Intel

          1 of 1 people found this helpful
          • 2. Re: Two Questions in Porting Project from Arduino
            KellyLewis

            This is the the detail that I need to make the determinations I need. 

             

            I will investigate in more detail and let you know the specifics.

             

            Thanks

            • 3. Re: Two Questions in Porting Project from Arduino
              KellyLewis

              After a bit of research, this is what I came up with.

               

              1.  Identical to the Arduino 1.5.7 Beta setup, "extern int  _end" is a variable that the laungague provides to identify the end of the .BSS section.  .BSS is also below STACK and HEAP sections.  All good here.

               

              2.  The Galileo does not permit any other I2C bus speeds than 100K or 400K.  So anyone creating a soft-I2C, make sure to bench your responsiveness.  A small MCU will have difficulties being able to process clock and data interrupts fast enough.  I changed my project to get speeds of 100K.  Now we are good.

               

              Thanks JPMontero.

              1 of 1 people found this helpful