Arduino Due - Accessing registers and inline assembly

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.

The_YongGrand:
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: Extended Asm - Using the GNU Compiler Collection (GCC).

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.

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