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.

MSP430FR4133: Communication via SPI with an external ADC MCP3002

Part Number: MSP430FR4133
Other Parts Discussed in Thread: CODECOMPOSER

HELLO!

I am working on MSP430FR4133 and I am trying to communicate with an external ADC MCP3002 via SPI in order to sample an input signal and then to show the ADC value in the LCD of its LaunchPad

                        MSP430                  MCP3002

SCLK               P5.1                       -> CLK Pin 7       

MOSI               P5.2                       -> D_In Pin 5

MISO               P5.3 ​                     ​<-D_Out Pin 6

CS                   P5.0                       -> Cs Pin 1 (or CS -> GND)

In order to read a sample from the ADC, the Master must write 0110 0000 0000 0000 on the MOSI line (Start Bit = 1, SGL/DIFF = 1, ODD/SIGN = 0, MSBF = 0), see Table 5-1 of the MCP3002 data sheet.

The Slave (the ADC) responds with the sample value on the MISO line. Example: 0000 0010 0000 0110 = 0x02 06 (hex) = 518 (decimal). The bits marked are the 10 bit sample value.

The is I couldn't figure it how to communicate with the external ADC I tried to work with the software examples provided in the datasheet but it didn't work so good with me since I am new with Codecomposer. 

This is my last hope no one could help me so I hope you can. I would appreciate your help

LaunchPAD user s guide: LaunchPAD https://www.ti.com/lit/ug/slau595b/slau595b.pdf?ts=1623242949525&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FMSP430FR4133

datasheet of msp430FR4133:  ti.com/lit/ds/symlink/msp430fr4133.pdf?ts=1623307760232&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FMSP430FR4133

Family user s guide:  www.ti.com/.../slau445i.pdf

MCP3002 Datasheet: www.farnell.com/.../1599363.pdf

  • Hi Aya,

    How are you configuring the SPI clock phase and polarity on the msp?  If you look at the MCP3002 datasheet, pages 17,18, it shows it supports mode (0,0) and mode (1,1).  Check the value you are using in the MSP430 CTLW0 register.  Make sure they are either both '0' or both '1'

  • Hello Aya,

    It's been a while since we have heard from you, so I'm going to assume you were able to move forward with your project.
    I will mark this posting as RESOLVED, but if this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread is locked, please click the "Ask a related question" button, and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

**Attention** This is a public forum