A loose or corroded ground terminal on the driver's side of the cylinder head can cause a rough idle, misfires, and there may be trouble codes. Restore the ground to the cylinder head.Google+
Car Problem Reports
Mazda Protege Idles Rough, Misfires, and Possible Check Engine Light
Mazda Protege Problem
Engines Affected: 1.6L 4 Cylinder, 1.8L 4 Cylinder
Average Mileage: 150,250 mi (60,000 mi - 243,000 mi)
Visitor, 1990 Mazda Protege, 1.8L 4 Cylinder, 60,000 mi
Idles Rough, Misfires, and Possible Check Engine Light.
Visitor, 1993 Mazda Protege, 1.8L 4 Cylinder, 170,000 mi
Idles Rough, Misfires, and check Engine Light gas out tail pipe ...bad smell
Visitor, 2000 Mazda Protege, 1.6L 4 Cylinder, 243,000 mi
Car has rough Idol and often stalls when stopped. Haven't fixed yet but this sounds like a possible solution.