A 502 error is typically returned by the Microsoft Exchange server when the server does not like the way the user is trying to connect. A 502 error can happen ONLY if you are connecting in Microsoft Exchange 2003 mode.
Here are a few suggestions to help:
If yes to above, running Quick Configuration normally resolves this error.
To find Quick Configuration,
If you are unable to connect in ActiveSync mode, sometimes just running Quick Configuration is enough to clear up the timeout error. Simply run the wizard again, choosing either Exchange 2007 or 2003 mode.