PIC Interrupt and PORTA input


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Posts
    3

    Default PIC Interrupt and PORTA input

    Can I use interrupt function to control magnet sensor other than PORTB0?
    And how to set PORTA to input function?I've tried but it seem cannot be done...
    hope someone help me, Thanks =)

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not that I know of and this should explain "A".
    What PIC are you using?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Not that I know of and this should explain "A".
    What PIC are you using?
    I am using PIC 16F877A,
    i am doing project to control RGB led on the fan to display image,
    i use 12 unit of shift register to save the port of the PIC, i use PCB to do it and now just realize that my RB0/int PORT ald in use,
    other than RB0 can i use other port to run interrupt function or something similar like interrupt function?

    PORTA suppose is a Analog to digital function, i've turn it to digital but seems like cannot control as input function, i curious what is the problem, hope someone help me, Thanks =)

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    My first post was supposed to have this link
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    I must be getting old....

    Can you post your code? It will help us to solve the problem.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2009
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    My first post was supposed to have this link
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    I must be getting old....

    Can you post your code? It will help us to solve the problem.
    Hi, Thanks for help, i ald solve the problem...
    but got some problem with my project, later i will post my problem here hope somebody can help me, here is all professional and i am just a newbie..
    hope u guys can lend me a hand....i will be appreciate very much, Thanks =)

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi, Jerade

    You can get an interrupt from PORTA ...

    see your Databook, Comparator section, ...


    12.6 Comparator Interrupts
    The comparator interrupt flag is set whenever there is
    a change in the output value of either comparator.
    Software will need to maintain information about the
    status of the output bits, as read from CMCON<7:6>, to
    determine the actual change that occurred. The CMIF
    bit (PIR registers) is the Comparator Interrupt Flag. The
    CMIF bit must be reset by clearing it (‘0’). Since it is
    also possible to write a ‘1’ to this register, a simulated
    interrupt may be initiated.
    The CMIE bit (PIE registers) and the PEIE bit (INTCON
    register) must be set to enable the interrupt. In addition,
    the GIE bit must also be set. If any of these bits are
    clear, the interrupt is not enabled, though the CMIF bit
    will still be set if an interrupt condition occurs.
    ...

    isn't it not marvellous ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Pin won't stay high during Repeat...Until loop??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th August 2009, 23:57
  2. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  3. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  4. 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
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29

Members who have read this thread : 1

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