Shop OBEX P1 Docs P2 Docs Learn Events
Easiest way to make two SX MC communicate together. — Parallax Forums

Easiest way to make two SX MC communicate together.

Wissam Ch.Wissam Ch. Posts: 36
edited 2008-04-04 04:37 in General Discussion
Hi All ,
What is the easiest way to make two SX MCs communicate together ?
·

Comments

  • BeanBean Posts: 8,129
    edited 2008-02-27 14:50
    The "easiest" would be to just connect a bunch of pins together. Make then outputs on the transmitter and inputs on the receiver.

    I guess it really depends on what you are transmitting and how fast you need to transmit.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com

    ·
  • Wissam Ch.Wissam Ch. Posts: 36
    edited 2008-02-28 13:07
    Hi Bean,
    My plans are to make one SX drive 6 7-Segment LED displays , the number to display will be sent from the other SX MC.
    So you mean i dont have to implement any VP module ? that looks good.
    Thanks
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-02-28 20:33
    The code in this article is a little date (i.e., SX/B has matured since then), but it will show you how to create a multi-digit, seven-segment display that accepts data over a single wire: www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol6/col/nv117.pdf

    Just a note on the schematic in that article: You really should tie the MCLR line to Vdd through a 10K, not directly as shown. Sorry, my mistake.

    Update: Since I wrote the original program and write in SX/B all day every day I have attached a copy that matches present SX/B standards. I changed as little as possible so that you can still follow the explanation in the article.

    Post Edited (JonnyMac) : 2/28/2008 9:06:23 PM GMT
  • Wissam Ch.Wissam Ch. Posts: 36
    edited 2008-02-29 11:56
    Thanks Jonny,
    that article has what i need.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-29 13:32
    I do understand wanting to avoid Virtual Peripherals as they can be a bit daunting. But after all, you are asking for communication between two SXes and that is usually done through the peripherials provided by software or hardware. In the SXes, it has to be software.

    I suppose you could have 4 outputs create a nibble code that is polled in parallel by the other chip, but that would merely drive one 7-segment digit's count from 0 through F. You would have to have another 3 pins in parallel to tell which of the 6 digit's you wanted to change. This is a very low level approach and the beauty of serial is that 1 wire plus a common ground can send the same info as a whole byte.

    SX/B was created for guys that didn't want to think about Virtural Peripheral coding. It creates all the general cases for you. You can use RS-232 in SX/B and skip including the level shifter chips if they are next to each other, you can use SX/B's shiftin and shiftout commands and have one unit be the master and the other the slave, or you can even use I2C in a master/slave format.

    I really wonder how you expect to have communications without communications programed into the chip/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-02-29 15:31
    I will politely disagree with you "for guys that don't want to think about Virtual Peripheral coding." SX/B just gives on another method of coding them -- remember, you don't have to use SX/B's built in commands, you are free to code your own. While I tend to use assembly with my VP code in the ISR, I have in fact written lots of VP code in high-level SX/B. In the article reference above, for example, the display multiplexing is written entirely in high-level SX/B.
  • The CrimpsterThe Crimpster Posts: 7
    edited 2008-04-04 04:11
    Why not use a dedicated seven segment controller like the MAX7219?
  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-04-04 04:27
    You can buy about five SX28s for the price of one MAX7219....
  • The CrimpsterThe Crimpster Posts: 7
    edited 2008-04-04 04:37
    Too true, I'm getting too used to samples =)
Sign In or Register to comment.