Community
cancel
Showing results for 
Search instead for 
Did you mean: 
TKham
Beginner
987 Views

Interrupt and PWM on Galileo

Jump to solution

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.

0 Kudos
1 Solution
Erik_N_Intel
Employee
72 Views

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.</strong>

View solution in original post

1 Reply
Erik_N_Intel
Employee
73 Views

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.</strong>

View solution in original post

Reply