Reading two digital Pins at the same time

From Sam3x datasheet page 624:

31.5.8 Inputs

The level on each I/O line can be read through PIO_PDSR (Pin Data Status Register). This register indicates the level of the I/O lines regardless of their configuration, whether uniquely as an input or driven by the PIO controller or driven by a peripheral.

Reading the I/O line levels requires the clock of the PIO controller to be enabled, otherwise PIO_PDSR reads the levels present on the I/O line at the time the clock was disabled.

Connect pull down resistors to Pin 44=PC19 and PIn 46=PC17, and try this code :

void setup() {
  Serial.begin(250000);
  /*
    Pin 44 = PC19
    Pin 46 = PC17
  */
  PMC->PMC_PCER0 = PMC_PCER0_PID13;   // PIOC power ON
}

void loop() {
 
  uint32_t status = PIOC->PIO_PDSR;
  boolean statusPin44 = status & (1 << 19);
  boolean statusPin46 = status & (1 << 17);
  Serial.print("status Pin44 = "); Serial.println(statusPin44);
  Serial.print("status Pin46 = "); Serial.println(statusPin46);
  delay(1000);
}