Hola Baltasar. Not sure but I think is a SPI issue.
According to DUO variant.h, SS pin is 77. I think you are playing with MEGA pins SCK(52) and SS(53). Try 77 and see.
Here SPI DUO MEGA for comparison:
-
DUE Board pin | PORT |
-
74 MISO | PA25 |
-
75 MOSI | PA26 |
-
76 SCLK | PA27 |
-
77 NPCS0 | PA28 |
-
MEGA Board pin | PORT |
-
50 MISO | PB3 |
-
51 MOSI | PB2 |
-
52 SCK | PB1 |
-
53 SS | PB0 |