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/MSP-FET430UIF: CCS/MSP-FETU430IF

Part Number: MSP-FET430UIF

Tool/software: Code Composer Studio

I'm working with "Code Composer Studio v9" and "MPS430 USB-Debug-Interface MSP-FETU430IF" in Win7.
When I made the CCS project, I defined a "TI MSP430 USB1 [Default]" connection with MSP430F1611 microcontroller.
The project contains several .c and .h files, however with debug launching it seems to work properly.
There aren't error or warning messages. The program goes in running (Resume) automatically and the green led (power) is on, while the red led (mode) blinks. In console appears the Flash/FRAM and RAM usage.
Approximately, after a minute the green and red leds are on but the hardware doesn't work. It seems like if the program has not been loaded/uploaded.
What could be?


Best regards,

Matteo

  • Hey Matteo,

    I have something I'd like you to double check for me:

    1. Can you double check that you have the "TI MSP430 USB1 [Default]" option checked within CCS right before you program your board? This can be done by right clicking on your project > Properties > General, then look at the "Connection" field and make sure "TI MSP430 USB1 [Default]" is selected.

    Also, is this your own custom PCB you are trying to program? Or is it a TI board?

    Thanks!

    Mitch

  • Hi Mitch,

    I checked, I attached the screen:

    It's a custom PCB, he works properly with other 

  • Sorry Mitch,

    I sent the message before to finish writing it.

    However, I was writing that it's a custom PCB and it works properly with other IDEs.


    Best regards,

    Matteo

  • Hey Matteo,

    Thanks for the info. Below is a diagram of the connections needed between the MSP-FET device and the F1611 device. Can you double check that the connections below are being made and that you have a pull up resistor on the RST line? Could you also tell me what the pull up value is?

    Thanks,

    Mitch

  • Sure, tomorrow I will check and I will write you!
    I don't know if this information could help, but I added some lines in the program with the code: printf("Hello World XXXX!\n"); where XXXX is the number of the line where is written the code, so I can see on the Console if the program is running or note.
    And, the program runs until the line with che code _EINT();

    I also tried to change the line code with other codes like "_enable_interrupt();" or "__bis_SR_register(GIE);", but to no avail.

  • Hi Matteo,

    Thanks for running that test. 

    One quick thing to check: did you disable the watchdog timer? If not, this could be resetting your system and not allowing it to go past the _EINT() line. This doesn't explain why your system works in other IDEs, but it's worth double checking.

    You will want to make sure to disable the watchdog timer in the beginning of main like below:

    Another thing to try: can you put a breakpoint right before the _EINT() line and step through the program and see where it goes?

    Thanks,

    Mitch

  • Hello Mitch,

    I disabled the watchdog timer using:

    WDTCTL = WDTPW | WDTHOLD;

    Actually I tried to add your code but, during the Debug or the Build, these errors are appeared:

    It doesn't know P2REN.

    Thanks,

    Matteo

  • Hey Matteo,

    I included the Port 2 code just for context to show where to add the WDTCTL = WDTPW | WDTHOLD; line. You can erase lines 399 - 402 in your screenshot above.

    Thanks,

    Mitch

  • Hi Mitch,

    before I wrote:

    WDTCTL = WDTPW + WDTHOLD;


    Now using the code:

    WDTCTL = WDTPW | WDTHOLD;

    it does't work, it's hold on the code _EINT();

  • Hi Mitch,

    one question: in your opinion, could it be a problem of the Timer A code?

    Is it right o wrong?

    Should I change any symbol?


    Thanks,

    Matteo

  • Hi Mitch,

    one question: in your opinion, could it be a problem of the Timer A code?

    Is it right o wrong?

    Should I change any symbol?


    Thanks,

    Matteo

  • Hey Matteo,

    Before we dive deeper, let's do a simple test. Can you comment out the _EINT() line and see if your code runs? 

    Thanks,

    Mitch

  • Hi Mitch,

    sure, I did it I my code run.
    I added a piece of code a where I set P6.1 and P6.2 like output equal to 1 and the code works properly, because I turn on the led connected to these ports.


    Matteo

  • *I did it and my code runs.

  • Ok great!

    This tells me that the issue stems from an interrupt(s) or the _EINT() function itself.

    The next step I would suggest doing is disabling all of the interrupts within each peripheral. For example, when configuring your timer, make sure the TAIE (timer interrupt enable bit) is disabled. Do this for all of your peripherals that you have interrupts enabled for.

    Next, put the _EINT() function back in the program and run it. If your peripherals do not have interrupts enabled, this line should not make a difference, and your code should run.

    If your SW gets hung up with all of the peripheral interrupts disabled, there may be an issue with the _EINT() function itself.

    Thanks,

    Mitch

  • Hi Mitch,

    I tried, but the result is the same.
    I did also a different test. Using a breakpoint a few lines before of the code _EINT(); I ran the SW step by step until the line with che code: _EINT();
    After this last line, program goes inside the file isr_trap.asm and it stops at the lines 48 - 49 of this file. I attached the screens:

    Could be a problem with timer A?

    Actually, it's:

    #pragma vector=TIMERA1_VECTOR
    __interrupt void Timer_A1(void)
    {
    }

    I wanted to be sure interrupt is not enabled, so I deleted in this last test all the code inside __interrupt void Timer A1(void)


    Thanks,

    Matteo

  • Hey Matteo,

    In order to disable the timer interrupt, you need to clear the TAIE bit in line 402 (from your previous screenshot). Line 402 should look like:

      TACTL = TASSEL_0 +  TACLR;        

    Notice that we do not set the TAIE bit here, so the interrupt is not enabled.

    If you had the TAIE bit set, but had a blank ISR, the MCU will not have anything to execute and may be going to the ISR trap routine.

    Check out the "fet140_ta_03.c" code example. This will show how to set up a proper ISR for the TAIE interrupt. This can be found by opening CCS and navigating to Resource Explorer by going to View > Resource Explorer. In Resource explorer go to Software > MSP430Ware > Devices > MSP430F1XX > MSP430F1611 > Peripheral Examples > Register Level. Here you will find the code example.

    Moving forward, there are a couple things you can try:

    1. Disable all interrupts for all peripherals and get your code to execute past the _EINT(); function.

    1a. Once you can get that working, enable interrupts one by one to narrow down which peripheral is giving you issues.

    2. When you get stuck in the ISR trap loop, pause the debugger and see what interrupt flags are pending. This will be a good list of potential sources for the issue. Once you have this, work on disabling/enabling those interrupts to see which one is causing the issue.

    Thanks,

    Mitch

  • Hi Mitch,

    I did another test:

    Using this SW (you can read it below), that I found in a website, I added a beakpoint and enabling the peripherical P1.3 with an external source, the interrupt is enabled correctly.

    It seems like _EINT(); works properly.

    And doing another test, using Timer A, the SW stops.


  • Hi Matteo,

    Are those the only 2 interrupts you have enabled in your test? If yes, then the issue is with Timer A.

    Are you only enabling the TAIE interrupt? Or are you also enabling the CCR0 interrupt? These are 2 separate vectors and both need to be accounted for if both interrupts are enabled.

    Thanks,

    Mitch

  • Hi Mitch,

    Finally I found the mistake!

    The problem was in the line where I define the TACTL, now it's:

      TACTL = TASSEL_1 + MC_1 + TACLR + TAIE;           // ACLK, upmode, clear TAR,, interrupt    //mm
    // it's equal to: TACTL = 0x0116;

      TACCR0 = 0x1F40;

    I don't know the reason, but in IAR with a different code, the program works properly.
    But it doesn't matter. Now it's working properly.


    Thanks!

    Matteo

  • Only one question, is it right to define TACCR0 inside the main?
    In your opinion is it better define it before or after TACTL?

  • Hey Matteo,

    Glad you were able to fix your issue!

    Yes, you will want to define TA0CCR0 inside of main. You should do this before defining the TACTL register. This is because we want TA0CCR0 to be defined before we start the timer.

    If you'd like SW references that show proper timer initialization, you can find them within CCS. Open CCS and navigate to Resource Explorer by going to View > Resource Explorer. In Resource explorer go to Software > MSP430Ware > Devices > MSP430F1XX > MSP430F1611 > Peripheral Examples > Register Level. Here you will find timer SW examples.

    Thanks!

    -Mitch

**Attention** This is a public forum