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.

slac123d sample code not working on eZ430-RF2500

Other Parts Discussed in Thread: MSP430F2274, CC2500

Hi.
I'm trying to figure why I cannot make my device work properly, but there's something I quite don't understand.
While testing some sample code from the slac123d package, actually the msp430x22x4_wdt_01.c and msp430x22x4_wdt_02.c example files, while the first one runs without problems, the second one doesn't run at all

the code from msp430x22x4_wdt_01.c is:

#include "msp430x22x4.h"

void main(void)
{
WDTCTL = WDT_MDLY_32; // Set Watchdog interval to ~27ms
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= 0x01; // Set P1.0 to output direction

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

// Watchdog Timer interrupt service routine
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}


the code from msp430x22x4_wdt_02.c is:

#include "msp430x22x4.h"

void main(void)
{
WDTCTL = WDT_ADLY_250; // WDT 250ms, ACLK, interval timer
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= 0x01; // Set P1.0 to output direction

__bis_SR_register(LPM3_bits + GIE); // Enter LPM3 w/interrupt
}

// Watchdog Timer interrupt service routine
#pragma vector = WDT_VECTOR
__interrupt void watchdog_timer(void)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
}


since both the boards from the package suffer the same behaviour, and since the sample code is supposed to be correct, is the usb key broken or I'm missing something?

Thanks.

  • Different clocks?

  • exactly.

    if I use the watchdog as a timer, and I drive it via the master clock everything runs fine.

    however if I use the auxiliary clock the watchdog interrupt never trigger, or at least the interrupt service routine never run.

    since i don't recollect any caveat neither in the datasheet nor in the user guide of the msp430f2274, i'm starting to think that there is something wrong with the hardware.

    Could it be otherwise?

    thanks. 

  • The observed behavior you are experiencing is a combination of the MSP430F2274 and the hardware implementation on the eZ430-RF2500.  You should review both the MSP430x2xx Family User's Guide (SLAU144) and the schematics of the eZ430-RF2500 found in the tools hardware guide (SLAU227). 

    The Basic Clock Module+ of the MSP430F2274, by default upon a Power Up Clear (PUC), configures the ACLK signal to be sourced by the LFXT1CLK (XIN/XOUT pins) as illustrated in Figure 5-1 and the description in Section 5.2.

    On the eZ430-RF2500 hardware, the XIN/XOUT are not connected to a crystal or clock source.  They are used as I/Os to the CC2500 device.

    Therefore, in the example code msp430x22x4_wdt_02.c, the Watchdog Timer input clock is sourced by ACLK, which is sourced by XIN/XOUT.  These are not a clock source on the eZ430-RF2500.  This means no active clock is supplied to the Watchdog timer, which then results in no interrupt generated.

  • I didn't see that coming.

    Thanks for the explanation.

    :) 

**Attention** This is a public forum