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.

MSP430FG4618 ADC12 Memory Register Query

Other Parts Discussed in Thread: SIMPLICITI

Hi,

 

I am new to MSP430 controller and I presently using SimpliciTI protocol for transmitting ADC samples wirelessly from the End Device to the Access Point. Now the ADC12 has a memory register which is 16 bit (4 MSB bits 0) and this data is read into a 16 bit integer array as shown below.

uint16_t     ch1[100];

uint16_t     ch2[100];

for ( int t=0; t<100 ; t++) 
    {
        ADC12CTL0 |= ENC;                       // Enable conversions
        ADC12CTL0 |= ADC12SC;                   // Start conversions
        while((!(ADC12IFG &0x02)==1));
        ch1[t] = ADC12MEM0;
        ch2[t] = ADC12MEM1;
    }

 

But in order to transmit the data using the "smplStatus_t SMPL_Send(linkID_t lid, uint8 *msg, uint8 len)" command I can only transfer 8 bit array (string) and not 16 bit array. But the ADC memory register is 16 bit so need to put the 1st 8 bits of the MSB in one array and the 8 bits of the LSB in another array so that I can easily transmit the two 8 bit arrays easily. But being new to MSP430 programming I have no idea how can I do that.

Please let me know your suggestions.

Regards

Ravi

  • I fugured a way out of doing it..

     

     uint8_t     ch1_M[100];

    uint8_t     ch1_L[100];

    uint8_t     ch2_M[100];

    uint8_t     ch2_L[100];

     

    for ( int t=0; t<100 ; t++) 

    {

    ADC12CTL0 |= ENC;                       // Enable conversions

            ADC12CTL0 |= ADC12SC;                   // Start conversions

    while((!(ADC12IFG &0x02)==1));

    ch1_M[t] = (0xFF00 & ADC12MEM0)/256;

    ch1_L[t] = (0x00FF & ADC12MEM0);

    ch2_M[t] = (0xFF00 & ADC12MEM1)/256;

    ch2_L[t] = (0x00FF & ADC12MEM1);

    }

    If anybody needs for future reference.............