I am setting up an Parallel EEPROM programmer, and it will be very useful to have more performance:
https://forum.arduino.cc/t/eeprom-programmer-arduino-due-sd-card-tsop48/850172/2
I found this other post that talks a little about direct port access:
https://forum.arduino.cc/t/arduino-due-how-to-direrct-port-access/251656/11
As I did not find an example of use, follow this basic example of writing and reading, with pin B.27 which is D13, or LED13:
void setup() {
// put your setup code here, to run once:
// pinMode(13, OUTPUT);
PIOB->PIO_PER |= 0x8000000; // Configure PORTB to PIO controller, pin 27
PIOB->PIO_OER |= 0x8000000; // Enable PORTB(27) to output ....
}
void loop() {
// put your main code here, to run repeatedly:
// // digitalWrite(13, HIGH);
// PIOB->PIO_ODSR = 0x8000000; // Write something on pins 33-40.
//
// delay(500);
//
// // digitalWrite(13, LOW);
// PIOB->PIO_ODSR = 0x00; // Write something on pins 33-40.
//
// delay(500);
// digitalWrite(13, !digitalRead(13));
PIOB->PIO_ODSR ^= 0x8000000;
delay(500);
}
P.S.: I found code with interesting implementations, in case someone is looking for it: