interrupt the 240ac power line by using the pin rb0/int(zero crossing detector) of pi


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by texas5 View Post
    thanx.actually,u has help me a lot.one more thing...can i compile the coding using microcode studio basic pro???
    What 'coding'?

  2. #2
    Join Date
    Aug 2008
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    nothing.sory.hehe.i've tested my hardware today.it's work man.thanx to you.i modify the above code into:

    DEFINE OSC 8
    TRISA.1=0
    TRISA.2=0

    MAIN:

    INTCON.4 = 1 ;enable RB0/INT interrupts
    INTCON.7 = 1 ;enable all un-masked interrupts

    if INTCON.1 = 1 Then ;RB0/INT interrupts occured
    goto EDGE
    ENDIF

    EDGE:

    IF OPTION_REG.6=1 then ;interrupt on rising edge
    LOW PORTA.1
    else
    OPTION_REG.6=0 ;interrupt on falling edge
    LOW PORTA.2
    endif

    GOTO MAIN

    thanx once again...

Similar Threads

  1. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts