Hello Peter et all, > > I was using just a diode from VCC to MCLR on the PIC (a PIC16F877). Now > >I'm using just a 4K7 resistor in place of the diode. Things seens to be > >better now, but the PIC still reset sometimes. > > Connect MCLR directly to Vcc (use a jumper if you use ICSP) and put a 5V6 > zener across Vdd and Vcc directly at the chip. Put series resistors on ALL > wires entering and leaving the board if they haven't already. I've made some tests and found some interesting things. I was using a fluorescent lamp/ballast to create EMI discharges and emulate the client situation. As you can guess there was a lot of resets and lockups. It seens the EMI is being picked by the ICSP connector and ESD was building up on the MCLR pin. As there's no path to GND or to VDD (because there's only a diode from VDD to MCLR) this probably put the PIC on programming mode and forced a reset or something like that. Removing the ICSP connector (still with the diode) there was substantially less resets/lockups. Replacing the diode for a wire (just short or jumper) there was never a reset. I've tried using a 10K resistor in place of the jumper and with ICSP connector. I can have no lockups. It seens in the client there was still some resets/lockups even with a 4K7 resistor between VDD and MCLR. Well, that was one problem... The other problem was the stupid "floating input pin" thing. I foresee a serial comm on the board and programmed the RC6 and RC7 pins as inputs, but haven't enabled USART nor put the buffer/etc on the board... argh. Now I've placed two 10K resistors to shut those pins to GND. I will put these "upgraded" boards on the client devices and I'll see if this works. In the meanwhile I'll implement some other things like watchdog/etc on the software. In the next board I'll use the Roman idea of the RC current limiting on the solenoid. Thank you all for your input, Brusque ----------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil Say NO to HTML mail www.citronics.com.br ----------------------------------------------------------------- -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu