Searching \ for '[PIC]: Zero Crossing Detector' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Zero Crossing Detector'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Zero Crossing Detector'
2001\11\06@111521 by David Dunn

flavicon
face
I'm sure in my surfing i've seen that you can do a zero crossing detector on a pic, possibly with PB0 ? I'm using a 16F877.

Anybody have links on how to set this up ?


Thanks,

DLD

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\11\06@112311 by Douglas Butler

flavicon
face
I would start with Microchip's application note AN521.  It mostly covers
hardware issues.

Sherpa Doug

> {Original Message removed}

2001\11\06@113659 by David Dunn

flavicon
face
this helps a bit, but i already have the hardware side figured out, it's not AC LINE that i need zero crossing detection, i have a signal that
i've filtered down to under 5v pp i need to detect zero crossing on.

what i'm not quite figuring out is if a pic pin shows high at around 1.8v (i think that's what it is) how is is that you can detect a zero
crossing ?

thanks !

dld

On Tue, 6 Nov 2001 11:20:30 -0500, Douglas Butler wrote:

>I would start with Microchip's application note AN521.  It mostly covers
>hardware issues.
>
>Sherpa Doug
>
>> {Original Message removed}

2001\11\06@114910 by Douglas Butler

flavicon
face
I think in AN521 they assume that 1.8V is close enough to 0v for a 120V
sine wave.  For a low level zero crossing you will probably need a
comparator.  If you just have 0V & 5V supplies you can AC couple the
signal to a level within your range.  Some PICs have built in
comparators but the 877 is not one of them.

How much accuracy do you need? (time & voltage)

Sherpa Doug

> {Original Message removed}

2001\11\06@123043 by Harold M Hallikainen

picon face
       Yes, you can do it with the RB0/INT pin. I did this on the DM406 at
http://www.dovesystems.com . Here we add a second pair of diodes on the
secondary of the power transformer (the first pair of diodes are doing a
full wave rectification with the center tap of the transformer secondary
grounded). The two cathodes of this second pair of diodes are tied
together with a pull-down resistor to ground. Then a current limit
resistor to the RB0 pin. Set that pin to generate an interrupt on a
negative edge. It will interrupt a little before the zero crossing.
       Be careful with internal pull-ups on port B, as the current limit
resistor and the pull-down have to be small enough to pull the pin down.
I'd now probably turn off internal pull-ups and use an external pull-up
on pins that needed one (not the INT pin). It'd be nice if Microchip made
the internal pull-up be driven by the output latch so it could be enabled
pin by pin.
       Once the zero cross generates an interrupt, we reset a timer and use the
capture/compare register to generate another interrupt to turn on triacs
at the appropriate time.

Harold


On Tue, 6 Nov 2001 10:14:32 -0600 David Dunn <.....ddunnKILLspamspam@spam@TCAINTERNET.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\11\06@123049 by Harold M Hallikainen
picon face
On Tue, 6 Nov 2001 10:35:20 -0600 David Dunn <EraseMEddunnspam_OUTspamTakeThisOuTTCAINTERNET.COM>
writes:
> this helps a bit, but i already have the hardware side figured out,
> it's not AC LINE that i need zero crossing detection, i have a
> signal that
> i've filtered down to under 5v pp i need to detect zero crossing on.
>
> what i'm not quite figuring out is if a pic pin shows high at around
> 1.8v (i think that's what it is) how is is that you can detect a
> zero
> crossing ?
>
> thanks !
>

       When you say zero cross detect, everyone thinks AC line and dimmers!  As
I recall, when used as an INT input, the pin has a schmitt trigger input
with a Vil of about 0.2Vdd or 1V (looking at my 18c452 datasheet, but
they're all similar). You COULD drive this with an external comparator to
detect zero cross. A bit less accurate, and with a lower input
resistance, you could put the INT pin at the center of a voltage divider
with the high side of the divider going to +5V and the low side going to
your 5Vpp signal. Instead of working the voltage divider formula
backwards, I go back to Ohm's law. Let's use, say, 10K for the resistor
to +5V. The current through this resistor is (+5V-1V)/10K = 400uA. We'll
have the same current through the bottom resistor, and the bottom of the
bottom resistor is at 0V. So R=V/I = 1V/400uA = 2.5k .
       When the bottom of the bottom resistor is at 0V, the INT input will be
at 1V, causing the interrupt IF the input is going low. Note that this
would only detect Negative zero crossings. Positive zero crossings would
require the PIC be set to detect positive zero crossings AND require an
input threshold of 0.8Vdd.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...