detect1 to 0 change on RA0


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20

    Unhappy detect1 to 0 change on RA0

    Why does this fall through?

    loop:
    IF porta.0 = 1 then loop

    next lot of basic code follows here

    RA0 is tied up via 10K and a press button grounds it, to get out of the loop, but...it fall thro anyway
    Rgds
    Mike URGENT for my sanity
    Last edited by med2007; - 15th January 2008 at 15:33. Reason: further info

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by med2007 View Post
    Why does this fall through?
    loop:
    IF porta.0 = 1 then loop
    next lot of basic code follows here
    RA0 is tied up via 10K and a press button grounds it, to get out of the loop, but...it fall thro anyway
    Rgds
    Mike URGENT for my sanity
    Think analog...
    Think datasheets...
    Think about telling which PIC you're using...
    Just a few things to think about...

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    And also your configurations, DEFINES, schematic, etc.

    Why don't you post your code? If you seek help from experts, then do not worry about stealing you code... They sure know and do better!

    With no infos, only guesses can be made. And I am not good at. If I was I would have won the Lotto or Casino or something anyway...

    Ioannis

  4. #4
    Join Date
    Jan 2008
    Location
    lincoln uk
    Posts
    20


    Did you find this post helpful? Yes | No

    Smile detect 0 to 1 on RA0

    Thanks guys, the answer is to configure porta for digital I/O, which I hadn't done.
    CMCON = %00000111 using 16F628
    Rgds
    Last edited by med2007; - 16th January 2008 at 08:56. Reason: forgot MCU

Similar Threads

  1. A Simple IOC Routine (Interrupt On Change)
    By lugo.p in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th March 2010, 19:53
  2. encoder port change
    By l_gaminde in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th September 2009, 19:41
  3. pic18f4520 baud rate change to 115200
    By caltex88 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th September 2007, 08:41
  4. HELP !!! How change the voltage of a pin ????
    By stormdacta in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 21st August 2007, 20:55
  5. help!! With Keypad change
    By clare1 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th December 2006, 21:13

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