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.

SPI WITH MSP430F2012

Other Parts Discussed in Thread: MSP430F2012

Hi, I need help me anyone, I want to use SPI module of msp430f2012 but I don´t know how I have to write the rutine in IAR EMBEDDED, I want to use it how Master and send two data of 16 bits, but how do I use the registers SPI module?, thanks for help me

  • Please take a look at the MSP430 code examples for the MSP430F20xx devices (SLAC080).  In msp430x20x3_usi_02.c, you will find an example.

  • Hi,

        first read chapter 16 of msp430x2xx user's guide which gives u an idea of how to setup a spi communication between two device's. in what mode (i.e., three pin or four pin , make sure on which mode ur slave works i.e. from mode0-mode4) , with reference to examples in SLAC080 generate ur code.

    below is the site for ur user's guide:

    focus.ti.com.cn/cn/lit/ug/slau144e/slau144e.pdf

     

    Regards

    Kshatriya

  • Thanks for you answer but in this example only show me how a receive and I want to send or transmit data, could you say me how write the registers please? and how do I know when are transmiting data?

  • Giovanny Lopez said:

    Thanks for you answer but in this example only show me how a receive and I want to send or transmit data, could you say me how write the registers please?

    I disagree.  The msp430x20x3_usi_02.c example does transmit data in the universal_serial_interface(void) interrupt service routine.  The USISRL register written to is the USI Shift Register.

    Information about the USI peripheral found on the F2013 is in the MSP430x2xx Family User's Guide (SLAU144) in Chapter 14.

     

    Giovanny Lopez said:

    and how do I know when are transmiting data?

    I would access the USICNT register to see if the count value of bits to transmit is being decremented.  When the transfer is complete a flag will be set, USIIFG.

**Attention** This is a public forum