1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Two MicroControllers

Discussion in 'Microcontrollers' started by Eng.Remon, May 28, 2007.

  1. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    Hi, I need to make 2 microcontrollers talk to each others, which means that M1 will send a byte for M2 so that M2 will make action. When Action done M2 send to M1 and so on, Any ideas!!!!

    I ll be so grateful
    THnks
     
  2. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    Please do not make duplicate posts or threads, they do not increase your chance of a helpful response but only reduce it, as people get confused and can't always see what others have suggested in the other thread(s).

    If you have made this post or thread in error then please do not be offended. We get lots of people making duplicate threads under the misapprehension that it will increase their chance of a helpful response when in practice the reverse is true.
     
  3. Peter_wadley

    Peter_wadley New Member

    Joined:
    Mar 20, 2007
    Messages:
    376
    Likes:
    1
    So you want to use one MICRO as a switch for the other?

    Is that what your asking?

    You could have the micro which is going to be doing the action constantly waiting for the other micro to send a LOW bit.. when this happens the action micro will go and do the action..

    Please explain more..

    Im sure others will help you soon.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. mramos1

    mramos1 Active Member

    Joined:
    Sep 15, 2005
    Messages:
    2,403
    Likes:
    9
    Location:
    Boynton Beach, Florida USA

    Have you picked the uC or uP (microcontroler or microprocessor to help the search engine here)

    Why not use serial? And send a command to M2 and wait for a response to come back with a status.

    So give a hint. What are you wanting to do and why do you need to micros?
     
  6. Gayan Soyza

    Gayan Soyza Active Member

    Joined:
    Oct 23, 2006
    Messages:
    1,822
    Likes:
    19
    Location:
    Colombo
    Do you mean a logical state? If M1 make an output pin HIGH the M2 detects that and make active(will do some other work).
    or
    Did you ask from google about I2C? Also Nigels tutorials you can find some good Examples.
     
  7. pkshima

    pkshima Member

    Joined:
    Jan 23, 2003
    Messages:
    343
    Likes:
    1
    Location:
    New Delhi, India
    How many possible commands/responses you want to support ?
    If just a few you can connect some pins directly and send/receive data in parallel.

    For larger number of commands, you got to send/receive data in serial.
    For that you can use either I2C or RS232 ....
     
  8. Papabravo

    Papabravo Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    2,889
    Likes:
    25
    Location:
    Michigan, USA (GMT-5)
    You could use a bi-directional FIFO. This would be blisteringly fast.
     
  9. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    ok i need to make a protocol between them but i dont wana make it depend on the time between each :S coz every one make a lot of things already meaning that m1 is connected to a keybad and lcd, and m2 is connected to some sensors which getting reading from them and send a byte contains action code that sends to m1 to tell i , so m1 gonna send another byte to a nother uc to let it make a phone call through a DTMF IC ,
    Any IDEas.,
    Sorry about FIFO i dont understand can u declare it more plz
     
  10. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    btw for the dupilcation i didnt mean it i was just editing the post as i want to put the mc type which is atmel 80c51 :S
    Sorry if that make a mess
     
  11. Papabravo

    Papabravo Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    2,889
    Likes:
    25
    Location:
    Michigan, USA (GMT-5)
    A FIFO is a memory decive that stores bytes of data. They come in several depths, and the access method is that the first byte which goes in the device is the first byte that comes out. They are often used in systems that run at different speeds and need to exchange data asyncronously. FIFO is an acronym that stands for First In First Out
     
  12. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    oh ok but can u give an ic no#? but could be interfaced easily with the uc, coz usually i search for something and lastly i find it is in somehow wont work :(
    thnx
     
  13. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,324
    Likes:
    653
    Location:
    Derbyshire, UK
    I don't see any reason for an FIFO?, all you need is to connect a single pin (plus ground of course) from one uC to the other - transfer the data as standard RS232 type serial. If you want bi-directional use two pins, although it can be done with one if required.
     
  14. Papabravo

    Papabravo Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    2,889
    Likes:
    25
    Location:
    Michigan, USA (GMT-5)
    These guys make good stuff
    http://www.idt.com/?genID=7201&source=products_genericPart_7201
    and there is lots to choose from. These parts are 512x9
     
  15. Oznog

    Oznog Active Member

    Joined:
    Apr 21, 2004
    Messages:
    2,879
    Likes:
    11
    Location:
    Austin, Tx
    I have no idea what you're suggesting with a FIFO. It has nothing to do with his problem that I can see.

    Serial comm works great (many PICs have a hardware serial module built in). I2C and SPI are other ways to interconnect 2 controllers or interface a controller with a peripheral designed to use that sort of communication. Serial will even allow you to connect to a PC. We do this all the time.

    For communication between 2 controllers, usually serial. You don't need to use an RS232 transceiver in most cases, just connect the TX of one controller to the RX of the other (one wire) and configure the hardware serial module.
     
  16. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    If a fifo is required, it can very easily be implemented in the pic itself. I posted code in this thread.

    Mike.
     
  17. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    In regards to the PIC USART
     
  18. Papabravo

    Papabravo Well-Known Member

    Joined:
    Mar 9, 2006
    Messages:
    2,889
    Likes:
    25
    Location:
    Michigan, USA (GMT-5)
    The external FIFO memory does two things. It is blisteringly fast in a way that serial methods cannot be, and it takes very nearly zero processor resources on either side. I agree that it's not required for most applications, but if you require raw speed it's tough to beat.
     
  19. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    the idea is that they are asynchronous so all what i m afraid from is that one gets out data and for his fast he retype another data on it , so i need something like abuffer to hold the data untill reading it from the other uc. So any suggestion other than FIFO
    plus there is about 9 possible actions or more i didnt count exactly in fact
     
    Last edited: May 31, 2007
  20. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    It all depends on how much, how fast and how often the data comes in. In short you need to characterize the data transfer better.

    In most cases interrupt driven serial will work very well without an external FIFO.
     
  21. Eng.Remon

    Eng.Remon New Member

    Joined:
    Dec 13, 2006
    Messages:
    50
    Likes:
    0
    Location:
    Eg.
    yea exactly, but for my side there is uc with the main uc but also there is a side of the DTMF uc , so to calculating times with interrupts and such things would be hard in fact. so i guess Something in between that holds data untill reading it would be better ,isnt it?
     

Share This Page