> > opto for the inter-ticket holes which the PIC used for counting > > I noticed the motor is used in one direction only but has no > flyback diode around it. This may have been part of what > was causing your glitches. The 100nF caps slow down and > reduce the peak voltage of the flyback pulse, but I think the > transistor is still taking a beating I couldn't swear to the fact there was no flyback diode. The dispenser was a ready-made module and I made the best notes I could without dismantling it. Aside from that though, the carnival game this was part of was a rifle range using flash tubes in the guns. A trigger-operated circuit dumped 450VDC into the flash tubes, which caused quite an electronic ruckus. So even if the motor had been clean, the micro still needed protecting -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads