Other Parts Discussed in Thread: BOOSTXL-CC2650MA
Tool/software: Code Composer Studio
Hi all,
I want to run simple central project on CC2650MODA, using UART and GPIO to communicate with other device.
I have run simple central project on LaunchPad and it word well.
I try to run this project on CC2650MA, so I use "simple_central_cc2650em" project and change the predefined symbol to "BOOSTXL_CC2650MA".
However, I can not control GPIO for some unknown reason.
I have tried two ways to open GPIO.
The first way is open GPIO in simple_central.c. I open the PIN defined in BoardGpioInitTable after "SimpleBLECentral_init()" function.
"PIN_open(&self_define_pin_state, BoardGpioInitTable)" where "BoardGpioInitTable" is defined in "BOOSTXL_CC2650MA.c".
The second way is open GPIO in boead_key.c, by calling "hKeyPins = PIN_open(&keyPins, keyPinsCfg)".
Here is the way I open PIN in "boead_key.c" :
PIN_Config keyPinsCfg[] = { #if defined (CC2650_LAUNCHXL) || defined (CC1350_LAUNCHXL) Board_BTN1 | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_BTN2 | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_UART_RX_IRQ | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLDOWN, #elif defined (CC2650DK_7ID) || defined (CC1350DK_7XD) Board_KEY_SELECT | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_KEY_UP | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_KEY_DOWN | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_KEY_LEFT | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, Board_KEY_RIGHT | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, #endif PIN_MEM_INS | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, PIN_MEM_REQ | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, PIN_MEM_BZY | PIN_GPIO_OUTPUT_DIS | PIN_INPUT_EN | PIN_PULLUP, PIN_MEM_SEL | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, PIN_MEM_TEST | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, PIN_TERMINATE }; /********************************************************************* * PUBLIC FUNCTIONS */ /********************************************************************* * @fn Board_initKeys * * @brief Enable interrupts for keys on GPIOs. * * @param appKeyCB - application key pressed callback * * @return none */ void Board_initKeys(keysPressedCB_t appKeyCB) { // Initialize KEY pins. Enable int after callback registered hKeyPins = PIN_open(&keyPins, keyPinsCfg); PIN_registerIntCb(hKeyPins, Board_keyCallback); PIN_setConfig(hKeyPins, PIN_BM_IRQ, PIN_MEM_INS | PIN_IRQ_NEGEDGE); PIN_setOutputValue(hKeyPins, PIN_MEM_TEST, 1); PIN_setOutputValue(hKeyPins, PIN_MEM_SEL, 1); // PIN_setConfig(hKeyPins, PIN_BM_IRQ, Board_BTN2 | PIN_IRQ_NEGEDGE); // Setup keycallback for keys Util_constructClock(&keyChangeClock, Board_keyChangeHandler, KEY_DEBOUNCE_TIMEOUT, 0, false, 0); // Set the application callback appKeyChangeHandler = appKeyCB; }
PIN_MEM_SEL, and PIN_MEM_TEST are defined as DIO8 and DIO7 in BOOSTXL_CC2650MA.h.
All the self-defined pins (PIN_MEM_*) are also include in BoardGpioInitTable[]. The main function will call "PIN_init(BoardGpioInitTable)" to initial these pins.
My BoardGpioInitTable is defined as:
/* * ========================= IO driver initialization ========================= * From main, PIN_init(BoardGpioInitTable) should be called to setup safe * settings for this board. * When a pin is allocated and then de-allocated, it will revert to the state * configured in this table. */ /* Place into subsections to allow the TI linker to remove items properly */ #if defined(__TI_COMPILER_VERSION__) #pragma DATA_SECTION(BoardGpioInitTable, ".const:BoardGpioInitTable") #pragma DATA_SECTION(PINCC26XX_hwAttrs, ".const:PINCC26XX_hwAttrs") #endif PIN_Config BoardGpioInitTable[] = { // PIN_MEM_INS | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, PIN_MEM_REQ | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, PIN_MEM_BZY | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, PIN_MEM_SEL | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, PIN_MEM_TEST | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, PIN_TERMINATE}; const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = { // .intPriority = ~0, .swiPriority = 0 // };
I expect to see DIO8 and DIO7 pull high to 3.3V (which is my VDD), however, it seems like the two pins is floating (or maybe pull low).
Any idea about this problem?
Thanks