I made a simple counter with a pic16F84. The circuit is: RB4 : first counter input RB5 : second counter input RB0,1,2,3,6,7 : not connected RA0,1,2,3 : not connected RA3 : pull-up resistor to Vcc (10K) Osc1,Osc2 : 4 Mhz resonator MCLR# : Reset circuit with 100nF, 10K and 1N4148 (as Microchip datasheet) plus a serial 1N4148 for in-circuit serial programming. The input counter are normally high (5V) and drive from external circuit. RA3 is used for serial print but normally not connected during normal operation (the printer is connected only during printing). All pin are programmed as input pin (RA3 as output when print). The circuit is mount inside a machine that provide power (is used a switching feed) and counter signal (the main board is a microprocessing board). All circuit are mounted in a box with a keyboard and monitor. The machine must pass a test with a high voltage discharge on the front panel. The discharge is generated with a electrical ignite gas (normally used to light a ring). The circuit seems to work fine but at the first discharge the pic is reset (not a really problem) and after some seconds it become hot (it seems to be a short circuit somewhere but where???) and after 20 seconds it break. To avoid Pic break I must turn off the machine quickly. Where is the error? Someone have a idea? TIA Giorgio. =================================================== Alboni Giorgio Faenza (Ra) ITALY E-Mail: rac1337@racine.ravenna.it ICQ# 24774821 http://www.geocities.com/SiliconValley/Heights/5444 (Last Update: 15/03/1998) ===================================================