My check engine light came on and speedometer stopped working?

Nope, bet it was the other way around... Your speedometer stopped working and your check engine light came on. A broken speedometer (don't know what car so I can't pinpoint it) will cause a whole bunch of codes.