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.

MSP430FR59721: eUSCIA0 Receive interrupt not working

Part Number: MSP430FR59721
Other Parts Discussed in Thread: MSP430F249, , MSP430FR5739, SN74LVC1G125

I have setup the registers and believe that they are correct. I have a baud rate of 115200. I am sending a small message with 5 bytes. I can observe the transmitted data on a CRO and it is correct. I can also connect to a PC and observe it is OK. When I transmit from the PC  (using  Tera term) I do not receive the interrupt. I can see the waveform on the CRO at pin 1 on the MCU. I have GIE set and the receive interrupt enabled. I have no parity  set. 

Any suggestions would be appreciated.

Thanks

Peter

  • I should also say I am using pins 1 & 64 for RXD0 and TXD0. I notice there is another choice on pins 32 & 33. Should I be setting something to select either one of these?

    Peter
  • Hi Peter,

    Yes, there should be a register that allows you to remap the pins, but I don't see this in the documentation. I am looking into this and will let you know what I find.
  • Hi Eddie

    I too have looked at the user guide, data sheet and errata but see not mention of this. I have also looked through all the register names.addresses and can see nothing that resembles this. I look forward to hearing from you as this looks like my problem. 

    Thanks

    Peter

  • I hesitate to disagree with Eddie, but I don't think the FR59 series has anything like the Port MAPper (F5) nor the ReMaP bits (FR2/FR4). I believe it is the case that you use whichever one you pick in the PxSEL bits. (I think it's even possible to use both sets, though I can't tell you what happens if you do this for the RXD side.)

    Do you have any code you can show us? Sometimes all it takes is a typo.

    [Edit: Fixed my own typo.]

  • Let me give more details. My MCU is communicating with a 4G module. I sent an AT command to the module and got no activity on the module's transmit pin, my Rx pin. The 4G module has a uart at 1.8V levels so I use a level shifter in between them. To find out which is at fault I disconnected the MCU Tx/Rx lines from the level shifter. In their place I substituted a RS232 board going to a PC. I set up a terminal program for 115200 baud, 8N1. I was able to send AT commands to the 4G module and receives responses. To me, this means the 4g module is not at fault. I then did the reverse and connected my MCU to the RS232 board and repeated the same test. The PC received the command I sent it. I then tried to send bytes to my MCU. I saw no interrupt at all, BUT I could look at pin 1 of the MCU (USCA0RXD) and see data using the CRO. The data was correct. 

    My setup is 

    SetupUART0 bis.b #UCSWRST,&UCA0CTL1 ; Configure UART 0
    bis.b #BIT2+BIT3,&P4SEL0
    bic.b #BIT2+BIT3,&P4SEL1

    bis.b #UCSSEL_2,&UCA0CTL1 ; Set CLK = SMCLK
    ;set up uart0 for baud rate
    mov.b #4,&UCA0BR0 ; 4 for 115200 baud; 52 for 9600
    mov.w #0x05551,&UCA0MCTLW ;0x05551 for 115200; 0x04911 for 9600
    clr.b &UCA0BR1
    bic.b #UCSWRST,&UCA0CTL1 ; release from reset

    I enable the receive interrupt just before I send the data  

    bis.w #UCRXIE,&UCA0IE ;enable receive int
    bic.w #UCRXIFG,&UCA0IFG ;clear flag

    I cannot see what else I can do and am open to any suggestions. I just want the problem solved, whether it is my problem or someone else.

    Thanks for the interest.

      

  • How do you know that you aren't getting an interrupt? Breakpoint? LED?

    What does your ISR look like?

  • I have a breakpoint there. I will try a led tomorrow and see if this helps.
    The code is
    eUSCI_A0_INT ;0xFFEE Modem receive
    bic.w #UCRXIFG,&UCA0IFG
    mov.w &UCA0RXBUF,R10
    mov.b R10,0(R6)
    inc R6
    dec.b BYTE_COUNTER
    jnz USARTb ;not the end

    bis #RX_IN,FLAGC
    bic.w #UCRXIE,&UCA0IE ;disable receive int
    USARTb reti

    Cheers
  • A breakpoint should do it.

    What is your program doing (best guess) at about the time the byte arrives? LPM? Spin loop?

    Is there any chance your vector is misplaced?
  • My program is in a loop waiting for RX_IN to be set. My breakpoint is at the first instruction of the ISR.
    Below is the Vector locations
    ORG 0FFC6h
    DW DUMMY ;oxffc6
    DW DUMMY ;0xffc8
    DW DUMMY ;0xFFca
    DW PORT4_INT ;0xffcc
    DW PORT3_INT ;0xffce
    DW DUMMY ;0xffd0
    DW DUMMY ;0xffd2
    DW PORT2_INT ;0xffd4
    DW DUMMY ;0xffd6
    DW DUMMY ;0XFFD8
    DW PORT1_INT ;0xffda
    DW TA1_CCR0_INT ;0xffdc
    DW DUMMY ;0xffde
    DW DMA_INT ;0xffe0
    DW DUMMY ;eUSCI_B1_INT ;0xFFe2
    DW DUMMY ;eUSCI_A1_INT ; 0xFFE4
    DW TA0_CCR_INT ;0xFFe6 eUSCI_A1_TX_RX
    DW TA0_CCR_INT ;0xffe8
    DW DUMMY ;0xffea
    DW eUSCI_B0_INT ;0xffec
    DW eUSCI_A0_INT ;0xffee
    DW DUMMY ;0xFFF0 reserved
    DW WDT_INT ;0xFFF2
    DW TB0_CCR_INT ;F4
    DW TB0_CCR0_INT ;F6
    DW COMP_INT ;F8
    DW USER_NMI_INT ;FA
    DW SYSTEM_NMI_INT ;FC
    DW RESET ;FE
    END

    Thanks for the help

    Peter
  • I'm supposing this is IAR assembly syntax, and I don't have IAR. (CCS uses a separate .section for each vector, so the linker places them.)

    I don't see anything obviously wrong in what you've shown, so the next guess is that it's somewhere else. At this point I would be using the debugger to (a) look at the vector word to make sure it matches (b) check the registers (SR, UCA0IE, UCA0IFG, UCA0CTL0W) to make sure they're what I expected (c) set a breakpoint at the entry point to make sure the program isn't doing a "surprise" Reset.
  • Bruce,

    You are correct.  This device does not use port mapping, but rather just the PxSEL bits. 

    Peter,

    As Bruce stated, the code you shared does seem okay, so its possible the issue is somewhere else.  Have you compared with the UART code examples to ensure something is not missing?

    http://www.ti.com/lit/zip/slac686

  • I have found one of my problems. When I was sending/receiving to a PC I had not set the enable in the right place, I can now send ok to/from a PC. However, I cannot seem to communicate with my 4G modem with the MCU. I can communicate with the 4G modem using a PC and the level shifter. Today I used another external MCU (MSP430F249) and I can successfully communicate with the 4G module. To me that means the 4G module is OK and the level shifters are ok. I am currently looking at the waveforms under each option.

    Thanks

    Peter

  • Peter,

    If you are still experiencing this issue, can you share the waveform captures you have?  Thanks!

  • Eddie

    Thanks for your continued interest. Let me try and fully explain what I have done. I have attached 2 PDF files showing my schematics. You can see that I have a MSP430FR59721 as my main MCU and the ACA0TXD/RXD on pins 1 & 64 is being used. The level shifters used are 4 NPN transistors. In my case I am currently using BC337. The resistor values are as shown. I am using a baud rate of 115200 baud with N81. I also have an external  RS232 board which changes the levels suitable for a PC. I also have an external MSP430PM64 board with a MSP430F249 MCU in the socket. 

    Because I could not communicate with the 4G module (SIM7000E) I needed to find out where the problem lay. 

    1. I set it up so that the MSPFR59721 was disconnected from the circuit and substituted it for the PC via the RS232 board. The connections from the RS232 board went onto the TXD/RXD points. This worked fine with communications in both directions. This proved to me that there was nothing wrong with the 4G modem. It also proved that the level shifter worked so the problem seemed to be before the level shifters. .

    2. I then set up the MSP430FR59721 so that it went through the RS232 board to the PC. The level shifters were not connected. This worked fine with communications in both directions. This proved that the software was ok and that the uart had been set up ok. I was not sure where to turn at this stage.

    3. I then went back to original as per the attached schematic. I could see the transmitted data on a CRO at pin 10 of U1 (4G module) marked as TXD on PORT symbol or RXD on the actual chip. But Nothing came out of pin 9, the output of the 4G module. 

    4. I then set up the MSP430PM64 board so that it was connected to the PC similar to 2. above. This worked fine. I then set it up to go through the level shifters to the 4G modem as in 3 above.  I got the same results of data at pin 10 but no data from the 4G module. 

    In cases where the setup works the RS232 board is involved. I considered that the 4G module may require more drive capacity but I have used the same 4G module with a MSP430FR5739 and had no problems. I will set it up again and send some wave forms so you can take a look.

    Thanks

    Peter LTE Schematic.pdfMCUl Schematic.pdf

  •   Hi Eddie

    Further to my testing I inserted a TI line driver in place of the transistor level shifters. It is a SN74LVC1G125. I had the MSP430PM64 with the MSP430F249 as the MCU. It worked fine. I can get output from the 4G module. I then replaced the MSP430F249 with the one from my board (MSP430FR59721). It DID NOT give an output from the 4G module. I have attached a file of both waveforms (F240 and FR59721).

    I did a few more tests on the F249 and I did find that once I did not get a response from the 4 G module. I never got a response when using the MSP430FR59721. 

    Please let me know what you think

    Thanks

    Peter

**Attention** This is a public forum