Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

TMS320C5535: SPI peripheral more than doubles current consumption

$
0
0

Part Number:TMS320C5535

I'm developing on a TMS320C5535 using the XDS110 debugger, the C5000 chip support library, and Code Composer version: 8.3.0.00009. I'm using the C5535 for a low-power application and was surprised to find that the C5535 was using about 70 mA of current when running at 100MHz with 1.3V. When I lower the frequency to 60MHz at 1.05V, the C5535 is drawing 60mA, which is extremely high according to what the datasheet claims. 

After some debugging, I have narrowed down what is making the DSP draw so much current. This is a simplified version of the code I'm running:

int main(void)
{
    /////////////* Variable/Structure Initializations */////////////
    /* System-level variables */
    CSL_Status SYS_status;

    /////////////* System Level Initializations */////////////
    SYS_status = SYS_PLL_LDO_init();
    SYS_status |= SYS_EBSR_init();
    SYS_status |= SYS_GPIO_init();

    
    status = SPI_init();

    // hspi_ADC and spiCfg_ADC are global structs
    hspi_ADC->configured = FALSE;
    hspi_ADC->mode = SPI_CS_NUM_0;
    hspi_ADC->opMode = SPI_POLLING_MODE;

    /* Set the hardware configuration */
    spiCfg_ADC.spiClkDiv  = 20;
    spiCfg_ADC.wLen       = SPI_WORD_LENGTH_32;
    spiCfg_ADC.frLen      = 1;
    spiCfg_ADC.wcEnable   = SPI_WORD_IRQ_DISABLE;
    spiCfg_ADC.fcEnable   = SPI_FRAME_IRQ_DISABLE;
    spiCfg_ADC.csNum      = SPI_CS_NUM_0;
    spiCfg_ADC.dataDelay  = SPI_DATA_DLY_0;
    spiCfg_ADC.csPol      = SPI_CSP_ACTIVE_LOW;
    spiCfg_ADC.clkPol     = SPI_CLKP_LOW_AT_IDLE; // SPI MODE 1
    spiCfg_ADC.clkPh      = SPI_CLK_PH_RISE_EDGE;

    SYS_status |= SPI_config(hspi_ADC, &spiCfg_ADC);


    /////////////* Infinite Loop */////////////
    while (1)
    {


    } // while()
} // main()

This codes causes the DSP at 100MHz to draw 70mA and 60MHz to draw 60mA, which is a crazy amount of current for a low power application.

However, I then comment out the SPI_init():
CSL_Status SYS_SPI_init(){

    CSL_Status status;

    //status = SPI_init();

    hspi_ADS->configured = FALSE;
    hspi_ADS->mode = SPI_CS_NUM_0;
    hspi_ADS->opMode = SPI_POLLING_MODE;

    . 
    . 
    . 

With SPI_init() commented out, the current consumption is now much more reasonable:

100MHz draws about 20mA, 60Mhz draws about 13mA

Why is the SPI peripheral being such a power hog? I even changed the SPI clock frequency from 5MHz to 100kHz, but the large current draw of 70mA/60mA persists. 

One of the ways I tried to get around this was to uninitialized SPI when I'm done using SPI:

{
    /////////////* Variable/Structure Initializations */////////////
    /* System-level variables */
    CSL_Status SYS_status;

    /////////////* System Level Initializations */////////////
    SYS_status = SYS_PLL_LDO_init();
    SYS_status |= SYS_EBSR_init();
    SYS_status |= SYS_GPIO_init();

    
    status = SPI_init();

    // hspi_ADC and spiCfg_ADC are global structs
    hspi_ADC->configured = FALSE;
    hspi_ADC->mode = SPI_CS_NUM_0;
    hspi_ADC->opMode = SPI_POLLING_MODE;

    /* Set the hardware configuration */
    spiCfg_ADC.spiClkDiv  = 20;
    spiCfg_ADC.wLen       = SPI_WORD_LENGTH_32;
    spiCfg_ADC.frLen      = 1;
    spiCfg_ADC.wcEnable   = SPI_WORD_IRQ_DISABLE;
    spiCfg_ADC.fcEnable   = SPI_FRAME_IRQ_DISABLE;
    spiCfg_ADC.csNum      = SPI_CS_NUM_0;
    spiCfg_ADC.dataDelay  = SPI_DATA_DLY_0;
    spiCfg_ADC.csPol      = SPI_CSP_ACTIVE_LOW;
    spiCfg_ADC.clkPol     = SPI_CLKP_LOW_AT_IDLE; // SPI MODE 1
    spiCfg_ADC.clkPh      = SPI_CLK_PH_RISE_EDGE;

    SYS_status |= SPI_config(hspi_ADC, &spiCfg_ADC);

// Send SPI Bytes send_SPIdata();

// Stop SPI peripheral
SPI_deInit(); /////////////* Infinite Loop *///////////// while (1) { } // while() } // main()

Even after using SPI_deinit() the current consumption of the C5535 stays at 70mA/60mA. I'm really trying to get as close to 10mA as possible. Are there any suggestions for how I can reduce the power consumption of the SPI peripheral? 

Best, 

Eddie


Viewing all articles
Browse latest Browse all 262198

Trending Articles