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.

CPU operation during peripheral usage

Other Parts Discussed in Thread: MSP430F5529

I am using an MSP430F5529 to sample, convert, and store sensor data. This data is acquired through both ADC and SPI (or I2C). Because of the intense timing constraints of the project, I want to be able to perform CPU operations for converting the data I have while concurrently receiving data from other sensors. In all of the TI Resource Explorer example programs, the microcontroller is put into LPM while doing an ADC conversion or sending SPI/I2C data. I want to be able to utilize the CPU during these times. I have sought information through online searches and datasheets regarding the topic; however, I can find no information that says conclusively whether the MSP430 is able to do this or not. As a plus, I would really like to be able to both sample the ADC and receive data via SPI/I2C at the same time while also utilizing the CPU.

Thank you in advance for your help.

  • Yes, I can confirm this can be done.  The examples place the MSP430 into a LPM to showcase the low power aspects of this device family architecture, which is one of the key aspects of the family.

    However, if you don't want to place the CPU in a low power mode, you are not obligated to do so.  And yes, when it is not in a low power mode, the CPU can continue executing code.

  • Brandon,

    Thank you for your response. I am glad this can be done. Are there any TI example codes to show a typical control flow? I am especially interested in SPI. I tried to implement and test this using I2C last week with strange results. The I2C waveform would stop after a few bits. Is this merely a timing issue where I need to handle the interrupt faster?

    Thank you again.

    Edit: I am also interested in the possibility of using more than one SPI module at once. Is this possible? 

  • Brandon Gardner said:
    Are there any TI example codes to show a typical control flow?

    There isn't because ther ei sno typical control flow. It dpeends on your applicaiton and othe rrequirements how to implement it.
    You may do busy.-waiting, state machine or interrupt-controlled flows. You may even utilize the DMA to trigger certain hardware actions when a peripheral is done with its job.

    Be creative! The MSP is a playgound full of tools and htere is no predescription of how to combine these tools.

    Brandon Gardner said:
    The I2C waveform would stop after a few bits.

    For each individual peripheral, trhere is a mostly complete description on how it works. I2C is one of the msot complex ones :)
    Common reasons for I2C stopping is that you didin't perform an action that is required to continue. Like reading the last received byte before the last bit of the next byte can be received (to avoid an overflow). Or not writing to TXBUF, so it stops and waits before pulling the ACK form the slave (this is to allow you to set a stop instead if you don't want to send anything and jsu twant to check for the slave presence).

    However, this is documented in text and diagrams in the users guide.

**Attention** This is a public forum