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 program CC2530 for transmitting a signal wireless?

Other Parts Discussed in Thread: CC2530

Hi folks,

I am Sagar, Grad student at Georgia Tech. I'm developing a wireless application. I got a CC2530 ZDK kit. My goal is to transmit a signal wireless by a cc2530 module and recieve the same signal at the rx end and send it to the computer.

I went through the code ADC.c provided by TI's software examples. Here goes the code:

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

* @fn  adcSampleSingle

*

* @brief

*      This function makes the adc sample the given channel at the given

*      resolution with the given reference.

*

* @param uint8 reference

*          The reference to compare the channel to be sampled.

*        uint8 resolution

*          The resolution to use during the sample (8, 10, 12 or 14 bit)

*        uint8 input

*          The channel to be sampled.

*

* @return int16

*          The conversion result

*

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

int16 adcSampleSingle(uint8 reference, uint8 resolution, uint8 channel)

{

    int16 value;

 

    ADC_ENABLE_CHANNEL(channel);

 

    ADCIF = 0;

    ADC_SINGLE_CONVERSION(reference | resolution | channel);

    while(!ADCIF);

 

    value  = (ADCH << 8) & 0xff00;

    value |= ADCL;

 

    ADC_DISABLE_CHANNEL(channel);

 

    //  The variable 'value' contains 16 bits where

    //     bit 15 is a sign bit

    //     bit [14 .. 0] contain the absolute sample value

    //     Only the r upper bits are significant, where r is the resolution

    //     Resolution:

    //        12   -> [14 .. 3] (bitmask 0x7FF8)

    //        10   -> [14 .. 5] (bitmask 0x7FE0)

    //         9   -> [14 .. 6] (bitmask 0x7FC0)

    //         7   -> [14 .. 8] (bitmask 0x7F00)

 

    return value;

}

Port 0 of cc2530 is used to take the analog inputs which are to be converted to digital. AIN7 pin is the AVdd(Analog reverence voltage). I'm using single ended ADC(not differential).

My question is how do I select the channel of ADC, and resolution here.Which part of the code do I need to modify? I need 8 bit resolution. Giving a number to the channel in the code here will automatically reflect to that channel of Port0 on the cc2530 module? I also need transmit the value present in the ADCH and ADCL. So how do I program CC2530 to transmit the data wireless? Writing the ADCL,ADCH values to UxDBUF will solve the purpose of transmitting the data wireless?