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.

CC2640R2F: LAUNCHXL-CC2640R2:

Part Number: CC2640R2F
Other Parts Discussed in Thread: LAUNCHXL-CC2640R2

How to read wakeup signal at cc2640r2f

the external device is send wakeup high signal to cc2640r2f

we want to read this wakeup signal at cc2640r2f

I also try this function

PIN_getInputValue(pinId)

or 

 GPIO_setConfig(Board_DIO22, GPIO_CFG_INPUT);

GPIO_setConfig(IOID_12, GPIO_CFG_INPUT);

GPIO_setConfig(Board_DIO15, GPIO_CFG_INPUT);

while(1){

{

wakeupread = GPIO_readDio(Board_DIO22);

wakeupread1 = GPIO_read(Board_DIO22);

wakeupread2 = GPIO_readDio(Board_DIO15);

wakeupread3 = GPIO_readDio(IOID_12);

}

  • Hello Akshay,

    Please refer to the PIN and GPIO TI Drivers Runtime APIs as well as the pinInterrupt and gpioInterrupt examples.

    Regards,
    Ryan

  • Thanks Ryan for quick replay 

    we used  the pinInterrupt and gpioInterrupt examples.

    PIN_Config buttonPinTable[] = {
    Board_DIO12 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
    Board_DIO15 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
    PIN_TERMINATE
    };

    /*
    * ======== buttonCallbackFxn ========
    * Pin interrupt Callback function board buttons configured in the pinTable.
    * If Board_PIN_LED3 and Board_PIN_LED4 are defined, then we'll add them to the PIN
    * callback function.
    */
    void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) {
    uint32_t currVal = 0;

    /* Debounce logic, only toggle if the button is still pushed (low) */
    CPUdelay(8000*50);
    if (!PIN_getInputValue(pinId)) {
    /* Toggle LED based on the button pressed */
    switch (pinId) {
    case Board_DIO12:
    currVal = PIN_getOutputValue(Board_PIN_LED0);
    PIN_setOutputValue(ledPinHandle, Board_PIN_LED0, !currVal);
    break;

    case Board_DIO15:
    currVal = PIN_getOutputValue(Board_PIN_LED1);
    PIN_setOutputValue(ledPinHandle, Board_PIN_LED1, !currVal);
    break;

    default:
    /* Do nothing */
    break;
    }
    }
    }

    we replace button pin to DIO12 & DIO15.

    also we give external power 1.5v to that that pin    DIO15 &DIO12.

    board led will toggle its working.

    but when my other device is sending wakeup high signal to cc2640r2  led not toggling.

    we check wakeup high signal of other device at oscilloscope its 3.3v

    Any suggestion for me 

       

  • It seems the code is operational based on your tests.  Therefore, this behavior is likely a hardware issue.  Make sure a common GND is connected between your devices and that the CC2640R2 has the same power level (within 0.3 V) as the other device.

    Regards,
    Ryan

  • yes already did the common GND is connected between your devices and that the CC2640R2 has the same power level (within 0.3 V) as the other device.

  • Are you testing on a custom PCB or LAUNCHXL-CC2640R2?  I recommend that you further evaluate the differences between your external power source and other device.  Also, I imagine you would want your pin initialized as PIN_PULLDOWN | PIN_IRQ_POSEDGE if the wakeup signal is a low-to-high transition.  Currently, the interrupt would trigger on a high-to-low transition (as expected with the pushbuttons on the LaunchPad) which is perhaps how the 1.5 V signal triggers the interrupt by having enough delta from the supply voltage to put the pin into a low state.

    Regards,
    Ryan