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.

CC1352R: VC-TCXO problem

Part Number: CC1352R
Other Parts Discussed in Thread: SYSCONFIG

Hi,

We have a design with a cc1352R where we are using this VC-TCXO: NT1612AA. The schematic we follow is the next one:

The Q4 is not mounted, so we use only the Q2.

The GPIO used to power it is the 36.

When the board was received we made a fast test, just powering the TCXO without configuring it as a TCXO, so just before using the RF, power the port and once the RF is closed, unpower it. We saw everything was working fine, so we did not take more care of it.

Now that we are fully developing it, we have entered to configure it in the right way, so we have configure in the sysconfig the next parameters:

  • GPIO36: Output low
  • Enable TCXO Function: Power_enableTCXO

            void Power_enableTCXO(bool turnOn)

            {

                   if ( turnOn ) {

                  // Set corresponding DIO high to enable the TCXO

                   GPIO_write(PWR_CLOCK, 1);

                   }

                  else {

                  // Set the corresponding DIO low to disable the TCXO

                 GPIO_write(PWR_CLOCK, 0);

                }

       }

  • HF Clock Source: External 48Mhz TCXO
  • TCXO Type: Clipped Sine
  • TCXO Max Startup time: 0xFF

With this configuration, the radio is working fine, and the board is not consuming. But, we have an SPI RFID device which stops working after starting the RF. We are not able to receive the interrupt of this chip, but we are able to receive interrupts from other ports. If we go back to the way were we are powering manually without setting in the sysconfig that we are using a TCXO, the SPI RFID device works properly.

Someone can give us a clue of what can be wrong? And which is the relation between this 48 MHz and the SPI channels or the 32kHz xtal?

