get a sensor digital input to work on a pickit 2 16f690 lpc


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    19

    Default get a sensor digital input to work on a pickit 2 16f690 lpc

    First is it possible to run a low voltage digital sensor switch to work on this board and how?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    Hi Jasonstew,
    Please give a bit more detail, I am pretty sure the answer is yes. What voltage and type of sensor do you want? Digital or analog ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    As i said it will be a digital sensor and i believe the voltage is 5 volts, the same as the pickit 2

  4. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    Why would you think or wonder that it would not work?

    Have you tried it?? If so what problems did you encounter?

    As Archangel indicated you need to provide enough detail to back up your question.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  5. #5
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    I was just wondering how to use digital sensors on PIC's

  6. #6
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    Can you give a specific part number of the sensor?
    or some example code that you have tried?

    I(we) are quite willing to helpl but need enough detail so that the question can be addressed.

    As you probably know, there are litterally hundreds of digital and analog sensors.
    Are you trying to sense light, temperature, sound, mass, movement?

    Here is an article showing how to interface with one or many "Dallas Semiconductor 1-wire Temperature sensors (DS18B20)"

    http://www.picbasic.co.uk/forum/cont...r-nine-of-them
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: get a sensor digital input to work on a pickit 2 16f690 lpc

    Well JasonStew,
    Digital is simple, if you have the 5 v it is a one and if not it is a zero, so set one of the ports to input, just for hoots I will say PortB.7 like so TRISB = %10000000 and now portb.7 is an input. Now really simple Psuedocode If Portb.7 = 1 then portb.6 = 1 and viola if portb.7 is switched on then it switches the output on portb.6 to on status. You see I set the other 3 usable ports on PortB as outputs in the tris statement. I think it causes less confusion if you get in the habit of using all 8 bits in your port and register declarations even when the port has "unimplemented" bits like the 4 lower bits(ports) in portb of the 16f690. When you setup the ports and tris registers, it seems counter intuitive but set the port register first then set up the tris register. That way any outputs are set to the desired state before they become outputs (THANKS BRUCE ).
    Last edited by Archangel; - 24th June 2011 at 17:04.

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