• 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 » MSP430™ Microcontrollers » MSP430 Ultra-Low Power 16-bit Microcontroller Forum » No SPI clock seen in the analyser (MSP430F5438A - Port 10).
Share
MSP430™ Microcontrollers
  • Forum
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
MSP430 Resources
  • MSP430 Product Folder
  • MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit
  • MSP430 Getting Started Guide
  • MSP430 Microcontroller Projects
  • More Resources >
  • Forums

    No SPI clock seen in the analyser (MSP430F5438A - Port 10).

    This question is answered
    Venkat Ramshankar
    Posted by Venkat Ramshankar
    on Apr 06 2012 08:43 AM
    Prodigy190 points

    Hi Everyone,

    First of all, I would like to thank all the champs in this TI forum. I have learnt a lot of things by reading through the forum discussions on MSP430.

    My problem is as follows :

    I am setting up MSP430F5438A (in the EXP430 board) as an SPI master with a sensor attached to its P10 as the slave. I have changed the MCLK frequency to 16MHz using the "Init_FLL_xx" (HAL_UCS.h and HAL_UCS.c) function available from the UserExperience code example. My assumption is that the SMCLK would also be 16MHz (--am I right here?).

    The following would be my code for initializing the P10.x on the EXP430 board for SPI (Master) with SMCLK as the source clock. I am using the USCI A3 module.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    //pin config
    #define SPI_STE_PIN BIT7
    #define SPI_SIMO_PIN BIT4
    #define SPI_SOMI_PIN BIT5
    #define SPI_CLK_PIN BIT0
    //spi init code
    P10OUT |= SPI_STE_PIN;
    P10SEL &= ~SPI_STE_PIN;
    P10DIR |= SPI_STE_PIN;

    P10SEL |= (SPI_SIMO_PIN + SPI_CLK_PIN + SPI_SOMI_PIN);

    UCA3CTL1 = UCSWRST;
    UCA3CTL0 = UCMST + UCSYNC + UCMSB + UCCKPL;
    UCA3CTL1 |= UCSSEL__SMCLK;
    UCA3BR0 = baudrate; //example baudrate I tried was 16 (decimal) so that UCxCLK would be 1MHz
    UCA3BR1 = (baudrate >> 8);
    UCA3MCTL = 0;
    UCA3CTL1 &= ~UCSWRST;

    for(i=0;i<2;i++)
    __delay_cycles(16 * 100); //let the state machine get some time to settle
    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    I have an SPI analzser and a sensor which I have connected to the pins from the MSP430 port. I started analyzing 
    the waveform and found that I am not able to see any clock in the display even if the MOSI is 
    spitting the data out (0x44 was the data). From one of the forum posts, I tried to continuously 
    read and write through the SPI lines and found that only at very low frequencies
     (when I give baudrate = 1000) I am able to see proper clock pulses in the UI. The analyzer supports 
    upto 50MHz and I am sampling the lines at the highest rate possible.
     Please find the image below for the same :

    I think something very trivial is missing and I have played around with different SPI configurations, 
    but none to succeed (just for seeing the clock pulses at SPI_CLK >= 1MHz). I feel there could be 
    a small configuration or setting which I have not done. Please reply back if you have faced 
    the same issue/have pointers to solve the same.
    
    
    Thanks a lot,
    -Venkat.
    MSP430 SPI SPI clock
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Apr 10 2012 12:20 PM
      Guru139900 points

      The setup seems to be okay, and the fact that you're seeing a clock pulse on a low baudrate, it also seems to indicate that things are okay from teh software side.

      However, not seeing pulses on high baudrate but on low one seems to indicate sort of a capacitive shortcut. The analyzer doesn't show the waveform of the signal, obnly whetehr the voltage crosses its high threshold. With a digital scope you might see that the pulses are there but attenuated and not rectangular. Check your PCB for capacitances or shortcuts on the clock pin.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Venkat Ramshankar
      Posted by Venkat Ramshankar
      on Apr 11 2012 00:16 AM
      Prodigy190 points

      Hi Jens-Michael Gross,

      Thanks a lot for your comments.. I will surely check the capacitive short. 

      (Solution)

      One thing I did was to do the same software settings on another port (P3 , USCI B0 module) and I got the clock perfectly. So I am continuing now with B0 module itself.

      (New problem)

      I am now getting some "spike" like reply from the slave during a read cycle. The SPI slave reply does not go with the clock which the master has provided (data shift edge is correct, but the signal dies off before the data sample edge. PL=1, PH=0 setting for SPI). This makes the master receive only zeros. (Please take a look in the attached image, MOSI line is written with 0x00 for pulling out the data from MISO).

      Have you ever come across such a situation? Can you point me to some directions for this problem?

      Thanks for all your posts. They are very informative.

      -Venkat.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Apr 11 2012 12:08 PM
      Verified Answer
      Verified by Venkat Ramshankar
      Guru139900 points

      This is indeed weird. It looks like an electrical problem.
      Again, a logic analyzer only showes the moment where a level exceeds the threshold voltage. It does not show the real voltage on these pins. Normally, the slave should output its bit a short moment after the clock is going low, while the master fetches it when the clock is going high. In case of a 0xff response, the signal input on MISO should be a flat high line from the first falling edge of the clock.

      Are you really sure that you have the correct wiring? I could imagine such kind of response if the clock were accidentally connected to the CS (chip select) pin, so the falling edge of the clock actually enables the slave (causing a short spike on MISO)
      Do you have GND connected? Else you have a 'floating' GND, which moves depending on the signals. And the analyzer (and the MSP) only sees the resulting beat frequency, cut to its threshold voltage.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Venkat Ramshankar
      Posted by Venkat Ramshankar
      on Apr 12 2012 07:15 AM
      Prodigy190 points

      Hi,

      The CS and CLK pins were not connected directly, but there was a problem whenever I connected the analyzer to my setup.

      I have removed the analyzer and the SPI interface seems to work (by observing the RXBUF in the debugger). The problems which I posted being in the hardware, it would have been much harder to track without the replies.

      Thanks again,

      -Venkat.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    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