high and low issues pic12F683


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2007
    Posts
    42

    Default high and low issues pic12F683

    I have a pin that goes high (1.5v) when a button is pressed but when it's not pressed it's at .4v which the microcontroller can't see as "low". Basicly I need the microcontroller to see this .4v as low.

    The microcontroller's VCC is 3.0v. I thought there was a way to compare a pin's volatage to vcc which I thought would make this happen but I forgot how.

    Any help would be appreciated.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by plyrathrt View Post
    I have a pin that goes high (1.5v) when a button is pressed but when it's not pressed it's at .4v which the microcontroller can't see as "low". Basicly I need the microcontroller to see this .4v as low.

    The microcontroller's VCC is 3.0v. I thought there was a way to compare a pin's volatage to vcc which I thought would make this happen but I forgot how.

    Any help would be appreciated.
    It should...must be something else wrong...
    From the 12F683 datasheet...DS41211D...page 121...parameters D030, D030A, D031.
    If the pin is a TTL input, logic low is .15Vdd = 3 * .15 = .45V
    If the pin is a schmitt trigger input, logic low is .2Vdd = 3 * .2 = .6V
    Anything less than those two values above (i.e. your .4v) would be read as a logic low, assuming you have the ports set up correct (i.e. digital, not analog, input, not output, and so on)...
    Do you know what a pulldown resistor is?

  3. #3
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    I can't put a pull down resistor on there because grounding the contact I am trying to connect to will make it not function.

    Is there any other way to make it accept .4v as low? Coding tricks or anything?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by plyrathrt View Post
    I can't put a pull down resistor on there because grounding the contact I am trying to connect to will make it not function.

    Is there any other way to make it accept .4v as low? Coding tricks or anything?
    Re-read the last post!
    It already should be taking .4v as low UNLESS something else isn't set up correctly.
    Increase the Vdd, double-check your config, try another chip, try another meter.
    And putting in a pulldown resistor isn't grounding a contact.

  5. #5
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    They should be correct
    ANSEL = 0
    ADCON0 = 0
    CMCON0 = 7

    I don't know what gives. It's very agrevating. I am still playing with it.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Well, whatever happens, whatever you do, don't show us any test code that you may have written so somebody else might be able to point out any flawed logic that you may have overlooked, however trivial or complex it may be...'cause I like guessing at things like this...

  7. #7
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    I finally figured it out. I was an idiot and had a something stupid in the code.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by plyrathrt View Post
    I finally figured it out. I was an idiot and had a something stupid in the code.
    Good. And don't think you're so much of an idiot and did something stupid...'cause I think we've all done exactly that...some more, some less, but at least once...

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Pic16f84 and RC5 kode
    By terminator in forum Bluetooth
    Replies: 5
    Last Post: - 18th June 2007, 21:40
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37

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