Go Down

Topic: Arduino Due - Accessing registers and inline assembly (Read 2868 times) previous topic - next topic

Hello there,

As I've experimented with a lot of Microchip's PIC32 and some TI Stellaris, I've grown familiar with dealing with the registers instead of depending on the libraries. (Except the Microchip's MDDFS ones which are quite complicated)

Is it possible to access the registers such as I/O, DMA and such in the Arduino IDE, like other compilers I usually work with?

Plus, is it also possible to use inline assembly in the Arduino Due? There are the Cortex-M3 instructions such as saturate which I cannot describe them without spending a few lines in high level language.

Thanks. 

MichaelMeissner


Hello there,

As I've experimented with a lot of Microchip's PIC32 and some TI Stellaris, I've grown familiar with dealing with the registers instead of depending on the libraries. (Except the Microchip's MDDFS ones which are quite complicated)

Is it possible to access the registers such as I/O, DMA and such in the Arduino IDE, like other compilers I usually work with?

Plus, is it also possible to use inline assembly in the Arduino Due? There are the Cortex-M3 instructions such as saturate which I cannot describe them without spending a few lines in high level language.

Thanks. 

Sure, since Due uses GCC, you use the GCC syntax for this: http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Extended-Asm.html#Extended-Asm.

fiddler

I suggest using something like Ken Smith's paper is describing:

"C++ Hardware Register Access Redux"

Its a policy based design using function templates and once setup has clarity and safety.


stimmer

If you look at my VGA project here it has examples of both direct register access and inline assembly :)

http://arduino.cc/forum/index.php/topic,130742.msg1006494.html#msg1006494
Due VGA library - http://arduino.cc/forum/index.php/topic,150517.0.html

Go Up