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.

CCS/CC2650: AFE4490 not recognizing SPI signals sent from CC2650

Part Number: CC2650
Other Parts Discussed in Thread: AFE4490,

Tool/software: Code Composer Studio

Hi,

I am trying to implement a pulse oximeter by using a custom PCB with CC2650 connected to AFE4490 by SPI. I began with an example project 'SimpleBLEPeripheral' and initiated an SPI task function to send SPI signals to the AFE4490. Although the signals are successfully being sent, I am having no luck receiving anything back from the AFE (on SOMI). 

Could I get some help regarding initialization for AFE4490? Is there a way to check if the AFE is up and running using SPI? Does the AFE require a specific number of clocks or require the SPISTE to be low for a certain period of time?

Any help would be greatly appreciated.

Thanks,

Jerin

 

  • Hello Jerin,

    Based on your description of the issue, it seems like the basic SPI write and read is not happening.

    Refer to the following thread, questions 7 through 9 for sign of life after AFE power up, example SPI timing waveform and possible initialization sequence. You may also refer to section 8.5 of the AFE4490 datasheet for SPI write and read sequence and timing diagram.

    e2e.ti.com/.../369445

    Once the SPI write and read is successful, then you may refer to Table 2 in the AFE4490 datasheet for the timing register values.
  • Hi Praveen,

    Thank you for our prompt reply. I have attached my code below:

    uint32_t getSPIData(uint32_t reg, uint32_t value) {
    uint32_t out = (reg&0xFF)<<24 | (value&0xFFFFFF);
    return out;
    }

    static Spi_taskFxn(UArg a0, UArg a1) {
    SPI_Handle handle;
    SPI_Params params;
    SPI_Transaction transaction;
    int txBuf[32]; // Transmit buffer
    int rxBuf[32]; // Receive buffer

    SPI_Params_init(&params);
    params.dataSize= 16;//By default configured as SPI_MASTER, SPI_MODE_BLOCKING, 8bits
    params.frameFormat = SPI_MW;
    params.bitRate = 1000000;


    handle = SPI_open(Board_SPI1, &params);

    // Configure the transaction
    uint32_t val = getSPIData(0, 8);
    transaction.txBuf = (void*)&val;

    transaction.count = 2;
    transaction.txBuf = (void*)&val;
    transaction.rxBuf = rxBuf;
    bool nStatus;

    while(1){
    nStatus = SPI_transfer(handle, &transaction);
    }

    }

    I cannot get the SPISTE to stay low for the entirety of the data transfer (32 clocks), as shown in the FAQ's page. Is there something wrong with my code? CS keeps coming back up after one clock pulse of 8 bits. I believe I am not getting anything back from the AFE as the data being sent through with the clock and CS aren't quite right. I am quite new to the TI-RTOS environment, so pardon me for this trouble.

    Thanks,
    Jerin
  • Hello Jerin,

    Thank you for sharing your SPI interface code.
    AFE4490 device requires SPISTE to stay low for 32 clock cycles to validate the SPI transaction. Short of it, the SPI communication is terminated.
    I have looped in the CC2650 team to help you with your code.

  • Hi Praveen,

    I was able to set the SPI communication properly, now I am get data back on SOMI. My issue was that the on the custom PCB, the ADC_PDN and DIAG_EN pin werent connected to the CC2650. The issue I am having now is with writing a program/app to get data back from the SFH7050 sensor. As I am trying to use this device for pulse oximeter applications and as Im running the simpleBleperipheral app, would it be best to copy the heart rate task over or is there another example code that I can use for this sensor to produce the right data?

    Thanks for your help,

    Jerin