Can't set portb.0 low


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158

    Default Can't set portb.0 low

    I know this seems really trivial, but I am using an 18F2620 and I set portb.0 high in the beginning of the program with no problems. Later I try to set it low, and it won't go low. The program is quite large, and I can't figure out what could possibly prevent setting the pin low. I have one of my programs from a week earlier, before adding a bunch of stuff, and it works fine proving it is not hardware related.

    I am turning off the AD and comparators for that pin with
    ADCON1 = (%)00001010 (without the brackets)
    CMCON = 7
    TRISB.0=0 'set to output
    PORTB.0=1 'sets the pin high, which works fine

    I have tried:
    LOW portb.0
    PORTB.0=0
    putting a pause before and after setting it low.
    Nothing works. I am sure it is something stupid in my code, but maybe if you can bounce some ideas I will be able to find it. I am using the CCP1 module for measuring pulses on portc.2, as I was on the older program that works fine.
    Last edited by spcw1234; - 15th February 2012 at 17:42.
    Shawn

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