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.

Send 102 bytes using TIMAC

Other Parts Discussed in Thread: TIMAC, CC2520, MSP430F5438A

Hi,

I am using TIMAC for my sensor development program.

I want to send 102 bytes ( maximum number of MSA_PACKET_LENGTH)

I am using ADC ISR to fill msa_Data1 buffer with adc values. When I send only I byte (i.e. MSA_PACKET_LENGTH is set to 5 (4 for header and 1 for data) ) I am able to receive values in the end device but when I increase MSA_PACKET_LENGTH to any other value even 6 then I don't get any value apart from 0

Am I doing something wrong, please advise?

This is my code for ADC ISR.

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

#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR(void)
{
   uint8 i=0;

 for (i=MSA_HEADER_LENGTH; i<MSA_PACKET_LENGTH; i++)
 {
      msa_Data1[i] = ADC12MEM1;                   // Store the sampled data
 }

  __bic_SR_register_on_exit(LPM0_bits);
}

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

Thanks

PS - I am using MSP430F5438A board and using CC2520 as transreceiver

  • To understand this better - do you see that you recieve all the bytes (say 10) but that all the received data bytes at the receiver side are zero's'?

    Also, have you tested if the msa_Data1 structure (by looking in the debug window, etc)  value before sending the data or using the MSA_McpsDataReq() all the bytes in the msa_Data1 are non zero's when the message length is say 10, i.e. I just want to ensure that the conversion result is not all zero?

  • Regarding your first question that I am receiving all the bytes , so I checked for number of bytes received which it is equal to number of bytes sent, for my case of 10 bytes it is 10.

    Also I checked for msa_Data1 structure before sending the value. When I send 5 bytes ( 4 bytes are for header ) , data byte is not zero and I receive correctly  but if send 6 bytes ( 4 for header) , on sender side  , there is no issue but on receiver side, if I send a signal from function generator I am receiving 48 ( I checked it on hyperterminal) that too at a very low speed and as soon as I remove the function generator I again receive 48 but at a lot better speed but that is lower than what I am sending ( as on sender side when I checked I am sending correct values at higher speed).

    Above case was if I send 6 bytes , when  I send more bytes say 50 then the speed at which values are sent gets decreased in fact it should have been opposite. Also on receiver side it is the same case as it was for 6 bytes case.

    One more thing, I am only changing MSA_PACKET_LENGTH in msa.h for increasing the number of bytes. I have kept MSA_ECHO_LENGTH  as 8 .

    Waiting for your reply.

    Thanks

  • Hi Yuvraj,

    Based on the statement below -

    "Also I checked for msa_Data1 structure before sending the value. When I send 5 bytes ( 4 bytes are for header ) , data byte is not zero and I receive correctly  but if send 6 bytes ( 4 for header) , on sender side  , there is no issue but on receiver side, if I send a signal from function generator I am receiving 48 ( I checked it on hyperterminal) that too at a very low speed and as soon as I remove the function generator I again receive 48 but at a lot better speed but that is lower than what I am sending ( as on sender side when I checked I am sending correct values at higher speed)."

    Can I assume that the issue of receiving all zero's is resolved or is not there?

    Just to be sure, 48 I expect is not the number of bytes received on the receiver but the ADC conversion value.

    The issue that you have is the data packets are not being sent at the rate that you expect.? If so, from the function above I can only understand how the data bytes are getting populated for the message. But when do you trigger the transmission. To increase the transmission frequency you can try to send as soon as you populate the data. You can set a flag that you monitor in the application and send when the flag is set, or send a event to the application to transmit as soon as the data is ready. 

    Hope this helps. 

  • hi Suyash,

    i am also working with Yuvraj.

    we have tried by puting flag also but no use.

    i want to ask you is there any maximum limit on the signal frequency that can be transmitted using TIMAC.

    we  are using ADC (8 bit) with the TIMAC at the transmitter side.to send the signal from function generator.

  • Hi Suyash,

    There is one more thing. I tried sending known data using TIMAC

    for (i=MSA_HEADER_LENGTH; i<MSA_PACKET_LENGTH; i++)
      {
        msa_Data1[i] = i-MSA_HEADER_LENGTH;
      }

    I am able to send as well as receive the data but when I pass the data through ADC ( 8 bit resolution) then I can only receive 1 byte data correctly ( i.e. when MSA_PACKET_LENGTH = 5) , for all other cases I am not able to receive any data but my transmission buffer msa_Data1[i] has got some values. Even when I try to plot values in  ADC12MEM1 buffer after passing them through UART then I am not getting a good sine wave i.e. the wave is clipped . Also the wave gets distorted badly after 30 Hz but ADC sampling rate is very high ( 7662 Hz).UART Baud rate  = 460800

    What can be the possible reason for the above problem?

    Thanks

  • Hi Suyash,

     Plz reply........

    Thanks

    Yuvraj