MSP430FR6043: Getting unstable SPI MOSI data

Part Number: MSP430FR6043
Other Parts Discussed in Thread: MSP-FET, UNIFLASH

Hello all,

I'm sending a byte of data through SPI and checked in the oscilloscope but i got undesired output. 

In debugging, the value of Tx Buffer is updated but in oscilloscope i'm getting some random pulses.

Please guide me where i'm doing mistake.

I'm attaching the code..

#include <msp430.h> 


/**
 * main.c
 */
int main(void)
{
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
	
	// RESET BY SOFTWARE
	
	UCA2CTLW0 |= UCSWRST;

	// CONFIGURE CTLWO
	
	UCA2CTLW0 |= UCSSEL__SMCLK;
	UCA2BRW = 10;

	// 3-PIN AND MASTER MODE
	
	UCA2CTLW0 |= UCSYNC;
	UCA2CTLW0 |= UCMST;

	// Configure ports
	//-----------------

	// SCLK
	
	PJSEL1 &=~ BIT0;
	PJSEL0 |= BIT0;

	//SIMO
	
	PJSEL1 &=~ BIT2;
	PJSEL0 |= BIT2;

	//SOMI
	
	PJSEL1 &=~ BIT3;
	PJSEL0 |= BIT3;

	//Disable the GPIO power-on default high-impedance mode
	
	PM5CTL0 &=~ LOCKLPM5;

	// Clear the reset through software

	UCA2CTLW0 &=~ UCSWRST;

	int i=0;

	while(1)
	{
        UCA2TXBUF = 0x4e;
        while(!(UCA2IFG & UCTXIFG));

       
	}

	return 0;
}
  

Thanks and Regards,

