Retrieving infos from multiple PICs on a bus/chain


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891

    Default Retrieving infos from multiple PICs on a bus/chain

    Hello,

    I'm building up a system using twenty-two PICs ("sensor") connected to one PIC ("master").

    The distance between each "sensor" PIC is two meters so the bus or daisy-chain will be around 25 meters long, end-to-end to the "master" PIC.
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2084&stc=1&d=119234804 4">
    The "sensor" PICs control photodiodes and have to provide a binary value to the "master" PIC anytime it has changed. They also have to provide their ID (i.e. PIC's #).

    The "master" PIC will gather and convert this info to an 0V to 10V information for the BMS (Building Monitoring System = alarm visualisation system).

    Since I have a few of them in my drawer, I have chosen 10F202 PIC as the "sensor" PICs and will see if the same one can be use as the "master" one.

    Question: to get me started correctly, how do I connect the PICs (I2C, SPI,..?) and how am I retrieving their information?
    Attached Images Attached Images  
    Roger

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    Have you considered RS485? Looks like a suitable application for it.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Yes, but how to implement this?

    Any example just for a good start?
    Roger

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Lightbulb

    Hello, Roger

    How are you ???

    You SHOULD consider the Maxim's DS 2405 ( not expensive at all ) ... and its one wire bus.

    Also could permit Bidirectionnal functionning with your Pics ... ahaaaaaa !!!

    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 " !!!
    *****************************************

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    flotulopex, A simple oper collector transistor for each PIC output. These would be tied togeather to the bus. The master would have a resistor tied to VCC to source current to the bus. Each PIC would also have this bus line as an input. Then before the remotes transmit they would check to see if the bus is active (low) before they transmit there data. This bus structure is used in vehicles and one of the physical layer types is ISO-9141.
    The standard baudrate for ISO-9141 is 9600.
    Dave Purola,
    N8NTA

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default

    Thanks Alain,

    Good idea. But Switzerland is not like other countries: a DS2405 costs around €2.- as a 10F200 only €0,80...

    Furthemore, I'll have to build some circuitry to make the Input a Schmitt trigger (wich I won't have to do with the PIC).

    Thank you Dave. I was assuming the master PIC "interrogating" the slaves one would be the simplest way of doing.
    Roger

  7. #7


    Did you find this post helpful? Yes | No

    Default Common mode problems.

    If all units are plugged in to a single power point then you might get away with direct connecting each device but 25 metres is getting up to the distance limits, particularly if devices can be powered by different phases of the mains along the length. The common mode problems will almost certainly bite you.

    Optical isolation, RS422/485 or transformer isolation were all devised to get around this problem. The simplest/cheapest is RS485 IMHO.

    If the system will have only one power supply then a direct connect system with three signalling wires is what I would use. One wire is calle ATTention, the second is ACKnowledge and the third is DATa. These three are resistively pulled high and all devices are set with their three pins as inputs. When any device wants to send it pulls the ATT line low and repeatedly sends the ID it is trying to call on the DATa line. When the selected receiver senses its address on the data line it pulls the ACK line low. The sender now knows it has a link to the desired address and now the sender repeatedly sends the message (with checksum) until the ACK line floats high which signals the recevier has got a clean message through. I just use TTL RS-232 via SERIN/SEROUT for this and it works a treat.

    HTH
    Brian

  8. #8
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    Flotul

    Here is a link to get you started on RS485.

    http://www.bb-elec.com/technical_library.asp


    Jerson

Similar Threads

  1. Simultaneous programming of multiple pics - is it possible?
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 18th April 2010, 04:56
  2. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  3. Multiple Pics accessing single EEPROM
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd February 2008, 17:22
  4. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 17:02
  5. Multiple Pics to One serial port
    By Rleonard in forum Serial
    Replies: 1
    Last Post: - 18th January 2007, 18:30

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