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.

How to use devpack DP0-DP3 pins as an output?

How to use devpack DP0-DP3 pins as an output? 

PIN_Config ledPinTable[] = {
Board_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_DP0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};

PIN_setOutputValue(ledPinHandle, Board_DP0, 1);

I want to drive a lad with using DP0 pin on the devpack but it doesnt work this code. I measured the voltage between DP0 and Vdd. It has no output voltage. 

these part of my code are enough to configure DP0 pin as an output for driving a led? 

  • Hi,

    Can you make sure that Board_DP0 is only accessed by ledPinTable?
    What program did you use to develop your own code?
  • hi,

    Im not sure i dont know exactly how can i acces the pins but  the pins are defined in cc26STK.h  Im using CCS.

    /* DevPack common */
    #define Board_AUDIOFS_TDO IOID_16
    #define Board_AUDIODO IOID_22
    #define Board_DP2 IOID_23
    #define Board_DP1 IOID_24
    #define Board_DP0 IOID_25
    #define Board_DP3 IOID_27
    #define Board_DP4_UARTRX IOID_28
    #define Board_DP5_UARTTX IOID_29
    #define Board_DEVPK_ID IOID_30
    #define Board_SPI_DEVPK_CS IOID_20

  • I try to use the following code to toggle Board_DP2 in SensorTag example and it works fine.

    // Pins that are actively used by the application
    static PIN_Config SensortagAppPinTable[] =
    {
        Board_LED1       | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,     /* LED initially off             */
        Board_DP2       | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,    
        Board_LED2       | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,     /* LED initially off             */
        Board_KEY_LEFT   | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,        /* Button is active low          */
        Board_KEY_RIGHT  | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,        /* Button is active low          */
        Board_RELAY      | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS,      /* Relay is active high          */
        Board_BUZZER     | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,     /* Buzzer initially off          */

        PIN_TERMINATE
    };


    bool toggle=0;
    static void SensorTag_init(void)
    {
      uint8_t selfTestMap;

      // Setup I2C for sensors
      bspI2cInit();

      // Handling of buttons, LED, relay
      hGpioPin = PIN_open(&pinGpioState, SensortagAppPinTable);
      PIN_registerIntCb(hGpioPin, SensorTag_callback);

      while(1){
          PIN_setOutputValue(hGpioPin, Board_DP2, (uint8_t)toggle);
          toggle=!toggle;

          Task_sleep(1000000 / Clock_tickPeriod);
      }
    }