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.

CC2510: PM2 and DMA Descriptor

Part Number: CC2510

HI,

I'm facing the issues related the given POWER MODE examples, in one of that example(PM2) the DMA Descriptor is included.

i was curious to know why it included although having no function of it, 

what if i does not include DMA descriptor ?

if it must be added for internal operations  then please suggest/help with me an example for PM2 with Radio Functions.

thanks :D

  • Not sure I understand what examples you are referring to.

    When putting the CC2510 into PM, you need to follow the procedure described in the errata note:

    There are also example code showing how the DMA is used to enter PM found here:

    BR

    Siri

  • i was trying use PM2 with Radio, 

    i want my device to be in PM2 for specific time and after wake up need to do Radio Task, in that i followed the Errata but facing  issues while changing the crystal, and with DMA. 

    i pasted my code in active mode but after downloading the code it never wake up from the PM2, although following errata,

    void main(void)
    {

    //halPowerClkMgmtSetMainClkSrc(CRYSTAL);

    volatile uint8 storedDescHigh = DMA0CFGH;
    volatile uint8 storedDescLow = DMA0CFGL;
    volatile int8 temp;
    P1SEL &= ~(BIT3 | BIT0);
    P1_0 = 1; P1_3 = 1;
    P1DIR |= (BIT3 | BIT0);

    setup_sleep_interrupt();


    Channel = 0x05;
    radioConfigure(DataRate, Freq);
    while(1){


    //=============================== CLOCK SETUP ==============================//

    SLEEP &= ~SLEEP_OSC_PD;
    while( !(SLEEP & SLEEP_HFRC_S) );
    CLKCON = (CLKCON & ~CLKCON_CLKSPD) | CLKCON_OSC | CLKSPD_DIV_2;
    while ( !(CLKCON & CLKCON_OSC) ) ;
    SLEEP |= SLEEP_OSC_PD;

    // Set LS XOSC as the Sleep Timer clock source (CLKCON.OSC32 = 0)
    CLKCON &= ~CLKCON_OSC32;

    //=================================active-mode==========================================//

    halPowerClkMgmtSetMainClkSrc(CRYSTAL);
    printf("\n ch:%x",MARCSTATE); //DEVICE STATUS
    RFST = STROBE_RX; //sending RX strobe For CCA
    while(!(MARCSTATE & 0x0D)); //wait unitll itgoes in Recive mode !
    printf("\n after ch:%x",MARCSTATE); //Read MARCSTATE To Check device is in Recieve mode 
    printf("\n pkt ch:%x",PKTSTATUS); 
    while(!(PKTSTATUS & CCA_FLAG)); //if channel is clear then send the BYTES 
    RAD_MODE_TX();
    halWait(200);
    halWait(100);

    storedDescHigh = DMA0CFGH;
    storedDescLow = DMA0CFGL;
    DMAARM |= (DMAARM_ABORT | DMAARM0);

    // Update descriptor with correct source.
    dmaDesc[0] = (uint16)&PM2_BUF >> 8;
    dmaDesc[1] = (uint16)&PM2_BUF;
    // Associate the descriptor with DMA channel 0 and arm the DMA channel
    DMA0CFGH = (uint16)&dmaDesc >> 8;
    DMA0CFGL = (uint16)&dmaDesc;
    DMAARM = DMAARM0;

    WORCTRL =0x05;
    temp = WORTIME0;
    while(temp == WORTIME0);

    // Set Sleep Timer Interval
    WOREVT1 = EVENT0_HIGH;
    WOREVT0 = EVENT0_LOW;

    // Make sure HS XOSC is powered down when entering PM{2 - 3} and that
    // the flash cache is disabled.
    MEMCTR |= MEMCTR_CACHD;
    SLEEP = 0x06;

    // Enter power mode as described in chapter "Power Management Control"
    // in the data sheet. Make sure DMA channel 0 is triggered just before
    // setting [PCON.IDLE].
    asm("NOP");
    asm("NOP");
    asm("NOP");
    if(SLEEP & 0x03)
    {
    asm("MOV 0xD7,#0x01"); // DMAREQ = 0x01;
    asm("NOP"); // Needed to perfectly align the DMA transfer.
    asm("ORL 0x87,#0x01"); // PCON |= 0x01 -- Now in PM2;
    asm("NOP"); // First call when awake
    }
    // End of timing critical code

    // Enable Flash Cache.
    MEMCTR &= ~MEMCTR_CACHD;

    // Update DMA channel 0 with original descriptor and arm channel if it was
    // in use before PM was entered.
    DMA0CFGH = storedDescHigh;
    DMA0CFGL = storedDescLow;
    DMAARM = DMAARM0;
    // Wait until HS RCOSC is stable
    while(!(SLEEP & SLEEP_HFRC_S));

    // Set LS XOSC as the clock oscillator for the Sleep Timer (CLKCON.OSC32 = 0)
    CLKCON &= ~CLKCON_OSC32;
    // halPowerClkMgmtSetMainClkSrc(CRYSTAL);
    }
    }

    and while if i run the simple LED toggle it works fine. 

  • I suggest that you start with the example I referred to and make sure that it works as it should before you start doing modifications.

    Once you have confirmed that it work as expected, you can add features, one by one, and verify that the code still work, until you see the problem again. That way it is easier to figure out what is wrong.

    After confirming that the original code woks as it should, you can add turning on and off the HS XOSC. Please make sure that you are following the errata note when doing this. There is an issue (Issue 3) related to the XOSC_STABLE assertion:

    BR

    Siri