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.

TM4C1294NCZAD: SPI Slave example code without TI-RTOS

Part Number: TM4C1294NCZAD
Other Parts Discussed in Thread: EK-TM4C1294XL

Dear TI employees,

I need URGENTLY a SPI slave example code for TM4C129x devices without Ti-RTOS. Please provide as soon as possible.

Example should show at least how to init the SSI for SPI slave functionality, set a GPIO for chip select, send and receive a single byte.

Best regards,

asdfg

  • Would not such "Urgent" need provoke (some) interest and/or motivation to - at minimum - employ this forum's "Search function" - along w/MCU Manual read (review likely in your (vendor) case) along w/the superbly detailed, "Peripheral Driver Library User's Guide?"

    Set-up/config of the MCU's SPI as Slave should be quick/easy.      Alas your "Set a GPIO - for more flexible/controllable, chip select" - applies (far more - perhaps exclusively) to the SPI Master - NOT to the SPI Slave!    (i.e. the Slave requires "proper input upon its SPI-FSS pin - does it not?)

    Left (only) then is the "send/receive of a single byte."     Note that a "Ready and "in range" SPI Master" will (also) be required to (properly interact) w/your "send/receive" requirement.     That said might, "More than a "single byte" be required to enable the SPI Slave to output (any) meaningful data?      (when "prompted to do so - by the controlling, SPI Master?")        Does not the "first byte clocked into the SPI Slave" catch that Slave "cold" - thus only "meaningless data" is emitted (by said Slave) - during that "very first/single byte" sequence?)

    Guidance/direction herein is offered in service of the "urgency" expressed by your posting.    Only those - w/in the U.S. - and w/"insomnia tendencies" - are able (and likely) to respond before your "loss of 5-6 (more) hours!"

    Bon chance - mon ami...

  • Thank you for your response.

    No, self help is not the right solution here. I need to deliver a true working code example without any chance to test it on any hardware.
    I can not give you any further information to understand this. Sorry for that.

    But thanks again for the suggestion. :)
  • I changed the addressing line in the front, so that it got a little bit more clear, that I'm awaiting an answer from a TIer. Thank you again.
  • My writing (attempted) to best comply w/your requirement for "urgency."      I'm (now) able to sleep (in process by most w/in the US) yet do believe that your "prep work" in the 4-5 hours (prior) to "vendor consciousness" CAN be used to your advantage.      (far exceeds "passive" waiting - does it not?...)

    Rejecting such "prep work" - which very clearly - IS the right solution here - does NOT work to your favor!     It is usual that any "rushed solution" will "fail to anticipate (all) potential outcomes" - and minus "your improved & capable knowledge" - the very hurried, "true, working code example" may not (fully) satisfy your urgent need!      ("effort lite" (prep free) rarely yields great success...)

  • Here is an example project of using SSI in slave mode. There are two CCS 7.3 projects in the attached zip file, SPI_Master and SPI_Slave. You can demonstrate the two projects by hooking two EK-TM4C1294XL LaunchPads together. Connect the following five wires:

        //      Master              Slave
        //      PA5 - SSI0Tx  -> PA4 - SSI0Rx
        //      PA4 - SSI0Rx  -> PA5 - SSI0Tx
        //      PA3 - SSI0Fss -> PA3 - SSI0Fss
        //      PA2 - SSI0CLK -> PA2 - SSI0CLK
        //      GND           -> GND
    

    Start the slave device running first as it will wait for the CLK from the master. SSIOFss acts as the CS.

    /cfs-file/__key/communityserver-discussions-components-files/908/7750.SPI.zip

  • asdfg asd said:
    I need to deliver a true working code example without any chance to test it on any hardware.

    Thud!

    Picks self off of floor. Rights chair brushes self off and sits gingerly. Re-reads.

    Um, Um, um ....

    Seriously? No testing?

    While it is possible to deliver code that requires minimal testing on the end hardware, the more that's required the greater the requirements on earlier testing. With complete software simulation, with subsets of the hardware (ie a board with connections to the peripherals but no end hardware) with software simulation of the hardware and environment via HIL (Hardware In the Loop). In the end though testing on the actual device is required because the simulation is not reality.

    Static analysis and TDD can help (neither require HW) but you're putting a lot of faith in the correctness of the peripheral documentation and your ability to correctly interpret it. Not doing any testing to verify your code responds as it is supposed strikes me as overconfidence.

    Robert

  • Thank you Bob. 

    BR,

    Frank