Which registers are equivalent to "PIN(A/B/D...)" when Using Arduino DUE

Hello guys.

Recently a stacked in a code that I wrote for the Arduino DUE,

First, I precise the type of variable that I want to use as following :

short i=B00000000;
short b=B00000000;

and than, later in my code I wrote the following :

i = PIND;
b = (i & B0000000000001111);

but when I verify my code, it send me an error message, saying :


'PIND' was not declared in this scope


exit status 1
'PIND' was not declared in this scope

ERROR.png

I don't know, because I don't have a Due, but you should have the source of the digitalRead and digitalWrite functions in your installation for the ARM processor, probably in "wiring_digital.c".
From that, you should be able to figure out the port mapping.

The IDE knows the meaning of PIND well for AVR MCU and not for the SAM3X8E MCU. Please, consult
Arduino Due Section.

The programming of SAM3X8E is mostly done using ASF (Atmel Software Framework) style -- a cryptic language structure. However, TWI Bus programming can be done using Wire.h library as is done for the AVR.

GolamMostafa:
However, TWI Bus programming can be done using Wire.h library as is done for the AVR.

Have I missed something?
Did the OP ask about I2C?

@CtrlAltElite

No.

No.

GolamMostafa:
@CtrlAltElite

No.

No.

So why mention it?

So why mention it?

Have I mentioned I2C?

GolamMostafa:
Have I mentioned I2C?

No, but you mentioned TWI and Wire.h.

You do know what I2C and TWI are, don't you?

But, you have asked about I2C and not about TWI Bus and Wire.h; correct?

I'm forming an opinion about you, GM, and it's one I probably ought not to express here.

As long as ART remains unexpressed, it is beautiful!

GolamMostafa:
As long as ART remains unexpressed, it is beautiful!

Now the opinion is fully formed.
We're done now.

Except the OP!

GolamMostafa:
Except the OP!

See my first reply on this thread.

I am now turned to done from undone.