Pages: [1]   Go Down
Author Topic: Arduino Due - Accessing registers and inline assembly  (Read 2148 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1836
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

NZ
Offline Offline
Jr. Member
**
Karma: 1
Posts: 91
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
God Member
*****
Karma: 32
Posts: 507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://arduino.cc/forum/index.php/topic,130742.msg1006494.html#msg1006494
Logged


Pages: [1]   Go Up
Jump to: