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.

LAUNCHXL-CC2650: How to process a raw digital signal from an analog front end?

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650

Hi there,

I am new to TI platform. I am working on an RFID project and would like to process a raw digital signal at the output of an analog front end module. The module is controlled by logic inputs MOD and SHD. The digital data is obtained at the DEMOD_OUT of the module. I am not quite sure how to interface the module with the MCU.

The above link is the front end module being used in the project. Can someone give me suggestions on where I could start?

Best,

AM

  • It looks like that you can setup GPIO driver to communicate with this module. You can refer to PIN examples in dev.ti.com/.../ for GPIO usages.
  • Hi Yikai,
    I am not pretty clear with how to define and connect the pins on CC2650 to that the analog module.
    This is what I did for defining the pins.

    // READER PIN CONFIGURATON

    #define RDY_CLK BOARD_DIO21 //Input - for clock sync - give input clock for cc2650?
    #define DEMOD_PIN BOARD_DIO22 //Input - get data signal here
    #define MOD BOARD_DIO12 //Output - to control EM4095
    #define SHD BOARD_DIO15 //Output - to control EM4095 - high or low decides the antenna power o


    //PIN Configuration

    PIN_Config pinTable[] = {

    Board_DIO12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //MOD
    Board_DIO15 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //SHD
    Board_DIO21 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //RDY_CLK
    Board_DIO22 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //DEMOD_OUT
    PIN_TERMINATE

    };
  • This looks OK. Have you implemented some code and started testing? If you have, and you experience problems, please explain what you are trying to do and what you are observing. We cannot implement any code for you, but if you have something that does not work we can try to figure out why. You should take a look at this pinInterrupt example and make a small test code where you verify that you are able to for example receive interrupt on DIO21 and DIO22, as I assume you are going to use them for interrupts.

    Siri
  • Hi Siri,
    Thank you for taking a look at the code. I am yet to implement a test code to process the raw signal. But I am a little confused with the project architecture in project zero. I am building my application in project zero as I was suggested by one of the forum members to do so as I want to add bluetooth functionality to the application in a later stage. I don't see a main. I am assuming that an event in the project has been defined as the application main loop. Do I just follow the pinterrupt example to receive interrupts?

    I will first try to generate a test code to see if I m receiving an interrupt based on the pinInterrupt example, and I will get back to you guys. Thanks.

    Best,
    Azim

  • The pin interrupt exmaple will toggle the two LEDs based on which button on the board is pushed. I would start by connecting your HW to the 4 pins you have selected and verify that you can control DIO12 and DIO15 from the mainThread in pinInterrupt.c. When you have verified that you can control these signals you can replace Board_PIN_BUTTON0 and Board_PIN_BUTTON1 with DIO21 and DIO22 and have the LEDs blink when you get interrupt from the EM4095. When all this works you can start to process the data properly.
  • 
    

    Hi Siri,

    This is what I did. I am not sure, if this is correct. But could you take a look at the code.



    /* * ======== pinInterrupt.c ======== */ /* XDCtools Header files */ #include <xdc/std.h> #include <xdc/runtime/System.h> /* BIOS Header files */ #include <ti/sysbios/BIOS.h> #include <ti/drivers/Power.h> #include <ti/drivers/power/PowerCC26XX.h> /* TI-RTOS Header files */ #include <ti/drivers/PIN.h> #include <ti/drivers/pin/PINCC26XX.h> /* Example/Board Header files */ #include "Board.h" /* Pin driver handles */ static PIN_Handle buttonPinHandle; static PIN_Handle ledPinHandle; static PIN_Handle rdyclkPinHandle; static PIN_Handle demodPinHandle; /* Global memory storage for a PIN_Config table */ static PIN_State buttonPinState; static PIN_State ledPinState; static PIN_State rdyclkPinState; static PIN_State demodPinState; /* * Initial LED pin configuration table * - LEDs Board_LED0 is on. * - LEDs Board_LED1 is off. */ PIN_Config ledPinTable[] = { Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //led red Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //led green PIN_TERMINATE }; /* * Application button pin configuration table: * - Buttons interrupts are configured to trigger on falling edge. */ PIN_Config buttonPinTable[] = { Board_BUTTON0 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, Board_BUTTON1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //IOID21 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //IOID22 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, PIN_TERMINATE }; PIN_Config em4095PinTable[] = { Board_DIO12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //MOD Board_DIO15 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, //SHD Board_DIO21 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //RDY_CLK Board_DIO22 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //DEMOD_OUT PIN_TERMINATE }; /* * ======== buttonCallbackFxn ======== * Pin interrupt Callback function board buttons configured in the pinTable. * If Board_LED3 and Board_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_DIO21: currVal = PIN_getOutputValue(Board_DIO21); PIN_setOutputValue(ledPinHandle, Board_LED0, !currVal); //System_printf("RDY_CLK VALUES/n"); break; case Board_DIO22: currVal = PIN_getOutputValue(Board_DIO22); PIN_setOutputValue(ledPinHandle, Board_LED1, !currVal); //System_printf("DEMOD_OUT VALUE/n"); break; default: //System_printf("IDLE STATE/n"); /* Do nothing */ break; } } } /* * ======== main ======== */ int main(void) { /* Call board init functions */ Board_initGeneral(); /* Open LED pins */ ledPinHandle = PIN_open(&ledPinState, ledPinTable); if(!ledPinHandle) { System_abort("Error initializing board LED pins\n"); } buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable); if(!buttonPinHandle) { System_abort("Error initializing button pins\n"); } rdyclkPinHandle = PIN_open(&rdyclkPinState, em4095PinTable); if(!rdyclkPinHandle) { System_abort("Error initializing rdy clk pin\n"); } demodPinHandle = PIN_open(&demodPinState, em4095PinTable); if(!demodPinHandle) { System_abort("Error initializing demod pin\n"); } /* Setup callback for button pins */ if (PIN_registerIntCb(buttonPinHandle, &buttonCallbackFxn) != 0) { System_abort("Error registering button callback function"); } /* Start kernel. */ BIOS_start(); return (0); }

    And I get this in the console:

    [Cortex_M3_0] Error initializing demod pin
    Error initializing demod pin

    And the red LED is ON(at all times)

    AZM

  • I modified the pinInterrupt example for you so that it uses IOID12 and IOID_15 as control signals and IOID21 and IOID22 as inputs from the em4095

    The code is below:

    /* Pin driver handles */
    static PIN_Handle em4095InputPinHandle;
    static PIN_Handle controlPinHandle;
    
    /* Global memory storage for a PIN_Config table */
    static PIN_State em4095InputPinState;
    static PIN_State controlPinState;
    
    /*
     * Initial control signals for EM4095
     */
    PIN_Config controlPinTable[] = {
        IOID_12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        IOID_15 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW  | PIN_PUSHPULL | PIN_DRVSTR_MAX,
        PIN_TERMINATE
    };
    
    /*
     * Application button pin configuration table:
     *   - Buttons interrupts are configured to trigger on falling edge.
     */
    PIN_Config em4095InputPinTable[] = {
        IOID_21  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
        IOID_22  | 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 em4095InputCallbackFxn(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 IOID_21:
                    currVal =  PIN_getOutputValue(IOID_12);
                    PIN_setOutputValue(controlPinHandle, IOID_12, !currVal);
                    break;
    
                case IOID_22:
                    currVal =  PIN_getOutputValue(IOID_15);
                    PIN_setOutputValue(controlPinHandle, IOID_15, !currVal);
                    break;
    
                default:
                    /* Do nothing */
                    break;
            }
        }
    }
    
    /*
     *  ======== mainThread ========
     */
    void *mainThread(void *arg0)
    {
    
        /* Open LED pins */
        controlPinHandle = PIN_open(&controlPinState, controlPinTable);
        if(!controlPinHandle) {
            /* Error initializing board LED pins */
            while(1);
        }
    
        em4095InputPinHandle = PIN_open(&em4095InputPinState,em4095InputPinTable);
        if(!em4095InputPinHandle) {
            /* Error initializing button pins */
            while(1);
        }
    
        /* Setup callback for button pins */
        if (PIN_registerIntCb(em4095InputPinHandle, &em4095InputCallbackFxn) != 0) {
            /* Error registering button callback function */
            while(1);
        }
    
        /* Loop forever */
        while(1) {
            sleep(1000);
        }
    }

    BR

    Siri

  • Hi Siri,

    Thank you for taking time to look into this. I see that you have used a sleep(). Isn't that a unix command? I tried including a unistd.h but it doesnt seem to solve the warning. Also, could you tell me the difference between main and main*Thread? Can a program have both of these?

    Build O/P

    **** Build of configuration Debug for project pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128 ****
    
    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O 
     
    making ../src/sysbios/rom_sysbios.aem3 ...
    gmake[1]: Nothing to be done for 'all'.
    Building file: "../pinInterrupt.c"
    Invoking: ARM Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=vfplib -me --include_path="C:/ti/workspace_peeva/pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128" --include_path="C:/ti/workspace_peeva/pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --define=ccs -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --preproc_with_compile --preproc_dependency="pinInterrupt.d_raw" --cmd_file="configPkg/compiler.opt" "../pinInterrupt.c"
    "../pinInterrupt.c", line 250: warning #225-D: function "Sleep" declared implicitly
    Finished building: "../pinInterrupt.c"
     
    making ../src/sysbios/rom_sysbios.aem3 ...
    gmake[2]: Nothing to be done for 'all'.
    Building target: "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out"
    Invoking: ARM Linker
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=vfplib -me --define=ccs -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.map" --heap_size=0 --stack_size=256 -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/lib" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128_linkInfo.xml" --rom_model -o "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out" "./CC2650_LAUNCHXL.obj" "./ccfg.obj" "./pinInterrupt.obj" "../CC2650_LAUNCHXL.cmd" -l"configPkg/linker.cmd" -l"C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/bin/ccs/driverlib.lib" -llibc.a 
    <Linking>
    Finished building target: "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out"
     
    
    **** Build Finished ****
    

    Best,

    Azim

  • Siri,

    i tried making some changes by including headers and making some changes to view  the output. I am not sure what to expect from pins except some raw unprocessed digital data.

    /*
     * Copyright (c) 2015-2016, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /*
     *  ======== pinInterrupt.c ========
     */
    
    #ifdef _WIN64
    #include <windows.h>
    else
    #include <unistd.h>
    #endif
    
    /* XDCtools Header files */
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    
    /* BIOS Header files */
    #include <ti/sysbios/BIOS.h>
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    
    /* TI-RTOS Header files */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    /* Example/Board Header files */
    #include "Board.h"
    
    /* Pin driver handles */
    static PIN_Handle buttonPinHandle;
    static PIN_Handle ledPinHandle;
    //static PIN_Handle rdyclkPinHandle;
    //static PIN_Handle demodPinHandle;
    
    /* Global memory storage for a PIN_Config table */
    static PIN_State buttonPinState;
    static PIN_State ledPinState;
    
    //Sleep(sometime_in_millisecs);
    extern unsigned int sleep(unsigned int mseconds);
    /*void sleep(unsigned int mseconds)
    {
        clock_t goal = mseconds + clock();
        while (goal > clock())
            ;
    }*/
    
    //static PIN_State rdyclkPinState;
    //static PIN_State demodPinState;
    
    /*
     * Initial LED pin configuration table
     *   - LEDs Board_LED0 is on.
     *   - LEDs Board_LED1 is off.
     */
    PIN_Config ledPinTable[] = {
        Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, //led red
        Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW  | PIN_PUSHPULL | PIN_DRVSTR_MAX, //led green
        PIN_TERMINATE
    };
    
    /*
     * Application button pin configuration table:
     *   - Buttons interrupts are configured to trigger on falling edge.
     */
    PIN_Config buttonPinTable[] = {
        Board_BUTTON0  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
        Board_BUTTON1  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
        //IOID21 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
        //IOID22 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE,
        PIN_TERMINATE
    };
    
    
    
    /*
     *  ======== buttonCallbackFxn ========
     *  Pin interrupt Callback function board buttons configured in the pinTable.
     *  If Board_LED3 and Board_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_BUTTON0:
                    currVal =  PIN_getOutputValue(Board_LED0);
                    PIN_setOutputValue(ledPinHandle, Board_LED0, !currVal);
                    //System_printf("RDY_CLK VALUES/n");
                    break;
    
                case Board_BUTTON1:
                    currVal =  PIN_getOutputValue(Board_LED1);
                    PIN_setOutputValue(ledPinHandle, Board_LED1, !currVal);
                    //System_printf("DEMOD_OUT VALUE/n");
                    break;
    
                default:
    
                    //System_printf("IDLE STATE/n");
                    // Do nothing
                    break;
            }
        }
    }
    
    
    
    
    
    /* Pin driver handles */
    static PIN_Handle em4095InputPinHandle;
    static PIN_Handle controlPinHandle;
    
    /* Global memory storage for a PIN_Config table */
    static PIN_State em4095InputPinState;
    static PIN_State controlPinState;
    
    /*
     * Initial control signals for EM4095
     */
    PIN_Config controlPinTable[] = {
        IOID_12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,//MOD
        IOID_15 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW  | PIN_PUSHPULL | PIN_DRVSTR_MAX,//SHD
        PIN_TERMINATE
    };
    
    /*
     * Application button pin configuration table:
     *   - Buttons interrupts are configured to trigger on falling edge.
     */
    PIN_Config em4095InputPinTable[] = {
        IOID_21  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //DEMOD_OUT
        IOID_22  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_NEGEDGE, //RDY_CLK
        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 em4095InputCallbackFxn(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 IOID_21://DEMOD_OUT
                    currVal =  PIN_getOutputValue(IOID_15);
                    PIN_setOutputValue(controlPinHandle, IOID_15, !currVal);
                    break;
    
                case IOID_22://RDY_CLK
                    currVal =  PIN_getOutputValue(IOID_15);
                    PIN_setOutputValue(controlPinHandle, IOID_15, !currVal);
                    break;
    
                default:
                    /* Do nothing */
                    break;
            }
        }
    }
    
    /*
     *  ======== mainThread ========
     */
    void em4095_process(void)
    //int main(void)
    {
    
        //Open LED pins
        controlPinHandle = PIN_open(&controlPinState, controlPinTable);
        if(!controlPinHandle) {
            // Error initializing board LED pins
            System_abort("Error initializing control pins\n");
            while(1);
        }
    
        else{
    
            System_printf("Control Setup Success\n");
        }
    
        em4095InputPinHandle = PIN_open(&em4095InputPinState,em4095InputPinTable);
        if(!em4095InputPinHandle) {
            // Error initializing button pins
            System_abort("Error initializing em4095 pins\n");
            while(1);
        }
    
        else{
    
            System_printf("EM4095 Pins Active\n");
        }
    
        // Setup callback for button pins
        if (PIN_registerIntCb(em4095InputPinHandle, &em4095InputCallbackFxn) != 0) {
            // Error registering button callback function
            while(1);
        }
    
        // Loop forever
        while(1) {
            sleep(1000);
        }
    
        //BIOS_start();
    
        //return(0);
    }
    
    //  ======== main ========
    int main(void)
    {
        // Call board init functions
        Board_initGeneral();
    
        em4095_process();
    
        // Open LED pins
        ledPinHandle = PIN_open(&ledPinState, ledPinTable);
        if(!ledPinHandle) {
            System_abort("Error initializing board LED pins\n");
        }
    
        else{
            System_printf("LED pins initialized\n");
        }
    
        buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
        if(!buttonPinHandle) {
            System_abort("Error initializing button pins\n");
        }
        else{
            System_printf("Button pins initialized\n");
        }
    
    
        //Setup callback for button pins
        if (PIN_registerIntCb(buttonPinHandle, &buttonCallbackFxn) != 0) {
            System_abort("Error registering button callback function\n");
        }
    
        /****************************************************/
        /* Open LED pins */
            /*controlPinHandle = PIN_open(&controlPinState, controlPinTable);
            if(!controlPinHandle) {
                // Error initializing board LED pins
                System_abort("Error initializing control pins\n");
                while(1);
            }
    
            else{
    
                System_printf("Control Setup Success\n");
            }
    
            em4095InputPinHandle = PIN_open(&em4095InputPinState,em4095InputPinTable);
            if(!em4095InputPinHandle) {
                // Error initializing button pins
                System_abort("Error initializing em4095 pins\n");
                while(1);
            }
    
            else{
    
                System_printf("EM4095 Pins Active\n");
            }
    
            // Setup callback for button pins
            if (PIN_registerIntCb(em4095InputPinHandle, &em4095InputCallbackFxn) != 0) {
                // Error registering button callback function
                while(1);
            }
    
            // Loop forever
            while(1) {
                sleep(1000);
            }
    */
    
    
        // Start kernel.
        BIOS_start();
    
        return (0);
    }
    

    Build O/P:

    **** Build of configuration Debug for project pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128 ****
    
    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O 
     
    making ../src/sysbios/rom_sysbios.aem3 ...
    gmake[1]: Nothing to be done for 'all'.
    making ../src/sysbios/rom_sysbios.aem3 ...
    gmake[2]: Nothing to be done for 'all'.
    Building target: "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out"
    Invoking: ARM Linker
    "C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=vfplib -me --define=ccs -g --diag_warning=225 --diag_warning=255 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -z -m"pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.map" --heap_size=0 --stack_size=256 -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/lib" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128_linkInfo.xml" --rom_model -o "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out" "./CC2650_LAUNCHXL.obj" "./ccfg.obj" "./pinInterrupt.obj" "../CC2650_LAUNCHXL.cmd" -l"configPkg/linker.cmd" -l"C:/ti/tirtos_cc13xx_cc26xx_2_20_01_08/products/cc26xxware_2_24_02_17393/driverlib/bin/ccs/driverlib.lib" -llibc.a 
    <Linking>
     
     undefined first referenced  
      symbol       in file       
     --------- ----------------  
     sleep     ./pinInterrupt.obj
     
    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out" not built
     
    >> Compilation failure
    makefile:144: recipe for target 'pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out' failed
    gmake[1]: *** [pinInterrupt_CC2650_LAUNCHXL_TI_CC2650F128.out] Error 1
    makefile:140: recipe for target 'all' failed
    gmake: *** [all] Error 2
    
    **** Build Finished ****
    

    I am not sure, if I am moving in the right direction. Could you show me an example of how to serial output a variable on the console. I am able to print strings using system_printf.

    I am a little confused with the usage of *mainThread. If you noticed I still have the pinInterrupt application in the main loop.

    I tried shifting the main loop to control the 4095 but I get the error with the symbol "sleep" and I do not know how to serial print what is being received at the pins 21 and 22.

    .

    Best,

    Siri

  • Hi Siri,
    I made some changes to see the value of currVal. and this is what I get in the console:

    [Cortex_M3_0] Control Setup Success
    0
    EM4095 Pins Active
    0
    LED pins initialized
    0
    Button pins initialized
    0
  • The example I sent you was made for the CC13x0 using the simplelink_cc13x0_sdk_2_10_00_36. If you are using this, but porting it to CC2650 you should not have any problems with the sleep. If you are using tirtos_cc13xx_cc26xx_2_21_01_08, which has support for CC2650 you will see that there are no sleep function. You should not necessarily copy my code directly. I just wanted to show you the steps necessary to select the pins you wanted to use.
    I would recommend to take a look at SimpleLink Academy trainings found here:

    dev.ti.com/.../

    to learn more about RTOS concepts such as scheduling, semaphores, tasks using the RTOS support on the SimpleLink devices.
  • Hi Siri,
    I replaced the sleep function with

    CPUdelay(1e3);

    and Task_sleep(1000 * (1000 / Clock_tickPeriod));

    //Clock_tickPeriod = 10;

    I was able to introduce delay between the function loop and the tasks following the function loop in the main loop.

    I now have to see if I am receiving anything from those pins under currVal.

    Best,
    azm
  • Hi Siri,
    I connected the pins of the board to the respective pins of the analog module. I m trying to capture real time data and it's not happening. The currVal is still 0. Is my approach to the problem incorrect?

    Best,
    Azm
  • You code really does not make sense to me. As I said previously, the code was only meant to show how to set up the pins the way you wanted, not as an example for your real application.
    The test code I sent you have two output signal (the control signals you wanted), and two inputs that have interrupts (the input pins from the device you are communicating with).
    My code simply toggles the outputs every time there is an interrupt on the input. This to show that you get interrupt and that you are able to set outputs. You cannot set the control signals to your device in the callback. I assume the control signals (MOD and SHD) must be set a special way to enable the device to make it generate the DEMOD_OUT signals.
    To test your code you should start with the code I gave you to verify with a logic analyzer or scope that you get to the callback code every time you have a negative edge on DIO21 and DIO22 (do not connect the signals to the em4095, just input an external signal to the pins). Also monitor that you can set the control pins to 1 or 0 from your application.
    When this works you can connect the pins to the em4095. In your application you do not have to do anything other than settings MOD and SHD to whatever they should be to enable the device. In the callback you can for example toggle the LEDS or some other pins to see that you are actually getting interrupts from the em4095.
    When you have verified this, you can start processing the data you receive. For info on how this can be done, you should contact the manufacturer of the em4095.

    Siri
  • Hi Siri,
    Thank you for the response. I am not quite sure on how to implement the above. I will try to replicate the working of pinInterrupt which seems to be the closest resource I can follow on here. Yes, MOD and SHD are set differently. SHD is set high at power up and then low to put it (EM4095) in sleep mode. MOD is grounded as it's function serves for writing (via RF field) purposes. I think I will have to check manually via instrumentation to observe the pattern of signals at these pins. I assumed that the code you sent me actually captures raw data from those pins. (my bad). Would you know of any example that does the same or atleast close it?

    Also, I connected the cc2650 pins to another development board pins that has a COM port to read the signals going in and coming out of the EM4095. Does this kind of an interfacing cause any issues, considering the EM4095 on the board is controlled by an ATMEGA64?


    Best,
    AZM

  • Hi

    Unfortunately we do not have any other examples that can help your further. I think you should see if you can get some support from the manufacturer of the EM4095 to see if you could get some reference code and then you can try to port that code tot he CC2650.

    When it comes to connecting the different boards together I guess you need to make sure that the have common ground, and that the voltage level on the different inputs etc. are withing spec.

    BR
    Siri
  • Hi Siri,

    I did reach out to the manufacturer, but in vain. I started by working with an evauation kit (EMDB409) that uses the same analog front end(em4095) but on an AVR platform(ATMEGA64). A basic outline of the algorithm is known, however, there is so much more to it than just that. I will try figuring it out and will keep posted if I have any questions.


    Best,
    Azm