Thanks in advance.

  • Hi,

    Is it when the RF (static Tx or Rx) is enabled or just when the TCXO is enabled that disturbs the SPI RFID device ?

    Regards,

       Richard

  • Hi,

    At the reboot the RFID works, I make a RF communication (switch on TCXO, send data and switch off the TCXO) and then the RFID is not working anymore, but if I make the same procedure without configuring it as TCXO everything RF and RFID works.

    Thanks!

    Sandra

  • Hi,

    Please double check the GPIO.
    On the schematic it looks like the physical pin 36 is used, and not GPIO36.

  • Hi,

    You are right i wrote it wrong in the question, it is the pin36 the GPIO23.

    Thanks,

  • What is the part number for the SPI RFID device ?

    Is the chip also powered with 3V3 ?

    Have you tried to add a resistance at R8 so the TCXO signal will be attenuated ?

  • Hi,

    We are using ST253911B chip and it is also powered with 3,3V.

    We have not tried to put a resistance, we will try it, which value would you recomend? Thanks!

  • HI,

    The configuration of the CC1352R TCXO has a strong effect on the ST253911B chip. Since changing the settings of the clocking of the CC1352R TCXO affects the ST chip then this could be related to the signal strength level of the TCXO or cross-talk through the layout.

    Test the following to find the root cause:

    1. Use a 10 k resistor at R8 and R9; the TCXO clipped sine output should not exceed 1.7 V pk-pk

    2. Test with two boards, One board with the CC1352R and ST253911B and the other board with the TCXO. Clock the CC1352R from the separate board to determine if there is a RF layout issue.

  • Hi,

    On Monday I will be in the laboratory and we will test this, thanks!

  • Hi,

    Today I was able to make some measurements. Using the default hardware configurations, I have measure the peak to peak voltage in the output of the TCXO:

    - Configuring in the sysconfig, as external TCXO clipped sine type, the peak to peak voltage  was 550mV, and I was able to see the sine signal output

    - Configuring in the sysconfig, as 48 MHz XOSC_HF, the  peak to peak voltage was 530mV, and I was able to see the sine signal output

    Then we took the board to put the resistors of 10k, and we saw that the peak to peak voltage  was 1,3 Volts in the output of the TCXO, but we destroy the pad that goes to the uC and it was not working anymore.

    For the moment we can not do more tests until Thursday that we will receive new boards, but one thing that I do not understand is, how the cc1352R can work with the same TCXO but with different configuration? What is changing in the micro when I configure it with the TCXO or with the XOSC?

    Many thanks,

  • Out of curiosity: What happens if you use Q4 instead of Q2?

    The TCXO syscfg setting is mainly to setup when to switch from the internal RCOSC to the TCXO (to ensure a stable clock signal)  and the required callback. I don't have the full overview but most of the xtal module is unchanged regardless of setting. I think an internal buffer amplifier is turned off when using TCXO but the rest is the same so I'm not surprised it works. Note that even it works not setting the correct settings in syscfg to use TCXO  you have a risk of damage/ bricking the device if you use a TCXO but have not set it in syscfg. 

    To see if this is a power pulling issue you can disconnect the 3V3 going to the TCXO and connect this to a power supply. 

  • Hi,

    Yesterday I was able to make the test of using 2 different boards, one only for the TCXO and the other one for the CC1352R and ST253911B, but I have the same problem.

    Thanks!

  • Hi,

    We do not have the q4 mounted, so we can not test what happens,

    Yesterday we test to power the TCXO with a power supply, but still the same behavior.

    Thanks!!

  • Thanks RGW and TER for your ideas, yesterday we were making all the tests with the new boards without success. But this at least was helping us to put a side the TCXO, and think a bit more what is happening in the firmware.

    We have put some wires in the SPI of the ST253911B, and we have seen that we are able to make the initialization of the chip, later we send some messages by RF, and later on, when we try to access to the ST253911B, in the SPI line we can see all 0x00 are sent.

    In order to recover the chip, we are closing the SPI handle and opening it again after any RF message is being sent. Any clue of why can this happen?? Which can be the internal realtion between the TCXO and the SPI channel??

    Thanks!

  • Questions:

    -

    Yesterday we test to power the TCXO with a power supply, but still the same behavior.
    When the board was received we made a fast test, just powering the TCXO without configuring it as a TCXO, so just before using the RF, power the port and once the RF is closed, unpower it. We saw everything was working fine, so we did not take more care of it.

    It looks like you have tested the board in a very similar way but have got different result?

    - I know that Q4 is not mounted but are you able to do so?

    - Do you have a second noard or a different sensor that you can communicate with over SPI? The reason I ask is if the RFID makes an issue or if this is a general SPI issue.

  • Hi,

    To answer your questions,

    - I know that Q4 is not mounted but are you able to do so?

    We do not have any part for making the change at the moment.

    Do you have a second noard or a different sensor that you can communicate with over SPI? The reason I ask is if the RFID makes an issue or if this is a general SPI issue.

    Yes, we have an EEPROM in the same board with SPI connection, connected to a different SPI channel. This one is working properly but in the code I am opening and closing the handle after I use it. This is the reason why I tried to do the same procedure with the RFID chip, and I found that opening and closing the SPI channel is working fine after RF communication.

    Today we have tested to communicate wiht the EEPROM after RF communication without closing the SPI handle, and we have the same error as with the RFID chip. If inmediately we close the handle and open it again, it works again.

    So what I can say is,

    - If I have the TCXO connected and configured as TCXO, if I have a SPI handle opened, after any RF communication I need to close the handle and open it again.

    - If I have the TCXO connected BUT NOT configured as TCXO, if I have a SPI handle opened there are no problems after RF communications.

    Does this has any sense for you? the strange thing is that the spi communication is returning that everything went fine so I have no way to know that there was any problem.

    Thanks,

  • It sound like a DIO conflict of sort.

    Could you post the ti_drivers_config.c/h files?

  • Hi, here you have the files. Thanks!

    ti_drivers_config.c
    /*
     *  ======== ti_drivers_config.c ========
     *  Configured TI-Drivers module definitions
     *
     *  DO NOT EDIT - This file is generated for the CC1352R1F3RGZ
     *  by the SysConfig tool.
     */
    
    #include <stddef.h>
    #include <stdint.h>
    
    #ifndef DeviceFamily_CC13X2
    #define DeviceFamily_CC13X2
    #endif
    
    #include <ti/devices/DeviceFamily.h>
    
    #include "ti_drivers_config.h"
    
    /*
     *  =============================== ADC ===============================
     */
    
    #include <ti/drivers/ADC.h>
    #include <ti/drivers/adc/ADCCC26XX.h>
    
    #define CONFIG_ADC_COUNT 1
    
    /*
     *  ======== adcCC26xxObjects ========
     */
    ADCCC26XX_Object adcCC26xxObjects[CONFIG_ADC_COUNT];
    
    /*
     *  ======== adcCC26xxHWAttrs ========
     */
    const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CONFIG_ADC_COUNT] = {
        /* ADC */
        {
            .adcDIO              = IOID_24,
            .adcCompBInput       = ADC_COMPB_IN_AUXIO6,
            .refSource           = ADCCC26XX_FIXED_REFERENCE,
            .samplingDuration    = ADCCC26XX_SAMPLING_DURATION_2P7_US,
            .inputScalingEnabled = true,
            .refVoltage          = 3300000,
            .triggerSource       = ADCCC26XX_TRIGGER_MANUAL,
            .returnAdjustedVal   = false
        },
    };
    
    /*
     *  ======== ADC_config ========
     */
    const ADC_Config ADC_config[CONFIG_ADC_COUNT] = {
        /* ADC */
        {
            .fxnTablePtr = &ADCCC26XX_fxnTable,
            .object = &adcCC26xxObjects[ADC],
            .hwAttrs = &adcCC26xxHWAttrs[ADC]
        },
    };
    
    const uint_least8_t ADC_CONST = ADC;
    const uint_least8_t ADC_count = CONFIG_ADC_COUNT;
    
    /*
     *  =============================== DMA ===============================
     */
    
    #include <ti/drivers/dma/UDMACC26XX.h>
    #include <ti/devices/cc13x2_cc26x2/driverlib/udma.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
    
    UDMACC26XX_Object udmaCC26XXObject;
    
    const UDMACC26XX_HWAttrs udmaCC26XXHWAttrs = {
        .baseAddr        = UDMA0_BASE,
        .powerMngrId     = PowerCC26XX_PERIPH_UDMA,
        .intNum          = INT_DMA_ERR,
        .intPriority     = (~0)
    };
    
    const UDMACC26XX_Config UDMACC26XX_config[1] = {
        {
            .object         = &udmaCC26XXObject,
            .hwAttrs        = &udmaCC26XXHWAttrs,
        },
    };
    
    /*
     *  =============================== GPIO ===============================
     */
    
    #include <ti/drivers/GPIO.h>
    #include <ti/drivers/gpio/GPIOCC26XX.h>
    
    #define CONFIG_GPIO_COUNT 17
    
    /*
     *  ======== gpioPinConfigs ========
     *  Array of Pin configurations
     */
    GPIO_PinConfig gpioPinConfigs[] = {
        /* INT */
        GPIOCC26XX_DIO_13 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_RISING,
        /* POWER_EEPROM */
        GPIOCC26XX_DIO_08 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* OUT_0 */
        GPIOCC26XX_DIO_28 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* OUT_1 */
        GPIOCC26XX_DIO_27 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* OUT_2 */
        GPIOCC26XX_DIO_07 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH,
        /* NOT_USED_GPIO_18 */
        GPIOCC26XX_DIO_18 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* OUT_3 */
        GPIOCC26XX_DIO_22 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* PWR_CLOCK */
        GPIOCC26XX_DIO_23 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_LOW | GPIO_CFG_OUT_LOW,
        /* OUT_4 */
        GPIOCC26XX_DIO_25 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* OUT_5 */
        GPIOCC26XX_DIO_26 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* DAC_O_PWM */
        GPIOCC26XX_DIO_06 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* TDO */
        GPIOCC26XX_DIO_16 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* TDI */
        GPIOCC26XX_DIO_17 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_LOW,
        /* CS_EEPROM */
        GPIOCC26XX_DIO_14 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_MED | GPIO_CFG_OUT_HIGH,
        /* IN_0 */
        GPIOCC26XX_DIO_15 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
        /* IN_1 */
        GPIOCC26XX_DIO_29 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
        /* IN_2 */
        GPIOCC26XX_DIO_30 | GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING,
    };
    
    /*
     *  ======== gpioCallbackFunctions ========
     *  Array of callback function pointers
     *
     *  NOTE: Unused callback entries can be omitted from the callbacks array to
     *  reduce memory usage by enabling callback table optimization
     *  (GPIO.optimizeCallbackTableSize = true)
     */
    extern void rfidInterruptFxn0(uint_least8_t index);
    extern void ClearPressed(uint_least8_t index);
    extern void InternalHandleOrDoorContactPressed(uint_least8_t index);
    extern void MechDNDPressed(uint_least8_t index);
    
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
        /* INT */
        rfidInterruptFxn0,
        /* POWER_EEPROM */
        NULL,
        /* OUT_0 */
        NULL,
        /* OUT_1 */
        NULL,
        /* OUT_2 */
        NULL,
        /* NOT_USED_GPIO_18 */
        NULL,
        /* OUT_3 */
        NULL,
        /* PWR_CLOCK */
        NULL,
        /* OUT_4 */
        NULL,
        /* OUT_5 */
        NULL,
        /* DAC_O_PWM */
        NULL,
        /* TDO */
        NULL,
        /* TDI */
        NULL,
        /* CS_EEPROM */
        NULL,
        /* IN_0 */
        ClearPressed,
        /* IN_1 */
        InternalHandleOrDoorContactPressed,
        /* IN_2 */
        MechDNDPressed,
    };
    
    const uint_least8_t INT_CONST = INT;
    const uint_least8_t POWER_EEPROM_CONST = POWER_EEPROM;
    const uint_least8_t OUT_0_CONST = OUT_0;
    const uint_least8_t OUT_1_CONST = OUT_1;
    const uint_least8_t OUT_2_CONST = OUT_2;
    const uint_least8_t NOT_USED_GPIO_18_CONST = NOT_USED_GPIO_18;
    const uint_least8_t OUT_3_CONST = OUT_3;
    const uint_least8_t PWR_CLOCK_CONST = PWR_CLOCK;
    const uint_least8_t OUT_4_CONST = OUT_4;
    const uint_least8_t OUT_5_CONST = OUT_5;
    const uint_least8_t DAC_O_PWM_CONST = DAC_O_PWM;
    const uint_least8_t TDO_CONST = TDO;
    const uint_least8_t TDI_CONST = TDI;
    const uint_least8_t CS_EEPROM_CONST = CS_EEPROM;
    const uint_least8_t IN_0_CONST = IN_0;
    const uint_least8_t IN_1_CONST = IN_1;
    const uint_least8_t IN_2_CONST = IN_2;
    
    /*
     *  ======== GPIOCC26XX_config ========
     */
    const GPIOCC26XX_Config GPIOCC26XX_config = {
        .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
        .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
        .numberOfPinConfigs = 17,
        .numberOfCallbacks = 17,
        .intPriority = (~0)
    };
    
    /*
     *  =============================== PIN ===============================
     */
    #include <ti/drivers/PIN.h>
    #include <ti/drivers/pin/PINCC26XX.h>
    
    #define CONFIG_PIN_COUNT 28
    
    const PIN_Config BoardGpioInitTable[CONFIG_PIN_COUNT + 1] = {
        /* Parent Signal: ADC ADC Pin, (DIO24) */
        CONFIG_PIN_14 | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
        /* Parent Signal: INT GPIO Pin, (DIO13) */
        CONFIG_PIN_0 | PIN_INPUT_EN | PIN_NOPULL | PIN_IRQ_DIS,
        /* Parent Signal: POWER_EEPROM GPIO Pin, (DIO8) */
        CONFIG_PIN_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: OUT_0 GPIO Pin, (DIO28) */
        CONFIG_PIN_2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: OUT_1 GPIO Pin, (DIO27) */
        CONFIG_PIN_4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: OUT_2 GPIO Pin, (DIO7) */
        CONFIG_PIN_10 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: NOT_USED_GPIO_18 GPIO Pin, (DIO18) */
        CONFIG_PIN_11 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: OUT_3 GPIO Pin, (DIO22) */
        CONFIG_PIN_12 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: PWR_CLOCK GPIO Pin, (DIO23) */
        CONFIG_PIN_13 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MIN,
        /* Parent Signal: OUT_4 GPIO Pin, (DIO25) */
        CONFIG_PIN_15 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: OUT_5 GPIO Pin, (DIO26) */
        CONFIG_PIN_16 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: DAC_O_PWM GPIO Pin, (DIO6) */
        CONFIG_PIN_3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: TDO GPIO Pin, (DIO16) */
        CONFIG_PIN_20 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: TDI GPIO Pin, (DIO17) */
        CONFIG_PIN_21 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CS_EEPROM GPIO Pin, (DIO14) */
        CONFIG_PIN_22 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_EEPROM SCLK, (DIO5) */
        CONFIG_PIN_6 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_EEPROM MISO, (DIO3) */
        CONFIG_PIN_7 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_EEPROM MOSI, (DIO4) */
        CONFIG_PIN_8 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_RFID SCLK, (DIO11) */
        CONFIG_PIN_5 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_RFID MISO, (DIO9) */
        CONFIG_PIN_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_SPI_RFID MOSI, (DIO10) */
        CONFIG_PIN_24 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: IN_0 GPIO Pin, (DIO15) */
        CONFIG_PIN_26 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
        /* Parent Signal: IN_1 GPIO Pin, (DIO29) */
        CONFIG_PIN_27 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
        /* Parent Signal: IN_2 GPIO Pin, (DIO30) */
        CONFIG_PIN_28 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS,
        /* Parent Signal: CONFIG_SPI_RFID SS, (DIO12) */
        CONFIG_PIN_25 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_GPTIMER_1 PWM Pin, (DIO21) */
        CONFIG_PIN_17 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_GPTIMER_2 PWM Pin, (DIO19) */
        CONFIG_PIN_18 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
        /* Parent Signal: CONFIG_GPTIMER_3 PWM Pin, (DIO20) */
        CONFIG_PIN_19 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MED,
    
        PIN_TERMINATE
    };
    
    const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
        .intPriority = (~0),
        .swiPriority = 0
    };
    
    /*
     *  =============================== PWM ===============================
     */
    
    #include <ti/drivers/PWM.h>
    #include <ti/drivers/pwm/PWMTimerCC26XX.h>
    
    /* include driverlib definitions */
    #include <ti/devices/cc13x2_cc26x2/driverlib/ioc.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_ints.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
    
    #define CONFIG_PWM_COUNT 3
    
    /*
     *  ======== pwmCC26XXObjects ========
     */
    PWMTimerCC26XX_Object pwmTimerCC26XXObjects[CONFIG_PWM_COUNT];
    
    /*
     *  ======== pwmCC26XXHWAttrs ========
     */
    const PWMTimerCC26XX_HwAttrs pwmTimerCC26XXHWAttrs[CONFIG_PWM_COUNT] = {
        /* PWM_11_PWM */
        {
            .pwmPin = IOID_21,
            .gpTimerUnit = CONFIG_GPTIMER_1
        },
        /* PWM_00_PWM */
        {
            .pwmPin = IOID_19,
            .gpTimerUnit = CONFIG_GPTIMER_2
        },
        /* PWM_22_PWM */
        {
            .pwmPin = IOID_20,
            .gpTimerUnit = CONFIG_GPTIMER_3
        },
    };
    
    /*
     *  ======== PWM_config ========
     */
    const PWM_Config PWM_config[CONFIG_PWM_COUNT] = {
        /* PWM_11_PWM */
        {
            .fxnTablePtr = &PWMTimerCC26XX_fxnTable,
            .object = &pwmTimerCC26XXObjects[PWM_11_PWM],
            .hwAttrs = &pwmTimerCC26XXHWAttrs[PWM_11_PWM]
        },
        /* PWM_00_PWM */
        {
            .fxnTablePtr = &PWMTimerCC26XX_fxnTable,
            .object = &pwmTimerCC26XXObjects[PWM_00_PWM],
            .hwAttrs = &pwmTimerCC26XXHWAttrs[PWM_00_PWM]
        },
        /* PWM_22_PWM */
        {
            .fxnTablePtr = &PWMTimerCC26XX_fxnTable,
            .object = &pwmTimerCC26XXObjects[PWM_22_PWM],
            .hwAttrs = &pwmTimerCC26XXHWAttrs[PWM_22_PWM]
        },
    };
    
    const uint_least8_t PWM_11_PWM_CONST = PWM_11_PWM;
    const uint_least8_t PWM_00_PWM_CONST = PWM_00_PWM;
    const uint_least8_t PWM_22_PWM_CONST = PWM_22_PWM;
    const uint_least8_t PWM_count = CONFIG_PWM_COUNT;
    
    /*
     *  =============================== Power ===============================
     */
    #include <ti/drivers/Power.h>
    #include <ti/drivers/power/PowerCC26X2.h>
    #include "ti_drivers_config.h"
    
    extern void PowerCC26XX_standbyPolicy(void);
    extern bool PowerCC26XX_calibrate(unsigned int);
    extern void Power_enableTCXO(bool enable);
    
    const PowerCC26X2_Config PowerCC26X2_config = {
        .enablePolicy             = true,
        .policyInitFxn            = NULL,
        .policyFxn                = PowerCC26XX_standbyPolicy,
        .calibrateFxn             = PowerCC26XX_calibrate,
        .calibrateRCOSC_LF        = true,
        .calibrateRCOSC_HF        = true,
        .enableTCXOFxn            = Power_enableTCXO
    };
    
    
    /*
     *  =============================== RF Driver ===============================
     */
    #include <ti/drivers/rf/RF.h>
    
    /*
     * Platform-specific driver configuration
     */
    const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
        .hwiPriority        = (~0),
        .swiPriority        = (uint8_t)0,
        .xoscHfAlwaysNeeded = true,
        .globalCallback     = NULL,
        .globalEventMask    = 0
    };
    
    
    /*
     *  =============================== SPI DMA ===============================
     */
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/spi/SPICC26X2DMA.h>
    
    #define CONFIG_SPI_COUNT 2
    
    /*
     *  ======== spiCC26X2DMAObjects ========
     */
    SPICC26X2DMA_Object spiCC26X2DMAObjects[CONFIG_SPI_COUNT];
    
    /*
     *  ======== spiCC26X2DMAHWAttrs ========
     */
    const SPICC26X2DMA_HWAttrs spiCC26X2DMAHWAttrs[CONFIG_SPI_COUNT] = {
        /* CONFIG_SPI_EEPROM */
        {
            .baseAddr = SSI1_BASE,
            .intNum = INT_SSI1_COMB,
            .intPriority = (~0),
            .swiPriority = 0,
            .powerMngrId = PowerCC26XX_PERIPH_SSI1,
            .defaultTxBufValue = 0xff,
            .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
            .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
            .minDmaTransferSize = 1,
            .mosiPin = IOID_4,
            .misoPin = IOID_3,
            .clkPin  = IOID_5,
            .csnPin  = PIN_UNASSIGNED
        },
        /* CONFIG_SPI_RFID */
        {
            .baseAddr = SSI0_BASE,
            .intNum = INT_SSI0_COMB,
            .intPriority = (~0),
            .swiPriority = 0,
            .powerMngrId = PowerCC26XX_PERIPH_SSI0,
            .defaultTxBufValue = ~0,
            .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
            .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
            .minDmaTransferSize = 1,
            .mosiPin = IOID_10,
            .misoPin = IOID_9,
            .clkPin  = IOID_11,
            .csnPin  = IOID_12
        },
    };
    
    /*
     *  ======== SPI_config ========
     */
    const SPI_Config SPI_config[CONFIG_SPI_COUNT] = {
        /* CONFIG_SPI_EEPROM */
        {
            .fxnTablePtr = &SPICC26X2DMA_fxnTable,
            .object = &spiCC26X2DMAObjects[CONFIG_SPI_EEPROM],
            .hwAttrs = &spiCC26X2DMAHWAttrs[CONFIG_SPI_EEPROM]
        },
        /* CONFIG_SPI_RFID */
        {
            .fxnTablePtr = &SPICC26X2DMA_fxnTable,
            .object = &spiCC26X2DMAObjects[CONFIG_SPI_RFID],
            .hwAttrs = &spiCC26X2DMAHWAttrs[CONFIG_SPI_RFID]
        },
    };
    
    const uint_least8_t CONFIG_SPI_EEPROM_CONST = CONFIG_SPI_EEPROM;
    const uint_least8_t CONFIG_SPI_RFID_CONST = CONFIG_SPI_RFID;
    const uint_least8_t SPI_count = CONFIG_SPI_COUNT;
    
    /*
     *  =============================== Temperature ===============================
     */
    #include <ti/drivers/Temperature.h>
    #include <ti/drivers/temperature/TemperatureCC26X2.h>
    
    const TemperatureCC26X2_Config TemperatureCC26X2_config = {
        .intPriority = (~0),
    };
    
    /*
     *  =============================== Timer ===============================
     */
    
    #include <ti/drivers/Timer.h>
    #include <ti/drivers/timer/TimerCC26XX.h>
    
    #define CONFIG_TIMER_COUNT 1
    
    /*
     *  ======== timerCC26XXObjects ========
     */
    TimerCC26XX_Object timerCC26XXObjects[CONFIG_TIMER_COUNT];
    
    /*
     *  ======== timerCC26XXHWAttrs ========
     */
    const TimerCC26XX_HWAttrs timerCC26XXHWAttrs[CONFIG_TIMER_COUNT] = {
        {
            .gpTimerUnit = CONFIG_GPTIMER_0,
            .subTimer    = TimerCC26XX_timer32
    
        },
    };
    
    /*
     *  ======== Timer_config ========
     */
    const Timer_Config Timer_config[CONFIG_TIMER_COUNT] = {
        /* CONFIG_TIMER_1 */
        {
            .fxnTablePtr = &TimerCC26XX_fxnTable,
            .object    = &timerCC26XXObjects[CONFIG_TIMER_1],
            .hwAttrs   = &timerCC26XXHWAttrs[CONFIG_TIMER_1]
        },
    };
    
    const uint_least8_t CONFIG_TIMER_1_CONST = CONFIG_TIMER_1;
    const uint_least8_t Timer_count = CONFIG_TIMER_COUNT;
    
    /*
     *  =============================== Watchdog ===============================
     */
    
    #include <ti/drivers/Watchdog.h>
    #include <ti/drivers/watchdog/WatchdogCC26XX.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
    
    #define CONFIG_WATCHDOG_COUNT 1
    
    
    WatchdogCC26XX_Object watchdogCC26XXObjects[CONFIG_WATCHDOG_COUNT];
    
    const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CONFIG_WATCHDOG_COUNT] = {
        /* CONFIG_WATCHDOG_0: period = 1000 */
        {
            .baseAddr    = WDT_BASE,
            .reloadValue = 1000
        },
    };
    
    const Watchdog_Config Watchdog_config[CONFIG_WATCHDOG_COUNT] = {
        /* CONFIG_WATCHDOG_0 */
        {
            .fxnTablePtr = &WatchdogCC26XX_fxnTable,
            .object      = &watchdogCC26XXObjects[CONFIG_WATCHDOG_0],
            .hwAttrs     = &watchdogCC26XXHWAttrs[CONFIG_WATCHDOG_0]
        }
    };
    
    const uint_least8_t CONFIG_WATCHDOG_0_CONST = CONFIG_WATCHDOG_0;
    const uint_least8_t Watchdog_count = CONFIG_WATCHDOG_COUNT;
    
    /*
     *  =============================== Button ===============================
     */
    #include <ti/drivers/apps/Button.h>
    
    #define CONFIG_BUTTON_COUNT 3
    Button_Object ButtonObjects[CONFIG_BUTTON_COUNT];
    
    static const Button_HWAttrs ButtonHWAttrs[CONFIG_BUTTON_COUNT] = {
        /* IN_00 */
        {
            .gpioIndex = IN_0
        },
        /* IN_11 */
        {
            .gpioIndex = IN_1
        },
        /* IN_22 */
        {
            .gpioIndex = IN_2
        },
    };
    
    const Button_Config Button_config[CONFIG_BUTTON_COUNT] = {
        /* IN_00 */
        {
            .object = &ButtonObjects[IN_00],
            .hwAttrs = &ButtonHWAttrs[IN_00]
        },
        /* IN_11 */
        {
            .object = &ButtonObjects[IN_11],
            .hwAttrs = &ButtonHWAttrs[IN_11]
        },
        /* IN_22 */
        {
            .object = &ButtonObjects[IN_22],
            .hwAttrs = &ButtonHWAttrs[IN_22]
        },
    };
    
    const uint_least8_t IN_00_CONST = IN_00;
    const uint_least8_t IN_11_CONST = IN_11;
    const uint_least8_t IN_22_CONST = IN_22;
    const uint_least8_t Button_count = CONFIG_BUTTON_COUNT;
    
    /*
     *  =============================== LED ===============================
     */
    #include <ti/drivers/apps/LED.h>
    
    #define CONFIG_LED_COUNT 3
    LED_Object LEDObjects[CONFIG_LED_COUNT];
    
    static const LED_HWAttrs LEDHWAttrs[CONFIG_LED_COUNT] = {
        /* PWM_11 */
        {
            .type = LED_PWM_CONTROLLED,
            .index = PWM_11_PWM,
        },
        /* PWM_00 */
        {
            .type = LED_PWM_CONTROLLED,
            .index = PWM_00_PWM,
        },
        /* PWM_22 */
        {
            .type = LED_PWM_CONTROLLED,
            .index = PWM_22_PWM,
        },
    };
    
    const LED_Config LED_config[CONFIG_LED_COUNT] = {
        /* PWM_11 */
        {
            .object = &LEDObjects[PWM_11],
            .hwAttrs = &LEDHWAttrs[PWM_11]
        },
        /* PWM_00 */
        {
            .object = &LEDObjects[PWM_00],
            .hwAttrs = &LEDHWAttrs[PWM_00]
        },
        /* PWM_22 */
        {
            .object = &LEDObjects[PWM_22],
            .hwAttrs = &LEDHWAttrs[PWM_22]
        },
    };
    
    const uint_least8_t PWM_11_CONST = PWM_11;
    const uint_least8_t PWM_00_CONST = PWM_00;
    const uint_least8_t PWM_22_CONST = PWM_22;
    const uint_least8_t LED_count = CONFIG_LED_COUNT;
    
    /*
     *  =============================== GPTimer ===============================
     */
    
    #include <ti/drivers/timer/GPTimerCC26XX.h>
    #include <ti/drivers/power/PowerCC26XX.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
    #include <ti/devices/cc13x2_cc26x2/inc/hw_ints.h>
    
    #define CONFIG_GPTIMER_COUNT 4
    
    /*
     *  ======== gptimerCC26XXObjects ========
     */
    GPTimerCC26XX_Object gptimerCC26XXObjects[CONFIG_GPTIMER_COUNT];
    
    /*
     *  ======== gptimerCC26XXHWAttrs ========
     */
    const GPTimerCC26XX_HWAttrs gptimerCC26XXHWAttrs[CONFIG_GPTIMER_COUNT] = {
        /* CONFIG_GPTIMER_0, used by CONFIG_TIMER_1 */
        {
            .baseAddr = GPT2_BASE,
            .intNum      = INT_GPT2A,
            .intPriority = (~0),
            .powerMngrId = PowerCC26XX_PERIPH_GPT2,
            .pinMux      = GPT_PIN_2A
        },
        /* CONFIG_GPTIMER_1, used by PWM_11_PWM */
        {
            .baseAddr = GPT0_BASE,
            .intNum      = INT_GPT0A,
            .intPriority = (~0),
            .powerMngrId = PowerCC26XX_PERIPH_GPT0,
            .pinMux      = GPT_PIN_0A
        },
        /* CONFIG_GPTIMER_2, used by PWM_00_PWM */
        {
            .baseAddr = GPT3_BASE,
            .intNum      = INT_GPT3A,
            .intPriority = (~0),
            .powerMngrId = PowerCC26XX_PERIPH_GPT3,
            .pinMux      = GPT_PIN_3A
        },
        /* CONFIG_GPTIMER_3, used by PWM_22_PWM */
        {
            .baseAddr = GPT3_BASE,
            .intNum      = INT_GPT3B,
            .intPriority = (~0),
            .powerMngrId = PowerCC26XX_PERIPH_GPT3,
            .pinMux      = GPT_PIN_3B
        },
    };
    
    /*
     *  ======== GPTimer_config ========
     */
    const GPTimerCC26XX_Config GPTimerCC26XX_config[CONFIG_GPTIMER_COUNT] = {
        /* CONFIG_GPTIMER_0 */
        {
            .object    = &gptimerCC26XXObjects[CONFIG_GPTIMER_0],
            .hwAttrs   = &gptimerCC26XXHWAttrs[CONFIG_GPTIMER_0],
            .timerPart = GPT_A
        },
        /* CONFIG_GPTIMER_1 */
        {
            .object    = &gptimerCC26XXObjects[CONFIG_GPTIMER_1],
            .hwAttrs   = &gptimerCC26XXHWAttrs[CONFIG_GPTIMER_1],
            .timerPart = GPT_A
        },
        /* CONFIG_GPTIMER_2 */
        {
            .object    = &gptimerCC26XXObjects[CONFIG_GPTIMER_2],
            .hwAttrs   = &gptimerCC26XXHWAttrs[CONFIG_GPTIMER_2],
            .timerPart = GPT_A
        },
        /* CONFIG_GPTIMER_3 */
        {
            .object    = &gptimerCC26XXObjects[CONFIG_GPTIMER_3],
            .hwAttrs   = &gptimerCC26XXHWAttrs[CONFIG_GPTIMER_3],
            .timerPart = GPT_B
        },
    };
    
    const uint_least8_t CONFIG_GPTIMER_0_CONST = CONFIG_GPTIMER_0;
    const uint_least8_t CONFIG_GPTIMER_1_CONST = CONFIG_GPTIMER_1;
    const uint_least8_t CONFIG_GPTIMER_2_CONST = CONFIG_GPTIMER_2;
    const uint_least8_t CONFIG_GPTIMER_3_CONST = CONFIG_GPTIMER_3;
    const uint_least8_t GPTimer_count = CONFIG_GPTIMER_COUNT;
    
    #include <ti/drivers/Board.h>
    
    /*
     *  ======== Board_initHook ========
     *  Perform any board-specific initialization needed at startup.  This
     *  function is declared weak to allow applications to override it if needed.
     */
    void __attribute__((weak)) Board_initHook(void)
    {
    }
    
    /*
     *  ======== Board_init ========
     *  Perform any initialization needed before using any board APIs
     */
    void Board_init(void)
    {
        /* ==== /ti/drivers/Power initialization ==== */
        Power_init();
    
        /* ==== /ti/drivers/PIN initialization ==== */
        if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
            /* Error with PIN_init */
            while (1);
        }
        /* ==== /ti/devices/CCFGTemplate initialization ==== */
    
        /* ==== /ti/drivers/RF initialization ==== */
    
        Board_initHook();
    }
    
    
    ti_drivers_config.h

  • It looks like a fairly high number of DIOS are defined in both gpioPinConfigs[] and BoardGpioInitTable. 

    From I see, the SPI has no conflict. 

    Is CONFIG_PIN_13/ GPIOCC26XX_DIO_23 used somewhere else in the code than for the TCXO callback? 

  • It looks like a fairly high number of DIOS are defined in both gpioPinConfigs[] and BoardGpioInitTable. 

    I do not understand what means this, or if this can be a problem.

    Is CONFIG_PIN_13/ GPIOCC26XX_DIO_23 used somewhere else in the code than for the TCXO callback? 

    It is only used for the callback

    Thanks!

  • Hello,

    Do you have any idea of why is the problem with the SPI and the TCXO is happening? or how can I know that there is a problem in the SPI?

    In other products I will need to use the SPI for more devices, and I would need to know how to handle the SPI with the TCXO been sure that what I receive in the SPI is correct.

    Thanks!

  • Hi Sandra,

    Use a standard LaunchPad to test your SPI connection to the other sensor chip to see if the issue is related to your layout/design or if it is software related.

  • Hi, with the launchpad I do not have any problem due it is not using the TCXO.

  • I do not believe there would be a problem even using a TCXO on the LaunchPad. It feels like the problem is layout related to your specific design.

    There is a TCXO on the LAUNCHXL-CC1312R or modify an existing LaunchPad with a TCXO to confirm that the problem is related to your layout design.

  • Hello RGW,

    Why do you think there is a layout problem? I can communicate with the chips properly by SPI except if the TCXO is selected as TCXO and the spi handle is not closed. I do not see the relation with the layout...if you could explain me it would be great to know where to find.

    I will try to modify a launchpad to connect the TCXO and to test if I have the same problem with the spi.

    I have modified the lauchpad. I remove the Y2 form the launchpad, and I have connect to the pin 47 of the micro, our output of the TCXO (in our schematic the capacitor C62).

    I have the TCXO all the time powered, I have connect the EEPROM to the launchpad, and I have taken the example from resource explorer "rfPacketTx_CC1352R1_LAUNCHXL_tirtos_ccs", and i added the SPI for the EEPROM.

    1)If I select in sysconfig that I am using External TCXO, when it arrives to "RF_open", it breaks with the error:

    "Cortex_M4_0: Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.2.0.00002)
    Cortex_M4_0: Trouble Halting Target CPU: (Error -2064 @ 0x0) Unable to read device status. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.2.0.00002) "

    **Update: I have removed this error putting in sysconfig an enable TCXO FUNCTION, it is empty due the TCXO is always powered, but now it is not going out from "RF_postCmd"

    2)If I select in sysconfig that I am using 48MHz XOSC_HF, it is working fine....

  • Please test with a TCXO on a LAUNCHPAD and let us know the results if there are still problems with the SPI to the other sensor chip.

  • Hello,

    I can see that the message from yesterday was not clear, so I will try to explain it again, and with the results that I have today due yesterday ones are not fully correct.

    I have taken a launchpad from cc1352R. I have removed the Y2, and I have connect the ouput of my XCTO from my device to the pin 47 of the launchpad, and the power of the TCXO to the DIO21 of the launchpad. (I needed to do like this because it is not possible to connect the TCXO and the resistors and capacitor it needs in the launchpad, both boards are being powered with the same supply).

    To the launchpad I have also connect the EEPROM we use in our development by SPI. (we took this because the connection is easier than using the rfid chip)

    I have taken the example from resource explorer "rfPacketTx_CC1352R1_LAUNCHXL_tirtos_ccs", and I added the SPI for the EEPROM, and the GPIO for activating the TCXO.

    In the EEPROM I am not closing the SPI handle after finishing reading by SPI.

    Test 1

    Read EEPROM/sendWireless/read EEPROM using the default code: WORKING

    Test 2:

    Read EEPROM/sendWireless/read EEPROM changing "RF_yield(rfHandle)" with "RF_close(rfHandle)": NOT WORKING

    Test 3:

    Read EEPROM/sendWireless/close SPI handle/open SPI handle/read EEPROM changing "RF_yield(rfHandle)" with "RF_close(rfHandle)": WORKING

    Thanks,

  • Hi Sandra,

    Not sure why this happens, but it seems like the SPI is not properly configured when you try the second EEPROM read. Since calling SPI close and open works, I would suggest you use this as a work-around.

  • Hi, I can use this workaround of course, I'm using it due i do not have other option. But I need to be sure that when I try to access to the SPI what I receive or I sent is correct, and I can not know now. If I am using the RF, and I need to use the EEPROM, how can I know that in the middle something happens that brokes my SPI channel? Also, is this action broken other handles or other communication channels?

    I need at least a hint to know when the SPI is broken. My configuration for the SPI is the next one:

    SPI_Handle openSPIEEPROM()
    {
        SPI_Params spiParams;
        usleep(200);
        /* Open SPI as master (default) */
        SPI_Params_init(&spiParams);
        spiParams.frameFormat = SPI_POL1_PHA1;
        spiParams.bitRate = 4000000;
        spiParams.transferCallbackFxn = EEPROMTransferCompleteFxn;
        spiParams.transferMode = SPI_MODE_CALLBACK;
        spiParams.transferTimeout=2;
        eepromSpi = SPI_open(CONFIG_SPI_EEPROM, &spiParams);
        return eepromSpi;
    }

    void closeSPIEEPROM()
    {
        SPI_close(eepromSpi);
    }

    If you can see something strange...thnaks!

  • Hi Sandra,

    SPI configuration looks OK. However this will depend on you EEPROM, so you should check against the data sheet of this part.

    Could there be a race condition in your code? E.g. are you using the same buffer for SPI and RF operations?

    Cheers,

    Marie

  • Hi,

    The EEPROM and the RF are not using same buffers, the have different buffers.

    As I said in the last message the "RF_close(rfHandle)" instruction is destroying somehow my SPI handle. I do not know if it is destroying something else or not.

    Thanks for your answer.

    Sandra

  • Hi Sandra,

    Can you look in the .map file to see if the handles for RF and SPI are overlapping?

    Do you need to call RF_close?

    Cheers,

    Marie