The Duet has no knowledge of the microstep setting of your external driver, and RepRapFirmware ignores M350 settings for external drivers. The microstepping will be whatever you have set the external drivers to using the switches on it.
Do not connect any of the output pins of the expansion board to ground. They are all differential outputs, so doing so may burn out the driver chips on the expansion board. Instead, connect GND on the G540 to GND on the Duet, or to GND on one of the servo output connectors on the expansion board.