1 Reply Latest reply on Dec 14, 2013 10:55 AM by arduino_4_life

    Interrupt and PWM on Galileo

    Numkang

      I have been working on my multirotor with UNO and MEGA.

       

      These Atmel boards can set interrupt directly by

      PCICR |= _BV(.... and PCMSK0 |= _BV(....

      and driven interrupt by ISR (PCINT0_vect){...}

       

      and use PWM by TCCRnX |= _BV(... , OCRnX = ...

       

      I wonder whether Galileo can do the same things by changing "PCICR" or "TCCRnX" to the other names.

        • 1. Re: Interrupt and PWM on Galileo
          arduino_4_life

          The short answer is no.

           

          The UNO and the MEGA both use atmel microprocessors, and there is no OS running on them (bare-metal), apart from the 'OS' you write yourself in the Arduino IDE. You can directly manipulate low-level registers, if you want to.

          Galileo uses a full x86 system-on-a-chip, which runs Linux. Your arduino sketch runs as a userspace program on top of Linux, and from userspace you don't have direct access to anything as low-level as setting individual bits in hardware control registers.

           

          So, the solution is not an easy search-and-replace job. However if you know what this code is doing then you should be able to replicate its functionality without all of the AVR-specific parts.

          For example, _BV() is an AVR macro so that will have to go.

          google search reveals that _BV(x) is equivalent to 1<<x.