??? 04/21/10 14:20 Read: times |
#175220 - ABORT!, ABORT!, ABORT! Responding to: ???'s previous message |
I am using AT89S52 in a dimmer project and iam using a ZCD directly from mains without isolation. The 230V Mains hot side is connected thru a 1Meg resistor to the external interrupt pin P3.3 and neutral is connected to circuit Gnd thru another 1Meg resistor.
ABORT!, ABORT!, ABORT! ANYTHING directly connected to the mains is DANGEROUS. The 1M resistors are NOT 'isolation' and if you against advice go ahead with this DANGEROUS scheme make sure you get high voltge resistors. INSTEAD tap the AC from the secondary of your power supply transformer. I got this from an AVR application note and thought i could use this on 8051 which too has internal clamp diodes on I/o pins. that something is in a appnote is no guarantee it is good. The above setup results in a square wave on ext.int pin, now the problem is normal 8051/2 like 89S52 can be configured to respond to falling edge of a signal and not to rising edge. how can I cause interrupt on both the edges of the square wave signal ? possibilities: a) drive int 0 directly and int1 through an inverter b) use a 'continuously adjusted' timer to create the other interrupt c) switch to e.g. a SILabs chip and use a comparator interrupt which has interrupts on both edges Erik |