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.

CC1310: Opening an ADC handle/channel inside txTaskFunction in the rfWakeOnRadioTx.c example driver code.

Part Number: CC1310

Hi,  I wrote some transmit code that opens ADC, samples 4 temp probes, then transmits data. I did this using the rfPacketTx and rfPacketRx drivers as baseline. After checking power, the lowest current measurement I could get was 7mA on the receiver because I could not shut off the RF front end even with RF_yield(rfHandle) command.

So, I decided to move to the rfWakeOnRadioTx and Rx example and see if I can integrate same code there. I first set up both boards with the Wake on Radio RX and TX drivers and results for power were very good. 0mA on my amp meter, it only goes to 0 mA so guessing its really in micro amp range, regardless it was excellent.

So I decided to proceed with integrating my code and finished integration, now in testing phase. The problem is I can not open the ADC. Code hangs in while loop and Error initializing ADC. I code traced it into the ADC_open command and it hangs when trying to enter a HWIdisable routine.

The ADC open code, below, is located the txTaskFunction. When I moved it out and up into the txTaskInit() function, the ADC opened up fine. I can send the modified  rfWakeOnRadioTx.c if necessary, but perhaps someone already knows whats going on just by this description. Thanks.

    GPIO_init();
    ADC_init();

    ADC_Handle adc;
    ADC_Params adcparams;
    ADC_Params_init(&adcparams);

        adc = ADC_open(Board_ADC0, &adcparams);
        if (adc == NULL) {
            //Error initializing ADC channel 0
            Display_printf(uartDisplayHandle, 0, 0, "Error initializing ADC0\n");
            while (1);
         }

  • Hello Dan,

    Have you made sure ADC_init(); is called only one time in your entire project?

  • Yes Sir, Only once in main just below Board_initGeneral(); or the usual places for init functions. Also, I separated my code into 2 threads to pull the ADC out from the task function and the new thread also hangs or NUL opening, trying to open ADC. Odd. Still working it. Missing something. Thx.

  • First of all, the reason why you are measuring such an high current consumption with the rfPacketRX example is that the repeat modes are set to 1, meaning that the radio is in RX all the time.

    In the rfWakeOnRadiRX example there will be a conflict between the ADC and the LCD display (the sharp display uses DIO_22-24)

        /* Sharp Display - GPIO configurations will be done in the Display files */
        GPIOCC26XX_DIO_24 | GPIO_DO_NOT_CONFIG, /* SPI chip select */
        GPIOCC26XX_DIO_22 | GPIO_DO_NOT_CONFIG, /* LCD power control */
        GPIOCC26XX_DIO_23 | GPIO_DO_NOT_CONFIG, /*LCD enable */

    Siri

  • Hah, yes. I just saw your reply after ripping out every piece of code other than mine to see which one was conflicting. I got down to the LCD. When I commented out opening up the LCD, I was then able to open ADC 0. So yes, pin conflict. If the LCD is used, then one can not use ADC 0, or apparently ADC 1 as inputs as these are designated DIO23 and DIO24 and conflict with the LCD, LCD_PWR and LCD_CS. It looks like GPIO 25, 26, 27 just from looking at the pin diagrams of the CC1310 launchpad and the pinout of the Sharp 128x128 booster LCD, which I have and using successfully on the receiver, because I do not sample ADC on the receiver. For anyone using the LCD on the transmitter, can probably just designate Board_ADC2, Board_ADC3, Board_ADC4 for ADC inputs in  the Board.h file instead of 0 and 1 and open up those related numbering. I haven't verified this but, in theory, is should work for others that encounter this issue. I will not need an LCD for the transmitter  so my solution will be  deleting all LCD related code for my application. Will consider this closed.

    Thanks.