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.

issue with MSP430FR6989 backchannel UART used in assembly

Other Parts Discussed in Thread: MSP430FR6989, MSP-EXP430FR6989

Hi all,

I'm trying to use backchannel UART of my msp430FR6989 launchpad in assembly and in interrupt mode to interact with a PC (using terminal emulation)

I already do the same for several other MSP430 MCU with success

USCI_A1 seems to be used at pins P3.4 for TX and P3.5 for RX.

It doesn't work :-(

As far as I undertstand what's happens, interrupt never rises ( I toggle a led in my ISR).

Does anyone have it already done this ?

Or have an idea ?

BR

Claude

  • Hi Claude,

    The backchannel UART of the MSP-EXP430FR6989 exists on USCI_A0 (P4.2/UCA0TXD and P4.3/UCA0RXD), assembly code examples for eUSCI_A0 UART communication are provided in the following link: www.ti.com/.../slac668

    If you are not using the backchannel UART then the code examples can be easily ported to USCI_A1.

    Regards,
    Ryan
  • Hi Ryan,


    Thank you very much for the link, I didn't know it existed, but ... ;-)

    Piece of code about UART is very close of mine. I would have  been very surprised that it works because "design files" of msp430fr6989 launchpad says that pins P3.4 & P3.5 are connected to backchannel UART (jumper block) and datasheet says this pins are those for USCI_A1. SLAU627 says the same at page 10.

    Anyway, I test it with P4.3 & P4.2 of UCSI_A0 and this does not work. (nothing happen, interrupt does not rise)

    I'm sorry Ryan, I do my best but I can not do what I want.

    I'm still looking a bit and after I drop this launchpad :(

    regards

    Claude

  • Hi Claude!

    Although I cannot help you with assembly, it might not be a bad idea to share your code. There are others around here that are experienced with it and they might be able to provide help.

    Dennis

  • I recently had some trouble with my assembly code for the backchannel UART on the FR5969. I worked out my problem with the transmit interrupt and the code can be found in that thread along with my fix: e2e.ti.com/.../492615

    You will have to adapt that to change A0 to A1 and the pins but the rest should work since the two parts should have identical serial hardware.
  • Hi Ryan,

    it works ! ;-)

    here, the good piece of code.

    ;------------------------------------------------------------------------------- ; MSP430 Assembler Code Template for use with TI Code Composer Studio ; echoing Back channel UART of MSP430FR6989 ; UCSI_A1 at pins P3.4 & P3.5 SMCLK sourced by DCO at 8 MHz ; ;------------------------------------------------------------------------------- .cdecls C,LIST,"msp430.h" ; Include device header file ;------------------------------------------------------------------------------- .def RESET ; Export program entry-point to ; make it known to linker. ;------------------------------------------------------------------------------- .text ; Assemble into program memory. .retain ; Override ELF conditional linking ; and retain current section. .retainrefs ; And retain any sections that have ; references to current section. ;------------------------------------------------------------------------------- RESET mov.w #__STACK_END,SP ; Initialize stackpointer StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer ;------------------------------------------------------------------------------- ; Main loop here ;------------------------------------------------------------------------------- SetupGPIO bic.b #BIT0,&P1OUT ; Clear P1.0 output latch for a defined power-on state bis.b #BIT0,&P1DIR ; Set P1.0 to output direction bis.b #BIT4+BIT5,&P3SEL0 ; USCI_A1 UART operation bic.b #BIT4+BIT5,&P3SEL1 UnlockGPIO bic.w #LOCKLPM5,&PM5CTL0 ; Disable the GPIO power-on default ; high-impedance mode to activate ; previously configured port settings
    ; xor.w #BIT0,&P1OUT SetupCS mov.b #CSKEY_H,&CSCTL0_H ; Unlock CS registers mov.w #DCOFSEL_3+DCORSEL,&CSCTL1 ; Set DCO to 8MHz mov.w #SELA__VLOCLK+SELS__DCOCLK+SELM__DCOCLK,&CSCTL2 mov.w #DIVA__1+DIVS__1+DIVM__1,&CSCTL3 ; Set all dividers clr.b &CSCTL0_H ; Lock CS registers SetupUART mov.w #UCSWRST,&UCA1CTLW0 ; Put eUSCI in reset bis.w #UCSSEL__SMCLK,&UCA1CTLW0 ; CLK = SMCLK ; Baud Rate calculation ; 8000000/(16*9600) = 52.083 ; Fractional portion = 0.083 ; User's Guide Table 21-4: UCBRSx = 0x04 ; UCBRFx = int ( (52.083-52)*16) = 1 mov.b #52, &UCA1BR0 ; 8000000/16/9600 clr.b &UCA1BR1 bis.w #UCOS16+UCBRF_1,&UCA1MCTLW bic.w #UCSWRST,&UCA1CTLW0 ; Initialize eUSCI bis.w #UCRXIE,&UCA1IE ; Enable USCI_A1 RX interrupt nop ; bis.w #LPM3+GIE,SR ; Enter LPM3, interrupts enabled nop ; For debugger ;------------------------------------------------------------------------------ USCI_A1_ISR; USCI A1 Receive/Transmit Interrupt Service Routine ;------------------------------------------------------------------------------ add.w &UCA1IV,PC ; add offset to PC reti ; Vector 0: No interrupts jmp Receive ; Vector 2: USCI UCRXIFG reti ; Vector 4: USCI UCTXIFG reti ; Vector 6: USCI UCSTTIFG reti ; Vector 8: USCI UCTXCPTIFG Receive: xor.w #BIT0,&P1OUT ; to see if interrupt rise bit.w #UCTXIFG,&UCA1IFG jeq Receive mov.w &UCA1RXBUF,&UCA1TXBUF nop reti ;------------------------------------------------------------------------------- ; Stack Pointer definition ;------------------------------------------------------------------------------- .global __STACK_END .sect .stack ;------------------------------------------------------------------------------- ; Interrupt Vectors ;------------------------------------------------------------------------------- .sect ".reset" ; MSP430 RESET Vector .short RESET .sect USCI_A1_VECTOR ; USCI A1 Receive/Transmit Vector .short USCI_A1_ISR ; .end

    regards

    Claude

  • Dennis, David,

    Thank you for answering :)

    As you can see, back channel UART works from now on.

    I should make a mistake with the first program I've made using UCSI_A1, but I don't knox which one.

    regards

    Claude

**Attention** This is a public forum