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.

MSP430FR6972: MSP430FR6972

Part Number: MSP430FR6972

Tool/software:

Hi 

I'm using MSP430FR6972, I want to using the SPI , Uart and I2C, afer the register configuration 

example :

SPI2_UCA0

                       bis.w        #UCSWRST,UCA0CTLW0 ;
                       mov.w       #(UCSWRST+UCMSB+UCMST+UCSYNC+UCSSEL1+UCSSEL0),UCA0CTLW0 
                       mov.w      #16,UCA0BRW ;* CLOCK DIVISO 2 VA A 500kHz SMCLK èè a 8mHz */
                       bic.b         #(BIT4+BIT3),P4SEL0 ;* disable uart  Port 4
                       bic.b         #(BIT0+BIT1+BIT2),P2SEL1  
                      bis.b           #(BIT0+BIT1+BIT2),P2SEL0 ;* enable SPI Port 2 

                      bic.w           UCSWRST,UCA0CTLW0

SPI2_UCB1

                         bis.w   #UCSWRST,UCB1CTLW0 
                         mov.w #(UCSWRST+UCMSB+UCMST+UCSYNC+UCSSEL1+UCSSEL0),UCB1CTLW0 
                        mov.w  #16,UCB1BRW
                        bic.b    #(BIT1+BIT2),P3SEL0 ;* disable  I2C on Port 3 
                        bclr.b   #(BIT5+BIT6+BIT7),P4SEL0 ; 
                        bclr_b  #(BIT5+BIT6+BIT7),P4SEL1 ;* enable spi  port 4 
                        bclr.w  #UCSWRST,UCB1CTLW0 

 I have problem with SPI_UCA0, do not have any signal on the output pin whne is set like SPI

if I'm using this port like I/O pin work properly 

, the SPI_UCB1 work properly without any problem, 

for the SPI_UCA0 there is some bit in the hide Register to enable the SPI ? I have try to check every where 

but did't find anythings 

Luigi 

have problem only with port 2, there is some special bit on sonme hide register ? 

  • Hi Luigi,

    Seems odd. You have the following for UCB1, which clearing bits 5,6,7 in both P4SEL0 and P4SEL1, puts these pins into GPIO mode, not SPI.

    bclr.b   #(BIT5+BIT6+BIT7),P4SEL0 ; 
    bclr_b  #(BIT5+BIT6+BIT7),P4SEL1 ;

    Likewise, you do set bits 5,6,7 in P2EL0 and clear same bits in P2SEL1, which is correct for enabling the pins for SPI instead of GPIO.

    bic.b         #(BIT0+BIT1+BIT2),P2SEL1  
    bis.b           #(BIT0+BIT1+BIT2),P2SEL0 ;* enable SPI Port 2

    So are you sure you are having trouble with UCA0 and not UCB1?

  • Hi Dennis 

    sorry I wrote bad about UCB1 because I Using macro and have translate bad 

                          bis.w   #UCSWRST,UCB1CTLW0 
                             mov.w #(UCSWRST+UCMSB+UCMST+UCSYNC+UCSSEL1+UCSSEL0),UCB1CTLW0 
                            mov.w  #16,UCB1BRW
                            bic.b    #(BIT1+BIT2),P3SEL0 ;* disable  I2C on Port 3 
                            bic.b   #(BIT5+BIT6+BIT7),P4SEL0 ; 
                            bis.b  #(BIT5+BIT6+BIT7),P4SEL1 ;* enable spi  port 4 
                            bclr.w  #UCSWRST,UCB1CTLW0 

    this port UCB1 work well 

    I have found the problem, have using the Old routine and I didn't think of replacing the register of previous application with this new application, 

    the old routine used the UCB1 registers and not UCA0, now is ok  

    sorry for Mistake 

    Luigi 

**Attention** This is a public forum