Make Sure Digital pin is high before Serial.write()
The MAX485 requires 2V on the DE pin to register a HIGH. It takes no more than an absolute maximum of 50ns for the DE pin to switch the buffers. The Arduino takes 10.4ns for an IO pin to rise to 2V.

That's an absolute maximum of 60.4ns.

One clock cycle of a 16MHz Arduino is 63ns.

That is longer than it takes for the IO pin to tell the MAX485 to switch the buffers.

You can increase that rise time by taking in to account the input capacitance of the MAX485 and the resistance of the connection between the Arduino and the DE pin, but it will still be microscopically small compared to the time between the pin going HIGH and the serial transmission starting.

So there must be something fundamentally wrong with your setup.  Two possibilities spring to mind:


You aren't controlling RE, only DE, so RE is floating and is being capacitively linked to DE through the parasitic capacitances of the board and circuitry, making it rise and fall very slowly.
You haven't set the IO pin on the Arduino to OUTPUT, so it switches between floating and HIGH through a very high resistance, causing slow rise to HIGH and maybe never getting to LOW at all.


Or a combination of the two.