• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » Hercules™ Safety Microcontrollers » Hercules™ Safety Microcontrollers Forum » RM48 SPI4 Loopback Problem
Share
Hercules™ Safety Microcontrollers
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

RM48 SPI4 Loopback Problem

This question is answered
Griswald Brooks
Posted by Griswald Brooks
on Jul 30 2012 14:26 PM
Intellectual410 points

Hello,

I'm using the RM48L950 PGE with HALCoGen and IAR and I can't seem to get the loopback test for SPI4 to work.

I can transmit out of SPI4, verified with the oscilloscope but when I either solder the MOSI and MISO lines together or enable the Digital Loopback, the only thing I receive (polling method), is 0xFF.

Any suggestions?

Regards,

Griswald Brooks

SPI SPI4 RM48 RM48L950 problem does not work receive loopback
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Hari Pendurty
    Posted by Hari Pendurty
    on Jul 30 2012 16:52 PM
    Intellectual1230 points

    Griswald ,

    Thanks for your post. We will look into this and get back to you

     

    Regards,

    Herules support forum

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Jul 31 2012 13:47 PM
    Genius10345 points

    Griswald,

    On RM48L950 the SPI4 is multiplexed with NHET1 pins.
    Out of reset, the default function is NHET1, so in order to use the SPI4 you have to program the Pin Mux Module.

    This is available in HalCoGen using the tab "PINMUX"
    On the top of the screen you will see an Enable/Disable Peripheral check boxes. You will have to check the box for SPI4.
    It is always recommended to click on the List Conflicts button to check that your configuration is valid.

    Of course once the SPI4 is used, the corresponding NHET pins are no more usable as NHET.

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Jul 31 2012 13:57 PM
    Intellectual410 points

    Jean-Marc,

    That was one of the first things I checked. Hence why I have transmit working.

    To reiterate, in HALCoGen, I have the SPI4 peripheral checkbox checked under the PINMUX tab.

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 06 2012 14:37 PM
    Intellectual410 points

    Jean-Marc,

    Any further ideas?

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 07 2012 22:00 PM
    Intellectual410 points

    Jean-Marc,

    I've done an SPI loopback on the RM48 HDK board using the SPI2 code for SD cards.

    I've nearly copied the spiInit() code for SPI2 into SPI4's init on my board, making adjustments for the different clocks on each board, yet when I connect the MOSI and MISO lines together and use the SPI_send command the only thing I get back is 0xFF.

    I've again verified on the scope that I see the transmit data on the microcontroller pin ( pin 31 on the RM48L950 PGE )

    Any help?

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 08 2012 13:18 PM
    Intellectual410 points

    Jean-Marc,

    What happens during spiInit() if the SPI4ENA pin is not driven low?

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jean-Marc Mifsud
    Posted by Jean-Marc Mifsud
    on Aug 08 2012 15:56 PM
    Genius10345 points

    Griswald,

    The state of the spi pins have no effect on the spiInit().

    In HalCoGen, to use multiple SPI/MIBSPI, you have to check box the one you plan to use in Driver Enable tab.
    Than HalcoGen will generate the spiInit() routine. There is only one spiInit() routine that will take care of all the SPI/MIBSPI you plan to use in your application.

    Best regards,

    Jean-Marc

    Application Engineer


    If my reply answers your question please click on the green button "Verify Answer".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 08 2012 16:04 PM
    Intellectual410 points

    Jean-Marc,

    SPI4 in checked under the Driver Enable tab in HALCoGen and the spiInit() is being used.

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 08 2012 20:24 PM
    Intellectual410 points

    Jean-Marc,

    I've also now reproduced the problem on the HDK. I set the spiInit settings for SPI4, set the SPI4 pinmux using the sample code functions, changed the SPI_send() function to use SPI4, and commented out the hetInit.

    I jumpered NHET102 to NHET105 on the HDK, SPI4SIMO and SPI4MOSI respectively, checked the transmission with the oscilloscope to see that I was sending 0xA2, and what I get in response is 0xFF. I even try this loop 10000 times and it's always 0xFF

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 13 2012 13:48 PM
    Intellectual410 points

    Jean-Marc,

    Attached is the code that I've been running, for your edification.

    5751.RM48 Hercules Demo.zip

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • James Rose
    Posted by James Rose
    on Aug 17 2012 14:07 PM
    Expert3860 points

    Hello Jean-Marc,

    The customer has contacted us stating that he still needs assistance with this inquiry.

    Any assistance you can provide is greatly appreciated.

     

    Best regards,

    James Rose Jr.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Prathap
    Posted by Prathap
    on Aug 18 2012 06:24 AM
    Expert6465 points

    Hi,

    Quick question , what version of HDK are you using RevD or RevE.

    I am guessing you are using "Rev D" In which LED2 ( Tricolour) is controlled with ( NHET1 pin 2, 5 and 20) unfortunately NHET1 Pin 2 and 5 are muxed with SPI4 SIMO and SOMI. Could this be any reason for your failure ? Please check.

    Regards
    Prathap

    ~~~ If a post answers your question, please mark it with the"Verify Answer" button. ~~~

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 18 2012 10:23 AM
    Intellectual410 points

    Prathap,

    I'm not at the office right now, I will check on Monday. When I do, how will I tell which Rev it is? Where is it documented?

    Also, I know that the SPI4 is pinmuxed with the HET. This is in the RM48 ZWT documentation as such. In the code I uploaded I disable the hetInit() and after all the other initializations I set the SPI4 mux setting with the Gladiator commands.

    Is there somewhere else I need to change mux settings? Gladiator_PINMUX_DEFAULT() is not run in the sys_main (unless it's in some other function of course).

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Prathap
    Posted by Prathap
    on Aug 18 2012 10:47 AM
    Expert6465 points

    Hi Griswald,

    The Rev info is printed on the Board. Check right side of " Hercules Texas Instruments" silk screen.

    From where did you get this peice of code ( Demo) ? Did you download form TI website?

    You can use HALCoGen 3.01.01, which will help you to resolve your problem quicker.

    Regards
    Prathap

     

    ~~~ If a post answers your question, please mark it with the"Verify Answer" button. ~~~

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Griswald Brooks
    Posted by Griswald Brooks
    on Aug 18 2012 11:32 AM
    Intellectual410 points

    Prathap,

    I can't tell you the exact directory structure right now, but this is supposed to be the source code for the Hercules Safety MCU demo. I either downloaded it or it came on the CD with the HDK.

    I've tried using HALCoGen 3.01.01 and CCSv5.1 with the HDK and I either get a memory loading error or when I use any of the .cmd files with the project (either the sys one from HALCoGen, or the RM4 or TMS570 ones from the TI folders) I get overlapping memory errors.

    Regards,

    Griswald Brooks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use