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.

MSP430G2202: Programming the LMX2694 with MSP430

Part Number: MSP430G2202
Other Parts Discussed in Thread: MSP-TS430PW28A

Hi Team,

Can you please help us with our customer's inquiry below.

I am new to programming and thought I would reach out to you for some support / advice. I am using the MSP430G2202IPW20 with development board MSP-TS430PW28A to try to program your LMX2694 PLL chip.

I downloaded TICS PRO and used it to configure the LMX2694 to how I like it, and then exported the hex values that need to be written to all the registers in order for it to do what I want. 

I plan to use the SPI interface; can you show me what steps I need to take to write the exported hex values to all the 114 registers on the LMX2694? I have been having a hard time figuring out how to do that with current resources. I just need to write the hex values to the registers on the PLL and that is all. I have downloaded TI code composer. Thank you!

Regards,

Danilo

  • Hello Danilo,

    From an MSP430 perspective, you would nee dto write your own SPI driver to your target part. I'm not sure if it will work with the program you are referring to though.

    For resources on utilizing SPI on MSP430, please see the following: 
    MSP Academy - SPI Concepts -- has some other useful resources linked as well. 

    MSP430G2553 Standard SPI Example

    If you have further questions about the LMx2694 or its TICS PRO SW, I've moved this post to their owners forums to help you out. 

  • Thanks for your help, I had a followup question. Sorry if it seems like a stupid question:

    Here is the portion of code to initialize the GPIO:

    void initGPIO()
    {
    //LEDs
    P1OUT = 0x00; // P1 setup for LED & reset output
    P1DIR |= BIT0 + BIT5 + BIT6;

    //SPI Pins
    P1SEL = BIT1 + BIT2 + BIT4;
    P1SEL2 = BIT1 + BIT2 + BIT4;

    //Button to initiate transfer
    P1DIR &= ~(BIT3);
    P1OUT |= BIT3; // P1.3 pull up
    P1REN |= BIT3; // P1.3 pull up/down resistor enable
    P1IE |= BIT3; // P1.3 interrupt enabled
    P1IES |= BIT3; // P1.3 Hi/lo edge
    P1IFG &= ~BIT3; // P1.3 IFG cleared
    }

    For the P1OUT and P1DIR, am I correct in presuming that the above 2 lines of code under the "//LEDs" comment is setting the entire port 1 to be low (0V?), 

    Also, are the two lines of code underneath "//SPI Pins" setting P1.0, P1.5, and P1.6 to be outputs? Thank you so much!

  • Sorry, I had a typo in my above comment. I meant to ask:

    For the P1OUT and P1DIR, am I correct in presuming that the above 2 lines of code under the "//LEDs" comment is setting the entire port 1 to be low (0V?), while setting P1.0, P1.5, and P1.6 to be outputs?

    What are the two lines of code underneath the "//SPI Pins" doing? Are they setting P1.1, P1.2, and P1.4 to have 1s at their SEL and SEL2 registers? Thank you!

  • Hello Mike,

    By just using the "=" you are assigning that whole register ( and thus port in this case), to the value on the right side. It is recommended to utilize "|=" for setting bits in a  register, and "&= ~(x)" , where x is your bit, in order to make sure you don't override settings possibly setup in other areas in code. 

  • Thank you Jace! 

    Just to confirm I am understanding, that would mean the lines:

    P1SEL = BIT1 + BIT2 + BIT4;
    P1SEL2 = BIT1 + BIT2 + BIT4;

    Is setting P1.1SEL, P1.2SEL, P1.4SEL, P1.1SEL2, P1.2SEL2, and P1.4SEL2 to have values of 1? 

    Would this be equivalent to saying:

    P1SEL = 00010110;

    P1SEL2 = 00010110;?

    Thank you!

  • Correct

  • Thanks for all your help so far Jace! I had another question, the UCSSEL register has the following configuration option for bits 7 and 6:

    USCI clock source select. These bits select the BRCLK source clock
    in master mode. UCxCLK is always used in slave mode.
    00b = Reserved
    01b = ACLK
    10b = SMCLK
    11b = SMCLK

    If I wanted SMCLK, would either the 10 or 11 work for bits 7 and 6 for that UCSSEL register? What is the difference between the two or are they exactly the same? Thank you!

  • Hello Mike,

    They are the same.

**Attention** This is a public forum