Other Parts Discussed in Thread: TIDA-00650, CC2650STK, Z-STACK
Hello everyone,
PREABLE: thread https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/p/854841/3161491#3161491 has been solved!
The problem was due to the incorrect procedure for reading the voltage data (RDATA), this did not work because I executed two instructions as below:
// RDATA(): Read data command commandSPI = 0x10;
bspSpiWrite(&commandSPI, sizeof(commandSPI))
// Read data (24 bit) VoltagePT100[0] = 0x00; VoltagePT100[1] = 0x00; VoltagePT100[2] = 0x00; bspSpiWriteRead(VoltagePT100, sizeof(VoltagePT100[0]), sizeof(VoltagePT100))
because the bsp_spi library internally manages the pins of the SPI interface and...so it happened that at the end of the execution of the first instruction (RDATA) as the chip-select is brought to the high value:
nCS_ADC --> HIGH
the transaction was concluded!
Instead performing in a single statement works:
/* Step 6 - RDATA: Read data: command + read data */ VoltagePT100[0] = 0x10; // RDATA() command: write1 byte (command = 0x10), Read data: read 3 bytes (data) VoltagePT100[1] = 0x00; VoltagePT100[2] = 0x00; bspSpiWriteRead(VoltagePT100, sizeof(VoltagePT100[0]), sizeof(VoltagePT100)) // data (24 bits): MS byte of data + Central Byte of data + LS byte of data
CURRENT ISSUE: how to configure the board Devpack PINs?
I don't understand why as soon as the TIDA-00650 board is connected via devpack to the CC2650STK board I see a continuous consumption of about 5 mA, when the board is not powered!
My PIN configuration below:
Called from main.c:
PIN_Config BoardGpioInitTable[] = { Board_LED1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */ 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_MPU_INT | PIN_INPUT_EN | PIN_PULLDOWN | PIN_IRQ_NEGEDGE | PIN_HYSTERESIS, /* MPU_INT is active low */ Board_TMP_RDY | PIN_INPUT_EN | PIN_PULLUP | PIN_HYSTERESIS, /* TMP_RDY is active high */ Board_BUZZER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Buzzer initially off */ //Board_MPU_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* MPU initially on */ Board_MPU_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* MPU initially off */ //Board_MIC_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* MIC initially on */ Board_MIC_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* MIC initially off */ Board_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */ Board_SPI_DEVPK_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* DevPack chip select */ Board_AUDIO_DI | PIN_INPUT_EN | PIN_PULLDOWN, /* Audio DI */ Board_AUDIODO | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* Audio data out */ Board_DP2 | PIN_INPUT_EN | PIN_NOPULL, /* DevPack - nDRDY_ADC - NOT USED */ Board_DP1 | 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, /* DevPack - LED (green) - NOT USED */ Board_DP3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* DevPack - TIDA-00650 PWR_UP_CHIP*/ Board_DP4_UARTRX | PIN_INPUT_EN | PIN_PULLDOWN, /* DevPack */ Board_DP5_UARTTX | PIN_INPUT_EN | PIN_PULLDOWN, /* Devpack */ //Board_DEVPK_ID | PIN_INPUT_EN | PIN_NOPULL, /* Device pack ID - external PU */ PIN_TERMINATE };
then in sensortagapp.c I configure the following pins to check the TIDA-00650 board:
#if defined(TIDA_00650) // PIN table for TIDA-00650 static PIN_Config TIDA00650_PinTable[] = { // Devpack interface Board_DP3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,/* DevPack : TIDA-00650 | PWR_UP_CHIP --> LOW */ Board_DP2 | PIN_INPUT_EN | PIN_NOPULL, /* DevPack : TIDA-00650 | nDRDY_ADC --> LOW , NOT USED */ PIN_TERMINATE /* Terminate list */ };
What could be the problem? I want to get the following behavior:
at expire of TIMEOUT:
- PIN_setOutputValue(hGpioPin, Board_DP3, 1); // TIDA-00650 | PWR_UP_CHIP --> HIGH
- Configure the ADC registers and read the voltage values...
- PIN_setOutputValue(hGpioPin, Board_DP3, 0); // TIDA-00650 | PWR_UP_CHIP --> LOW
Before and after TIDA-00650 is not powered (by pin "Board_DP3") and therefore should not consume anything!?
thank you everyone!