read 1 sensor with 2 PICs?


Closed Thread
Results 1 to 10 of 10
  1. #1
    PICn_n_grinnin's Avatar
    PICn_n_grinnin Guest

    Default read 1 sensor with 2 PICs?

    Hello All,
    I am trying to read a resistive type sensor connected to two PICs, a 16F88 and a 16F685. When either PIC is connected to the sensor by itself, it works fine. But when both are connected, neither one reads correctly. The sensor has a range of 0 to 90 Ohms, and I'm using a 100 Ohm resistor between the input pin and Vcc on each PIC.
    I'm sure you're asking yourselves why I don't just have one PIC perform both functions... well it's a long, ugly story. Let's just say I'm stuck with this setup and I have to make it work (or not). I'm using the default settings for ADCIN.
    Any tips, hints, enlightened insights would be much appreciated. I really need to put this project (and myself) to bed.
    Thanks in advance,
    Pete K.
    P.S. I have a hunch that the problem lies more in the circuit than in the software. Then again, the last time I had a hunch I lost a hundred bucks at the Blackjack table in Vegas!

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Can you bring this part to an opamp, wired as a buffer, and the output of the buffer to the inputs of your pic's.

  3. #3
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    An A/D chip with serial output could also be an option.Feed the serial output to both Pic's.

  4. #4
    PICn_n_grinnin's Avatar
    PICn_n_grinnin Guest


    Did you find this post helpful? Yes | No

    Default

    Mat and Arnie - thanks for your replies. I should have mentioned that the circuits in question have already been built, and any changes other than adding a resistor here, a diode there, would mean a re-design and I'm afraid that at this point, that's not an option.
    Perhaps I should rephrase my original question to read: Should the setup I'm currently using work, or am I just wasting my time trying to get it to? I just realized that what I'm doing, in effect, is connecting the A/D input pins of the two PICs together with the output from the sensor, and having the two inputs tied to each other might be confusing the A/D converters in both PICs. Am I thinking along the right lines here? If so, would there be a fairly simple work-around, or should I just scrap the whole idea and go with one of your suggestions?
    Thanks again, guys. My butt's in a sling here, and I really appreciate your input.

    I just had another though as I was keying this in - how about (if I'm forced to redo this mess) using a third PIC that has an A/D converter and two hardware PWM channels on it, with the A/D connected to the sensor and each of the HPWM outputs going to one of the two existing PICs?

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, Picn' ...

    QUOTE [ and I'm using a 100 Ohm resistor between the input pin and Vcc on each PIC. ]

    Wonder if there is really ONE resistor for EACH Pic ...

    Logically, there must be only ONE resistor in series with your probe ... so, the second PIC input must NOT have a 100 Ohms resistor from +5v ...

    I'm not sure ... but that can be a very good reason for misrunning ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    PICn_n_grinnin's Avatar
    PICn_n_grinnin Guest


    Did you find this post helpful? Yes | No

    Default

    Hello Alain,
    Thanks for your reply. I think we tried the setup with only one resistor, but now I can't remember for sure... I'll be going to the lab later today and will try that. Do you think there should not be a problem with having the two PIC's A/D pins tied together?

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi,

    For the supply, if the two PICS have a COMMON GROUND and BOTH a very close to 5 v supply ( do not forget PIC protection diodes on the inputs ...), I don't see any problem ... as your sensor impedance is low enough.

    For common Ground ... keep in mind there should be only 1 common ground connection point to avoid "ground loops" ...

    Alain

    a scheme of each of your ADCs inputs could help greatly too ...
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    PICn_n_grinnin's Avatar
    PICn_n_grinnin Guest


    Did you find this post helpful? Yes | No

    Default

    Alain,
    The two PICs are on seperate circuit boards, each with its own 5V. switching regulator, and there is a common ground between the boards. I'm a little unclear as to what you mean by the protection diodes. What type of diode and where should they be placed?
    Thanks,
    Pete

  9. #9
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    These are INTERNAL Pic protection diodes ... If supply voltage of the 2 Pics were differents, that could create problems, so we must not forget them in such situations !!!

    One more point, is your sensor connected to ground on one of its sides ???

    Alain
    Last edited by Acetronics2; - 25th June 2006 at 18:16.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #10
    PICn_n_grinnin's Avatar
    PICn_n_grinnin Guest


    Did you find this post helpful? Yes | No

    Default

    Alain,
    OK, my face is sufficiently red! I forgot to take my smart pill this morning. As I mentioned, I will try the single resistor and will let you know the results.
    Pete

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  3. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  4. Displaying messages with only 7 (or 4) LEDs on a stick...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 20th May 2007, 08:35
  5. 18F452 "Unknown Processor" errors
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th April 2006, 03:56

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