Why not go all the way get rid of the bridge rectifier and put your program in the main loop peter@cousens.her.forthnet.gr -------------------------------------------------------------------------------- -- -------------------------------------------------------------------------------- -- Andy Kunz wrote: > You can operate a PIC by providing power through I/O pins. And if you make > your program smart enough, you can even do better. Consider, for example, > the following: > > On an 18-pin PIC, connect /MCLR to Vcc, leave GND unconnected (or tied to > your circuit). Pins 9 and 10 will be our NON-POLARIZED power pins (either > pin can go either way). > > PWR_A equ PORTB.3 ; Pic a pin, any pin... > PWB_B equ PORTB.4 > > org 0 > bsf RP0 > movlw 255 > movwf TRISB > bcf RP0 > > btfss PWR_A ; Is PWR_A pin high? > goto A_GND ; No, it's ground > btfsc PWR_B ; Is PWR_B pin high? > goto 0 ; No, something's wrong - power on different pins > > B_GND > bsf PWR_A ; Connect A pin to + supply > bcf PWR_B ; Connect B pin to GND supply > goto SET_POWER > A_GND > bcf PWR_A ; Connect A pin to GND supply > bsf PWR_B ; Connect B pin to + supply > SET_POWER > movlw 11100111b ; Turn these pins to outputs > movwf TRISB > > Loop goto Loop ; Put your program here > > Maybe Mchip doesn't recommend it, but with the lower power it takes to run > a PIC and the high current ratings on the pins, it DOES work just fine. > > Go ahead, try it! > > Andy > > ================================================================== > Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865 > Hardware & Software for Industry & R/C Hobbies > "Go fast, turn right, and keep the wet side down!" > ==================================================================