Connect with us

PIC12F675 Zero crossing

Discussion in 'Electronic Basics' started by Bandu, Mar 14, 2007.

Scroll to continue with content
  1. Bandu

    Bandu Guest


    Which interrupt pin is the best to use zero-crossing interrupt for
    PIC12F675? Can i use any pin with Interrupt on Change (IOC) ?
    Most of the application notes for other PIC they use RB0.
    any suggestion please?

    and what would be the best value of resister to put in for zero-
    crossing detection GPIO pin?

    And what would be the best delay time to measure AC sine wave after
    zero crossing to get best RMS value? 2ms?


  2. I guess you could, but there are quirks in the way that IOC works on most
    PICs. If you are running (not sleeping), you can miss changes if a changes.
    See the datasheet.
    It's my favorite way to trigger a PIC. :) It has a Schmitt trigger so
    that's usually helpful. It always works right.
    I suppose that would depend upon the voltage you are monitoring, you're not
    thinking of connecting a pin straight to AC mains are you? I don't mean to
    be rude, but if you are asking about this then maybe you shouldn't be doing
    it. It's dangerous, it can kill you, yada yada yada.
    I guess you _are_ talking about AC mains. You probably need to determine
    this empirically with an oscilloscope to see where the PIC actually
    triggers. I would expect that variations are likely to occur between
    individual PICs, but probably nothing all that significant since the voltage
    rise is so steep at 120V or 240V (depending upon where you live). Be
    careful. If you really want to live on the edge, Microchip has an ap note
    showing how to do this. IIRC, they also power the PIC from the AC using a
    dropping capacitor, might have been a resistor though. Like I said, be
    careful, you CAN be killed. I'm sure Phil will be along shortly to warn you
    in his own special way.
  3. Bandu

    Bandu Guest

    Thanks Anthony,
    I really appretiate your warning. I'm trying to trigger directly from
    AC mains.
    I understand the consequences of electrocuting myself. :)

    Do you think i can use GP2 interrupt? I'm trying to built an
    application that trigger when AC voltage fall into some level.
    i'm using AC 240V. I detect it using GP5 for zero crossing and i use
    resistor dividor to lower down AC...feed it to ADC...
    it work fine... i read it after 2ms of ZeroX..but its look like
    unreliable...sometimes it reading wrong value... i'm quite sure ADC
    reading is fine but trigger might not be that accurate for
    reading....instead of IOC can I use GP2 interrupt? which is better? i
    want to use 12F675 becoz its 8-DIP and so cheap.
    The other things is Oscilloscope are so expensive for me... so i'm
    doing it trial and error using my old multimeter... :(
    I don't need that too accuracy on read that volt ±2VAC would b
    fine ... but i want to read it reliably... so i can set a trigger
    point on a voltage...


Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day