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.

CC2650: How to import PIN data

Part Number: CC2650

Hello,


Please let me know if you know.
I'm connecting a sensor to cc2650 and creating one that wirelessly transmits that sensor data.
At this time, for example, if you connect to DIO28, is there a buffer that automatically keeps the PIN data from a certain value?

Can someone tell me?
Rina

  • Hello Rina,

    Please try to restate your question so that I may understand it better.  It would help to provide more details on exactly what you are trying to accomplish and what is preventing you from achieving this functionality.  I would also recommend that you review 5.25 DC Characteristics from the Datasheet, 11 I/O Control from the TRM, and the PIN.h TI Driver API from the TI-RTOS 2.21.00.06 Documentation.

    Regards,
    Ryan


  • Thank you for your reply.

    I want to create a program with the following two functions.
    ・ I want to capture data connected to DIO28 PIN of cc2650 at intervals finer than 10ms interval
    ・ I want to transmit the captured data at intervals of 80ms

    I'm thinking ADC_convert function can only get the AD value of the moment.
    However, can pin data be stored automatically in a specific buffer? I thought.
    Also, when I created the above two programs using two Lock functions, the program froze.

    I apologize for any confusion.

  • Since IOID_28 is available as an analog pin, you need to make sure that it is not being initialized for ADC functionality inside your Board files.  For example, LaunchPad projects have a CC2650_LAUNCHXL.h where CC2650_LAUNCHXL_ADCName is enumerated with CC2650_LAUNCHXL_ADC2 and Board_DIO28_ANALOG defined to be referenced by in ADCBufCC26XX_adcChannelLut, adcCC26xxHWAttrs of CC2650_LAUNCHXL.c.  Therefore these all need to be removed if using pin 28 as a digital I/O.  You will need to provide more details, possible with code, regarding your lock functions and program freeze.

    Regards,
    Ryan

  • Thank you for your reply!

    Please tell me a little more

    ・DIO28 is defined by LaunchPad.h, etc.
    I want to automatically buffer the sensor dripping data of the DIO28 PIN.
    For this purpose, it is difficult to use existing programs alone.So, do you recognize that you need to edit and use the contents defined about PINs in LaunchPad etc.?

    In addition, I was able to create a program that reads and transmits AD data at intervals of 80ms the other day.
    However, there is no meaning in the sensor data of 80ms interval.
    I wanted more fine-grained sensor data, so I wondered if the ADC function had temporarily stored dripping data on the base.
    (If possible, I would like to control it with task or lock, but it is difficult to set the lock because the transmission interval and the capture hope interval are different ...
    If there is a place where sensor data is stored, I asked with hope whether I could refer to the pointer.)
    Or I thought that I could create a mechanism that would capture data without permission at 1ms intervals by multitasking etc.


    If you know any material that might be helpful when writing these programs, please let me know.
    (I don't know how to write a multitasking program well...)

    Thank you for teaching me so much!

    ありがとう!

    Rina

  • If you need DIO28 as an analog pin, then the existing LaunchPad board files are fine.  You could remove the other ADC pins from initializing to free up resources for your specific pin.  Please refer to ADCBuf.h for ADC buffers with continuous sampling, and the BIOS User's Guide along with SYS/BIOS APIs to further understand how to create and control multiple tasks.  The ADC examples will also be a good resource to use.

    Regards,
    Ryan

  • Thank you for telling me about ADCBuf.h.
    I'm studying about this.
    Please tell me because there are some places where you do not know how many points.

    ・In what order does Buffer store PIN information?
    → I want to extract DIO28PIN data from Buffer, but I do not know where the PIN28 is written in Buffer
    →Is it suitable with the recognition that it is stored in order of adcCC26xxHWAttrs?

    ありがとう!

    Rina

  • The first sample is placed in Buffer[0], the second byte in Buffer[1], and so on.  The callback is used to process the buffer once filled, where the size is defined by the developer.  Since the sampling frequency is also determined, the frequency of the callback is also known.  A second buffer can be filled in ADCBuf_RECURRENCE_MODE_CONTINUOUS mode while the first buffer is processed by the application, as shown in the adcBufContinuousSampling example.

    Regards,
    Ryan

  • I'm sorry, I'm not telling you well.
    The following picture shows the result of running 『adcBufContinuous』.
    We recognize that each value at this time is a change of some PIN output from PIN23 to PIN30 to mv.
    What I want to know is what data is stored in what order and in what order microVoltBuffer[i].
    I think that two related variables are related to completedChannel/completedADCBuffer.]
    I think continuousConversion.adcChannel points to PIN information, but is it right?
    For example, in the case of DIO28 ADC_COMPB_IN_AUXIO2 0x0e? Is it like recognition?
    I'm not sure where it's good here.
    Please help me…

    ありがとう
    Rina

  • Hi Rina,

    In the case of adcBufContinuousSampling, only Board_DIO23_ANALOG is sampled since the channelCount parameter of ADCBuf_convert is 1.  In order to sample Board_DIO23_ANALOG, you would need to remove the prior entries of adcCC26xxHWAttrs (optimal if these ADC pins are not being used) or increase the channelCount to 6 for which case DIO28 would be every sixth measurement.

    Regards,
    Ryan

  • Thank you for your reply.
    I tried writing code based on what I was taught, but is this recognition suitable ...?
    I want a μV value where DIO28/DIO29 data was sampled at 200Hz
    Changed adcBufContinuousSampling in several places


    //**********************************
    //adcBufContinuousSampling.c
    //**********************************

    /* Configure the conversion struct */
    continuousConversion.arg = NULL;
    continuousConversion.adcChannel = Board_ADCBufChannel0;
    continuousConversion.sampleBuffer = sampleBufferOne;
    continuousConversion.sampleBufferTwo = sampleBufferTwo;
    continuousConversion.samplesRequestedCount = ADCBUFFERSIZE;

    if (!adcBuf){
    System_abort("adcBuf did not open correctly\n");
    }

    /* Start converting. */
    if (ADCBuf_convert(adcBuf, &continuousConversion, 2) !=
    ADCBuf_STATUS_SUCCESS) {
    System_abort("Did not start conversion process correctly\n");
    }

    //**********************************
    //CC2650_LAUNCHXL.c
    //**********************************

    const ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[] = {
    {Board_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
    {Board_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
    //{PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
    //{PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
    //{PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
    //{Board_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
    //{Board_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
    //{Board_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
    //{Board_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
    //{Board_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
    //{Board_DIO30_ANALOG, ADC_COMPB_IN_AUXIO0},
    };

    const ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC2650_LAUNCHXL_ADCBufCOUNT] = {
    {
    .intPriority = ~0,
    .swiPriority = 0,
    .adcChannelLut = ADCBufCC26XX_adcChannelLut,
    .gpTimerUnit = Board_GPTIMER0A,
    .gptDMAChannelMask = 1 << UDMA_CHAN_TIMER0_A,
    }
    };

    //**********************************

    Changed the channel count to 2 and commented out non-DIO used.
    The result at this time is the following photograph.
    I have this sequence in DIO29[0],DIO28[0], DIO29[1], DIO28[1], DIO29[2], DIO28[2]... I thought it would continue like etc.
    However, in the execution result, the place devised to become 0 in DIO28 / DIO29 is not as expected.
    Is this because there is an error in the code I've written?

    Help me,,,
    Rina

  • Did you modify adcCC26xxHWAttrs to remove unwanted entries as well?  Please use similar E2E threads as a guide.

    Regards,
    Ryan

  • Sorry...You taught me a lot of carefully.
    However, I did not understand well, so I want you to confirm it.

    Is the following content suitable?
    ・In the default sample, only DC_COMPB_IN_VDDS data was sampled and output.
    →The number of channels converted from【ADCBuf_convert(adcBuf, &continuousConversion, 1)】 is 1.
    →The data displayed after the execution is a total of 11(CC2650_LAUNCHXL_ADCCOUNT) variables defined in 【ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[]】.
    But only DC_COMPB_IN_VDDS are sampled.

    Also, the difference in the number of digits of the value between the ADC and the ADCBuffer is because the ADCBuffer is displayed mv.

    My aim is where DIO28 data falls into Buffer.
    I couldn't understand it even if I looked at the link that you told me ....
    I want to understand.

    Please, please...
    Rina

  • I have no further recommendations as I am not clear as to how your code has been modified at this point and am not certain that the input stated is the source truly being measured.  Please start over by evaluating the basic example code, then implement the changes which worked in the other E2E threads I referenced.

    Regards,
    Ryan

  • I loaded 「adcbufcontinuous_CC2650_LAUNCHXL_TI」 from Resource Explorer to Douun.
    Nothing has changed.
    When I run this program, what information is displayed on the screen in mv?
    But I'm not sure I've seen many things.「adcChannel = Board_ADCCHANNEL_A1;」
    What indicates buffer? So, is the Buddy randomly containing DIO23 to DIO30?
    So did you tell me to remove a PIN you don't use?

    Please tell me.
    Rina

  • There is an accompanying README that describes how 100 samples at 500 Hz will be taken for Board_ADCBuf0, and Board_ADCBufChannel0 is set as zero in Board.h which points to ADC_COMPB_IN_VDDS in ADCBufCC26XX_adcChannelLut.  There is a fair description in this E2E thread.  Thus you should change Board_ADCBufChannel0 to eight for Board_DIO28_ANALOG.

    Regards,
    Ryan

  • I understand!
    Thank you for teaching me so much.

    By the way, when you change #define Board_ADCBufChannel0 (0)" to "#define Board_ADCBufChannel0 (8)",
    When you touch the pin of DIO28, the numerical value changes.
    However, the numerical value fluctuates even if the pin of DIO23 is touched.
    Is this a problem with my board?

    Thank you very much for all the things.
    Rina

  • Hi Rina,

    Assuming that the ADC value does not fluctuate greatly, it is common for interaction with the analog IO pin through human contact to cause slight changes in the readings.  I've done this in the past using TI LaunchPads.  You should connect the analog pin to your sensor and shield the devices so that such interference does not occur.

    Regards,
    Ryan