Longstanding and uncontrolled Diabetes can cause Erectile Dysfunction. Before you take medication for ED, you need to control your blood sugar. There are medicines available for ED but they have to be taken under medical supervision. You can consult Psychiatrist, Physician or your family doctor for the prescription and possible side effects.