PIC to recognise button press when 2.5V seen at input pin? (ie neither high nor low)


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Certainly it WILL work if you feed a Comparator...

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


    Did you find this post helpful? Yes | No

    Default

    PS I'm having a torrid time getting PIN 4 on a 12F683 to work as an digital output pin - this just so happens to be the MCLR pin - any top tips what might be my problem? if I use the same code but with a different pin in it's place it all works - so it's somethint unique to that pin 4 - I've tried the MCLRE_OFF in my config - it's driving me potty...
    MCLR pins are INPUTS only when set to off.
    From the data sheet.
    4.2.5.4 GP3/MCLR/VPP
    Figure 4-4 shows the diagram for this pin. The GP3 pin
    is configurable to function as one of the following:
    • a general purpose input
    • as Master Clear Reset with weak pull-up
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    MCLR pins are INPUTS only when set to off.
    From the data sheet.
    Many thanks ...useful things datasheets eh?! (but a bit scarey for n00bs!)

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


    Did you find this post helpful? Yes | No

    Default

    Just keep the data sheets in the bathroom and read them there...
    Somehow they are not so ... intimidating then.Name:  pen_mac.jpeg
Views: 770
Size:  1.9 KB
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Default 2V5 input with digital I/O pins

    2V5 is in the analog world so if you have a spare comparator or ADC pin on your PIC then use it.

    If you do not have a spare analog pin, then RCTIME and POT commands can be used.

    Setup your PIC with a fixed resistor and capacitor for RCTIME or POT on an available digital I/O pin. Connect the 2V5 source to the same pin through, say, a 10K resistor. There will be large changes in the value returned by the RCTIME or POT command when the 2V5 source is present/not present.

    HTH
    BrianT

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