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.

CCS/MSP430FR5969: interrupts

Part Number: MSP430FR5969

Tool/software: Code Composer Studio

hi this is harikrishna...

i have doubt like this ..we have driverlib in that __delay_cycles(); function is there..so i am doing on GSM project in that my MSP UART0 is connected to GSM module they are in communicating with each other by AT commands ..and in MSP program RTC is running and for every SECOND interrupt in RTC it is blinking one LED for 100ms delay so..i am having problem like this when AT command is sending from MSP and modem is giving responce perfectly but in MSP UART0 is not taking that responce ...i don't no why it is happening but i felt because of __delay_cycles(); function RTC will disturbing that MSP and GSM modem communication....

is it true or false?

please give a suggestion to avoid that problem

NOTE :some times only it is happening not for all AT commands...

  • I am not exactly sure what you are saying, but yes, the delay_cycles() intrinsic shuts down *everything* and should only be used sparingly.
  • Hi Harikrishna,

    Keith is correct.  According the MSP C/C++ Compiler guide, section 6.8.3, The __delay_cycles intrinsic inserts code to consume precisely the number of specified cycles with no side effects.

    So this means the CPU is only executing that function until the number of cycles is complete.  During that time no other code can run.

    If you are using UART interrupts to receive data and global interrupt enabled, you shouldn't miss a single byte.

    In that case the CPU will temporarily stop running the _delay_cycle() and will start executing the UART interrupt code.

    When complete, the CPU will return to the _delay_cycle() and complete that code.

    So It sounds like your aren't using RX interrupts to receive that characters from your modem.

    There is an example for the MSP430FR5969 showing how to use RX interrupts to automatically receive bytes in the TI Resource Explorer.

  • Thanks Dennis Lehman..
    I understood what you say but I have a task like this..from UART. MSP will have to receive data continuesly and don't have particular time whenever data comes from server I need to receive (MSP).. and I need to blink one led for 100ms continuesly for every second..
  • Ok, then you need to setup a timer to generate an interrupt every 100msec.  In the interrupt service routine you can toggle the state of the LED from on to off.

    Here is example how to do this.

    Note how the GPIO pin is toggled in the ISR.  This is how you toggle your LED.

  • thank you ..if i use the timer that also work like delay..both are same are not? ..timer will run for the 100ms then led on and off will happend simultaneously ..but i have a condition like this if the UART data will comes from serever for 20 seconds then in this mean time about LED..is this sill blink for 100ms are not..The UART ISR is serving on this time..
  • Typically, you want everything to be interrupt driven. If you keep the interrupt service routines short, there is plenty of time for TIMER interrupt service routine to toggle the LED in between the UART interrupts when each new byte is received. And it doesn't matter how my bytes the UART is receiving.
    Take a look at the examples in the TI Resource explorer I provided earlier. Specifically look at the eusciA_uart examples. You should be able to combine both the TIMER and UART examples to create a complete interrupt driven design.

**Attention** This is a public forum