Hello ,
I am working on msp430f5438 experimenter board with cc2520 for WSN .i am using Z-Stack (Zstack-exp5438-2.5.1). for configuring the nodes.i am using GENERIC APP sample example for data transmission.
i am sending sine wave using function generator from the transmission node but at the receiver node(coordinator) i am not able to produce perfect sine wave when checked in python based gui.i want to achieve a frequency band of 1hz to 250 hz for my application data.
now the adc setting i have used are shown below.i have used ADC of 8bit.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR(void)
{
//ADC12CTL0 &= ~ADC12ENC; // Disable ADC12 conversions
//REFCTL0 &= ~REFON; // Disable reference
theMessageData[index1] = (ADC12MEM0);
index1++;
if (index1 == 1)
{
index1 = 0;
ADC12CTL0 &= ~ADC12ENC;
__bic_SR_register_on_exit(LPM0_bits);
}
// __delay_cycles(12000);------------>should i use delay here???
}
void adc(void)
{
P6SEL |= BIT7; // Pin 7.6 and 7.7 are inputs from the accelerometer to the ADC => they are configured as inputs to the ADC
P6DIR &= ~BIT7;
P7DIR=BIT5;
P7OUT=BIT5;
REFCTL0 |= REFMSTR+REFVSEL_2+REFON+REFTCOFF;
ADC12CTL0 = ADC12ON + ADC12SHT0_6+ ADC12MSC;
ADC12CTL1 = ADC12SHP + ADC12CONSEQ_2 + ADC12SSEL_3 +ADC12DIV_3 + ADC12PDIV ; //7075hz 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
}
void adctrigger(void)
{
ADC12CTL0 |= ADC12ENC | ADC12SC;
// ADC12CTL0 |= ADC12SC;
__bis_SR_register(LPM0_bits+GIE);
__no_operation();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////
and for the Send Message Timeout in GenericApp.h
#define GENERICAPP_SEND_MSG_TIMEOUT 250 -------------------->HOW TO CONFIGURE THIS VALUE???
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////