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.

data transmission using zstack-exp5438-2.5.1 protocol stack

Other Parts Discussed in Thread: CC2520, MSP430F5438A

hi,

we are using msp430f5438a+cc2520 for node. trying to send analog data after adc conversion from one node to another node with router in between but for now there is only one end device and one coordinator.

we are using zstack(zstack-exp5438-2.5.1) generic app sample example for this purpose.

on the basis of other queries posted in this forum and previous discussions we conclude that we cannot set the message timeout(delay between two packets) value below 150ms.this setting is in genericapp.h file of the stack.

e2e.ti.com/.../401697

we have been advised to send 50 bytes in single packet every 150ms  for data transmission.we did that but are not able to reconstruct the sent data at receiver after passing the received data in PC through uart.

we have checked adc settings and is seems fine .we are again pasting the adc code .

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

byte theMessageData[50];

#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR(void)
{

//ADC12CTL0 &= ~ADC12ENC; // Disable ADC12 conversions
//REFCTL0 &= ~REFON; // Disable reference


theMessageData[index1] = (ADC12MEM0);

index1++; 

if (index1 == 50)
{
index1 = 0;
ADC12CTL0 &= ~ADC12ENC;
__bic_SR_register_on_exit(LPM0_bits);
}


// __delay_cycles(12000);

// ADC12IFG &= ~ADC12IFG1;

}

void adc(void)
{

P6SEL |= BIT7; // Pin 6.7 is input  from the accelerometer to the ADC => configured as inputs to the ADC
P6DIR &= ~BIT7;



REFCTL0 |= REFMSTR+REFVSEL_2+REFON+REFTCOFF;


//ADC12CTL0 &= ~ADC12ENC; // Disable conversion 
ADC12CTL0 = ADC12ON + ADC12SHT0_4+ ADC12MSC; 
ADC12CTL1 = ADC12SHP + ADC12CONSEQ_2 + ADC12SSEL_3 +ADC12DIV_6 + ADC12PDIV ;//5791 hz sampling freq
ADC12CTL2 = ADC12RES_0; // +ADC12TCOFF; // Resolution=08 bits, 9 clock cycle conversion time on time

ADC12MCTL0 = ADC12INCH_7+ ADC12SREF_1;
ADC12IE = BIT0;
__delay_cycles(200000); // Allowing reference voltage to stabilize

//ADC12CTL0 |= ADC12ENC; 


}
void adctrigger(void)
{
ADC12CTL0 |= ADC12ENC | ADC12SC;
// ADC12CTL0 |= ADC12SC;
__bis_SR_register(LPM0_bits+GIE);
__no_operation();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

we observed that if suppose we send 50 bytes in one packet the those 50 bytes are for very short duration i.e if adc sampling is kept at 5000hz then one sample is taken in 0.2ms and 50 bytes are taken in 10ms.

but if we want to reconstruct a sine wave of 10hz then it wont happen becoz 1 cycle is of 100ms but all my samples are taken in first 10 ms.and next group of samples will arrive after 150ms but by then the wave cycle will have completed.

so reconstruction is  not correct even though adc settings and configuration is correct.