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.

msp430afe253 debugging using launchpad by spy bi-wire communication

Other Parts Discussed in Thread: MSP430AFE253, MSP430G2231

hello everyone,

                I am actually get started with msp430afe253 target board and i am able program the target board by using msp430 launchpad by spy bi-wire communication.

when i  run a sample code to toggle the gpio port its working but when i used to run the sample code of other modules like Timer,ADC module its not working,the debugger doesn't enter into the interrupt.I have checked the hardware connection is perfect.

please guide as how to resolve the problem.

  • The subject of this thread and your ultimate issues that you are expressing in the body of the initial post are not aligned.  Perhaps you should edit the post and change the title to something more appropriate.

    That said, assuming you are actually able to the use the Launchpad to connect to the MSP430AFE253 target board for the JTAG connection and verify this with a simple GPIO toggle test (as you indicated), the issues you are observing with the other peripherals is the real target of investigation.

    Have you looked at the code examples for the MSP430AFE253 found in the Software & Development Tools section of the MSP430AFE253 Product Folder?

  • yes.I have tried the code examples of MSP430AFE253 provided in software and development tools section.

    And I tried the sample code to generate the PWM signal using the timer module.

    //******************************************************************************
    // MSP430AFE25x Demo - Timer_A, PWM TA1, Up/Down Mode, DCO SMCLK
    //
    // Description: This program generates one PWM output on P1.1 using
    // Timer_A configured for up/down mode. The value in CCR0, 128, defines the PWM
    // period/2 and the value in CCR1 the PWM duty cycles.
    // A 75% duty cycle is on P1.1.
    // SMCLK = MCLK = TACLK = default DCO
    //
    // MSP430AFE25x
    // -----------------
    // /|\| XIN|-
    // | | |
    // --|RST XOUT|-
    // | |
    // | P1.1/TA1|--> CCR1 - 75% PWM
    //
    // Naveen Kala
    // Texas Instruments, Inc
    // March 2011
    // Built with IAR Embedded Workbench Version: 5.20.1
    //******************************************************************************
    #include <msp430afe253.h>

    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD;                              // Stop WDT
    P1DIR |= BIT3 + BIT1;                                                      / / P1.1 and P1.3 output
    P1SEL |= BIT3 + BIT1;                                                     // P1.1 and P1.3 TA1/2 options
    CCR0 = 128;                                                                    // PWM Period/2
    CCTL1 = OUTMOD_6;                                                  // CCR1 toggle/set
    CCR1 = 32;                                                                    // CCR1 PWM duty cycle
    TACTL = TASSEL_2 + MC_3;                                    // SMCLK, up-down mode

    _BIS_SR(LPM0_bits);                                                 // Enter LPM0
    }

    The program has flashed to the MCU and I can able to monitor the changes in the Timer registers but  I cannot see the output in the CRO.

    When I tried another sample code of Timer module using interrupt and I kept the break point in the interrupt but the program counter doesn't come inside the interrupt. 

  • The example you show appears to be MSP430AFE_ta_19.c, is this correct?

    You should see pin P1.1/TA1 toggle.

    You mention not seeing the output on CRO.  Please be more specific on what pin you are targeting.

    I would suggest you review the information contained in the Pin Schematics in the MSP430AFE253 datasheet for configuring the pins to bring out the desired peripherals.

  • well, I have verified the pin schematics is correct and I now  monitoring P1.1 through CRO still no hope.

    when i run another sample code of timer using interrupt  and I kept the break point  in the interrupt the debugger doesn't come inside the interrupt.I can see the value changes in the Timer control register while pausing the the debugger but even the TAR doesn't increment it remains in 0x0001.

    the sample code of timer using interrupt as follows:

    //******************************************************************************
    // MSP430AFE25x Demo - Timer_A, Toggle P1.0, CCR1 Cont. Mode ISR, DCO SMCLK
    //
    // Description: Toggle P1.0 using software and TA_1 ISR. Toggles every
    // 50000 SMCLK cycles. SMCLK provides clock source for TACLK.
    // During the TA_1 ISR, P1.0 is toggled and 50000 clock cycles are added to
    // CCR0. TA_1 ISR is triggered every 50000 cycles. CPU is normally off and
    // used only during TA_ISR. Proper use of the TAIV interrupt vector generator
    // is demonstrated.
    // ACLK = n/a, MCLK = SMCLK = TACLK = default DCO
    //
    // MSP430AFE25x
    // ---------------
    // /|\| XIN|-
    // | | |
    // --|RST XOUT|-
    // | |
    // | P1.0|-->LED
    //
    // Naveen Kala
    // Texas Instruments, Inc
    // March 2011
    // Built with IAR Embedded Workbench Version: 5.20.1
    //******************************************************************************
    #include <msp430afe253.h>

    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop WDT
    P1DIR |= BIT0; // P1.0 output
    CCTL1 = CCIE; // CCR1 interrupt enabled
    CCR1 = 50000;
    TACTL = TASSEL_2 + MC_2; // SMCLK, Contmode

    _BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
    }

    // Timer_A1 Interrupt Vector (TAIV) handler
    #pragma vector=TIMERA1_VECTOR
    __interrupt void Timer_A(void)
    {
    switch( TAIV )
    {
    case 2: // CCR1
    {
    P1OUT ^= BIT0; // Toggle P1.0
    CCR1 += 50000; // Add Offset to CCR1
    }
    break;
    case 4: break; // CCR2 not used
    case 10: break; // overflow not used
    }
    }

     

  • You stil haven't indicated which pin you are trying to monitor.  There is mention of CRO.  I don't know what that is.  Perhaps you mean the output of the TACCR0 which is TA0.  If you look at the pinout of the MSP430AFE253, the TA0 can come out on pins P1.2 and P2.0.  Which of these pins are you monitoring?

    Secondly, the code above does not enable either of these pins, so I would expect you to see anything on them.

  • hello Brandon,

       I have verified the hardware connection from launchpad to the MSP430AFE253 target board is perfect. As for as now I can able to toggle the GPIO ports but non other peripherals are not responding.

    I Think whether it is a clocking problem because I have run the UART echo back code which is already tested in MSP430G2231 and I modified according to MSP430AFE253 but still no hope the debugger doesn't come inside the interrupt. 

  • I monitoring the output of TA1 on the port P1.1 as mentioned in the datasheet  for the first sample code that i have posted because the OUTMOD is set in CCTL1.

    But even no signal can be monitored in the oscilloscope.

  • saravanan chandrasekaran said:

    I monitoring the output of TA1 on the port P1.1 as mentioned in the datasheet  for the first sample code that i have posted because the OUTMOD is set in CCTL1.

    But even no signal can be monitored in the oscilloscope.

    Just so that I am clear, I was under the impression that the first sample code you provided, based on MSP430AFE_ta_19.c, was operating and you were able to observe toggling on TA1, P1.1.

    Is this a correct assumption?

    If not, please clarify on what code you are running on the MSP430AFE253, what pin you are monitoring and what you are observing.

  • The code that i have testing now is as follows:

    #include <msp430afe253.h>
    //
    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD;                          // Stop WDT
    // BCSCTL1=0xCF;
    // DCOCTL=0x63;
    BCSCTL1 = CALBC1_8MHZ;
    DCOCTL = CALDCO_8MHZ;
    P1DIR |= 0x02;                                                            // P1.1
    P1SEL |= 0x02;                                                            // P1.1
    // CCTL0 = OUTMOD_7;
    CCR0 = 160;                                                       // PWM Period
    CCTL1 = OUTMOD_2;                                    
    CCR1 = 80;                                                         // CCR1 PWM duty cycle
    TACTL = TASSEL_2 + MC_3;                               // SMCLK, up-down mode

    _BIS_SR(CPUOFF);                                           // Enter LPM0
    }

    I am monitoring the output of CCR1 in port P1.1 still no hope.

  • BrandonAzbell said:
    There is mention of CRO.  I don't know what that is.

    Best guess: Cathode Ray Oscilloscope. Well, for observing pins, I would prefer a DMO (Digital Memory Oscilloscope) or a logic analyzer. :)

    BrandonAzbell said:
    Perhaps you mean the output of the TACCR0 which is TA0

    No, there is no OUTMODE configured (in the first code). So most likely the toggling of P1.0 in the ISR for CCR1 is meant. However, it is P1.0, not P1.1 that is toggled in the ISR.

    The second code, however, seems to be correct. P1.1 should output a 25kHz signal.
    For completeness, the port initialization should contain
    P1SEL2 &= ~0x02;
    But this should be the default anyway.

  • Hello Brandon,

    Finally the sample code worked but with some problem, actually I am using launchpad for programming and debugging purpose through spy bi-wire connection but what actually happend was using spy bi-wire it is only able to flashing the program in the MCU of MSP430AFE253 target board but it unable to debug the program.

    After flashing the program when I power cycle the launchpad the code which i flashed into the MCU its working I can able to monitor the output in oscilloscope. I don't know what's the problem because by spy bi-wire connection using launchpad i can able to flash and debug the program for MSP430G2XXX but the same spy bi-wire connection  is not working in other target board.

    It would be great if you advice me how to approach it further.

  • brandon, the MSP320AFE253 Timer doesn't work when running in the Debugger, I have the same problem. I use many different MSP430Fxxx's and this is the only one that shows this problem

    this problem renders debugging impossible if you use the Timer on this particular chip. code runs fine outside of the Debugger

    from reading other posts it appears to not matter if it's CCS or IAR, same problem and others are having it as well

     

     

     

  • On some MSPs, the debugger is able to stop the clocks during a breakpoint. It's possible that this feature is active but not working properly on this MSP (so the clocks aren't released). If this is the case, you might configure the debugger to NOT stop the clocks on a breakpoint. Maybe it then works.

    Nevertheless, it seems to be a bug, possibly in the MSP430.DLL part that identifies and handles the EEM of this MSP - or a silicon bug that makes the EEM not working as expected. This needs to be investigated further at the TI labs.

  • Lori Ann Welte said:

    brandon, the MSP320AFE253 Timer doesn't work when running in the Debugger, I have the same problem. I use many different MSP430Fxxx's and this is the only one that shows this problem

    this problem renders debugging impossible if you use the Timer on this particular chip. code runs fine outside of the Debugger

    from reading other posts it appears to not matter if it's CCS or IAR, same problem and others are having it as well

    Hi Lori,

    I was wondering a few things because I'd like to investigate and reproduce this issue:

    1. Have you always observed this problem with the Launchpad debugger, or also using the MSP-FET430UIF tool? (The reason I ask is I'm thinking the AFE253 is not really a supported device for the ez430 programmer on the Launchpad as the Launchpad is designed for just G2xx devices  - I'm looking into this. The MSP-FET430UIF however always does support all released MSP430 devices and so should work)
    2. If the problem is observed with the FET tool, does the problem show up only with the AFE253 with newer versions of CCS/IAR (DLLv3 - this would be CCSv5.1 and newer)? Or do you know if it happened with older versions as well?

    I saw that you mentioned there were other threads about this issue, I will try to search for them, but if you have any particularly revealing ones you'd like to link here that would be appreciated as well.

    Thanks,

    Katie

    MSP430 Customer Applications

  • Is there any resolution to this.

    I am seeing what appears to the same issue both on CCS 5.3 and 4.2. Using both ez430 and FET430UIF

    It appears that when debugging, the SM clock is unable to run. This renders most peripherals unusable - including the USART I am using.

    Programs run fine without the debugger connected. It is also possible to sometimes get the SM clock to restart with a reset (with the debugger connected). I discovered this by accident through an inadvertent scope probe short between the SM clock out I'm monitoring and the adjacent reset pin.

    Our configuration is a insitu AFE253 using external power and 3 pin SBW programming.

  • Followup Info

    With a brand-new MSP-FET430UIF v1.4a with CCS Version: 5.3.0.00090, and following the firmware upgrade, both device programming and debugging (with proper start and stop of the clocks) seems to work correctly. Out of the box, the board uses the VCP interface and after firmware update uses the CDC interface.

    Certain ez430 usb stick devices e.g. that supplied with the Chronos Kit seem to take the CDC upgrade. These seem to work for programming only and have the debug clock control issues described in this thread.

    Other ez430 usb stick devices, e.g. those with the 2013 kits, seem to remain in VCP and won't take the upgrade. These devices do not recognize the 430AFE253 device. This is true with either CCS or the open source programming utilities.

    Much less grief will come to she who sticks with the MSP-FET430UIF box and uses the USB sticks only for the devices with which they shipped.

**Attention** This is a public forum