This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C123GH6PM: master and slave

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi, I have question regarding master and slave application. So I have 2 TM4C123GH6PM boards, I would like to use that as master and slave for my project.

So the question is, Do I need run 2 C++ scripts (1 for master and 1 for slave) together in the same time? If so, how to do that? 

If not, what should I do to be able run my 2 scripts in CCS and see my result in puTTy?

Thank you for your help.

  • If you are asking how to develop and debug two TM4C123 devices using one PC, the answer depends on the hardware you use. The simple ICDI that comes on the EK-TM4C123GXL Launchpad does not support running two on one PC at the same time. If however, at least one device is on a custom board, then you can use an XDS100V2 emulator. That emulator does support multiple emulators at the same time. There is some more information in this thread: e2e.ti.com/.../2024758

    Usually each device will need to have its own C++ program. It is possible to write one program and have some way of the devices establishing if it is the master or slave, but this adds complexity. In either case you are likely to want to be able to debug both devices at the same time as they will be behaving differently, one as master, the other as slave.
  • Vendor Bob's answer is clear & complete - yet you will encounter the dilemma of, "multiple unknowns" - which is sure to add complexity & time to your implementation & debug efforts.

    it is noted that you've not specified the "Mode of Communication" between your two boards.    (simply listed Master & Slave)    You must comply w/the dictates of the communication protocol - even if yours is (other) than I2C or SPI.      The method I'll describe is "Mode Independent" - has proven to work w/: I2C, SPI, UART, and CAN...

    May I suggest "KISS" as a means to, "Greatly Lessen the number of Unknowns" - which most always guides you along the most efficient path towards design success?

    Note too that the method suggested "avoids" (at minimum, much delays) the requirement to deploy TWO debug sessions together.

    KISS dictates you follow (much) as listed:

    • Acquire the most simple Slave device possible (usually a very small capacity EEProm - should you employ I2C or SPI)
    • Develop your code to perform the most basic writes & reads - aimed towards that simple Slave
    • Only when you've mastered that "Master to (known) Slave" communication - both writing & reading - would I proceed
    • Now implement the Slave code - you may employ the "now known good" Master to send a single byte to your Slave.    (often we employ a push-button to cause a single byte transfer)
    • You then determine if the Slave has successfully received that single byte from your Master
    • Once achieved - you may attempt to transfer from the Slave to the Master

    Breaking the task into its constituent parts (as modeled here) vastly simplifies your effort - and proves the most effective means to build your confidence & understanding.