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.

CC430F5137

Other Parts Discussed in Thread: CC430F5137, MSP-EXP430FR5739

Hy!

I designed a radio with CC430F5137 MCU. I was able to download(with CCS5) the code through the msp-exp430fr5739 programmer and I was also able to read it back (with Lite-FET Pro430), but the code dont get executed because I programmed it to blink a LED, but it did not obey me, nor it puts high level voltage to any other pins (checked by voltmeter) .

I dont have  32.768 Khz XT1CLK mounted on my PCB, maybe thats the problem because by default the sys clock works from XT1 after PUR  but since I dont have XT1 the code dont get executed ,I suspect. Though, I have XT2 with 26 Mhz crytal....

And programming is of course works since Spy-Bi-wire clk is sourced from the master programmer.

Am I enlightened with these statements?

Can anyone help me how to get around this problem?

Maybe I should wire somehow a 32.768 Khz clock to the corresponding pins to get this MCU up?

Thanks in advance,

Andrew

  • Andras Tamas Magyar said:
    I programmed it to blink a LED, but it did not obey me

    So it would be good to know your code.

    Andras Tamas Magyar said:
    I dont have  32.768 Khz XT1CLK mounted on my PCB, maybe thats the problem because by default the sys clock works from XT1 after PUR  but since I dont have XT1 the code dont get executed

    If there is no LFXT1 crystal, but you try to use it, REFO is used instead. However, if the code waits for XT1 coming up, it will of course wait forever then.

  • Here is my code:

    void main( void )
    {
    // Stop watchdog timer to prevent time out reset
    WDTCTL = WDTPW + WDTHOLD;

    UCSCTL3 |=0x20; //MCLK,SMLCK,ACLK is sourced from RFOCLK
    UCSCTL4 |=0x222;
    //UCSCTL6|=0xB000;


    P3DIR |= 0xff;
    //P3DS |= 0xff; // drive strength
    P3SEL |= 0x00;

    while(1)
    {
    P3OUT|= 0xff ; //  p3.4 where the led is mounted on but I set all the pins to high level

    }

    }

    There is absolutely no reference that if there's no Xt1 it changes to RFOCLK, thas why Ii changed it...

    Help please!!

  • After the code is loaded into Flash, did you try to cycle the power to start the code running?

    BTW, You habit of using |= is a little strange. What does P3SEL |= 0; do? And why P3DIR |= 0xff;?

  • Andras Tamas Magyar said:
    There is absolutely no reference that if there's no Xt1 it changes to RFOCLK,

    see the 'fail-safe operation' section of the clock system chapter in the users guide:

    "If a fault is detected for the oscillator sourcing MCLK, MCLK is automatically switched to the DCO for its clock source (DCOCLKDIV) for all clock sources except XT1 LF mode. If MCLK is sourced from XT1 in LF mode, an oscillator fault causes MCLK to be automatically switched to the REFO for its clock source (REFOCLK). This does not change the SELM bit settings. This condition must be handled by user software."

    This is the default situation after power-up and after the crystal is running, the fault flags must be cleared before LFXT1 is actually used.

    Andras Tamas Magyar said:
    P3OUT|= 0xff ; //  p3.4 where the led is mounted on but I set all the pins to high level

    This won't blink the LED. It sets the outputs to high. Over and over again (which doesn't do anything as they are already high).

    To blink, you shouldn't .or. but .eor. the pins:
    P3OUT ^= 0xff;

    however, the blink will happen with ~2.5kHz frequency, as the loop only takes 12 or 14 MCLK cycles.

  • What do you mean by cycling the power?

  • P3SEL sets the register to function as an I/O and PDIR sets the direction of the register, here output.

  • Andras Tamas Magyar said:
    What do you mean by cycling the power?

    Power off, then power on. Disconnect the supply, then reconnect it after a few seconds.
    'power cycle' is pretty much a standard term.

**Attention** This is a public forum