Ashok Kumar.

  • Hello Ashok,

    It looks like you are doing everything correctly.  Is there anything attached to this MOSI pin?  Is it easy for you to quickly try one of the other eusci ports to see if you have same issue?

  • Hello Dennis,

    Thanks for reply. 

    Is there anything attached to this MOSI pin? 

    No Dennis. I'm just kept Digital oscilloscope probe at SIMO pin and observed output.

    I observed that the pins i'm used for spi is the same pins of JTAG signals.

    PJ.0 --> TDO - SCLK

    PJ.1 --> TDI - STE

    PJ.2 --> TMS - SIMO

    PJ.3 --> TCK - SOMI

    While debugging JTAG signals are active.  Is this is reason for not getting desired output ?

    quickly try one of the other eusci ports to see if you have same issue?

    In EVM430FR6043 microcontroller board only have single eusci port for spi. 

       

    Thanks,

    Ashok.

     

  • Hi Ashok,

    That shouldn't be the case.  Just to confirm, you are using the on-board ez-FET programmer that is populated on that EVM, correct?

    And for those pins, are you setting the PJSEL0 bits = 1 and PJSEL1 bits = 0?

    And when not in debug mode the SPI works?

  • Hello Dennis,

    Just to confirm, you are using the on-board ez-FET programmer that is populated on that EVM, correct?

    No Dennis, I'm using MSP430 USB Debug Interface ( MSP - FET430UIF) for programming and Debugging.

    are you setting the PJSEL0 bits = 1 and PJSEL1 bits = 0?

    Yes.

    And when not in debug mode the SPI works?

    Yes, I got SIMO data in Oscilloscope not in debug mode.

    PJ.0 header pin for SPI SCLK is not available in EVM430 - FR6043 so I'm not able to check SCLK on board.  

    I tested SPI SCLK at pin number 17 (i.e. UCA2CLK) in 80 pin msp430fr6043 but I'm getting logic high instead of clock signal and also tested pin number 19 (UCA2SIMO) in 80 pin msp430fr6043. I got the data in oscilloscope. 

    Please guide me where i'm doing mistake.

    Thanks,

    Ashok

  • Hi Ashok,

    There is something definitely not right here.  Let me check with the product engineers to see if this is undocumented behavior.

  • Hello Ashok,

    I have not yet received a definitive answer from our product engineer regarding this issue.

  • Hi Ashok,

    Ok, I'm being told that connecting the MSP-FET to J34 will use the 4-wire JTAG interface and will interfere with the alternate pin functions, such as SPI while debugging and programming.

    Is there a reason you are not using the on-board eZFET programmer/debugger?

  • Hello Dennis,

    Is there a reason you are not using the on-board eZFET programmer/debugger?

    I don't know how to program and debug using on board eZFET programmer. So I'm using MSP-FET430UIF.

    Thanks,

    Ashok.

  • Hi Ashok,

    Ok, it is simple.  When the EVM is connected to USB, the on-board eZ-FET programmer is active as a programmer and debugger. 

    It can be used from CCS, IAR or other programming SW, such as Uniflash.  You need to ensure the two jumpers shown below are in place.

    That's it.

    BTW, what OS are you running?

  • Hello Dennis,

    I tried this method but i can't see the communication port like "MSP Application UART1" or "MSP Debug interface". 

    BTW, what OS are you running?

    Windows 7

    Thanks,

    Ashok.

  • Hi Ashok,

    Ok, let me reach out to one of our engineers who is more familiar with this platform.

  • Hi Ashok,

    What are the status of the LED's(LED201, LED202, LED203, LED101, LED102) on the eZ-FET section of the board when it is powered?  If the board is connected, LED201 and LED102 should be illuminated.

    When using the eZ-FET, be sure that you also have the Power Select(S5) switch set to EZFET(middle position) and the jumpers for VCC and GND on J2 are placed.  Last, J4 should be in the right hand position.  Figure 1 in then quick start guide below also illustrates this.

    https://www.ti.com/lit/ug/slau765b/slau765b.pdf 

  • Hello Dennis,

    let me reach out to one of our engineers who is more familiar with this platform.

    okay and thank you.

  • Hello Eddie,

    Thanks for reply. 

    What are the status of the LED's(LED201, LED202, LED203, LED101, LED102) on the eZ-FET section of the board when it is powered?

    LED 201 is ON

    LED 202 is blinking 

    LED 203 is OFF

    LED 101 is OFF

    LED 102 is ON

    When using the eZ-FET, be sure that you also have the Power Select(S5) switch set to EZFET(middle position) and the jumpers for VCC and GND on J2 are placed.  Last, J4 should be in the right hand position.

    I set S5 in the middle position and jumpers are set according to instruction given by you.

    Instead of Communication port I got some Human interface devices as shown in figure.

    Thanks,

    Ashok.

  • HI Ashok,

    The LEDs you describe as being "ON" are correct, so the device has enumerated.  So in your device manager view in Windows, you don't see anything listed as "Ports (COM & LPT) as shown here? 

    Is your MSP430FR6043 EVM new?

    There is something else we can try.

    Go to this link. Make sure the EVM is connected directly to your PC (not through a USB hub) and perform the power shell command as described.  I checked that win7 does include power shell, provided you have SP1 installed.

    In the link it also describes how to re-flash the on-board programmer if we need to go to the next step.

  • Hello Ashok,

    It's been a few days since I have heard from you so I’m assuming you were able to resolve your issue.
    If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

  • Hello Dennis, 

    Sorry for late response. I working on the SPI protocol in evm fr-6043. and I found that  MOSI data can be seen in oscilloscope only in not in debug mode. Due to same pins are using for JTAG signals and SPI signals. While debugging,  spi signals are got undesired output. PJ.0 is not available in EVM-FR6043 but while studying schematic we found out that P7.0 is actually PJ.0 in evmfr-6043. So, MOSI data can be seen in oscilloscope in normal mode (not in debug mode) and also SCLK also can seen in oscilloscope by making sclk pin as output pin and need to check at P7.0.

    Thanks,

    Ashok.  

  • Hi Askok,

    No problem.  After a few days if no response I assume the problem has been solved.

    Were you able to get the on-board eZ-FET recognized by windows device manager?  If you are still attempting to use JTAG pins for SPI while debugging with the external MSP-FET, it's not going to work.

  • Hello Dennis,

    Were you able to get the on-board eZ-FET recognized by windows device manager? 

    No Dennis, Windows is not recognized  the on-board eZ-FET . 

    Instead of Communication port I got some Human interface devices as shown in figure.

    Thanks,

    Ashok.