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.

using DTC for ADC10 in msp430f2274

Other Parts Discussed in Thread: CC2500

hii,

i am trying to sample analog input on my ez430-rf2500 module.Currently i am not using DTC to transfer the conversion value to ram/flash.i am transfering the conversion value to an array in my main code.

Something like this:

sampled_data[i]=ADC10MEM;

Now i want to use DTC to directly transfer the converted value to flash.By the time this values are transfered i want to send the values already recieved to the rf ic tx pin so that it could be send to the access point.

What i want to do is continously sample data from the analog source and send it over the to the access point using CC2500.I would desired sampling rate of 20ksps.

i dont want to miss the samples. currently i am missing out some samples when i trying to send it over the rf,so when i plot the graph at the access point i m getting distortions.

Is this possible?

  • Pallav Gandhi said:

    i am trying to sample analog input on my ez430-rf2500 module.Currently i am not using DTC to transfer the conversion value to ram/flash.i am transfering the conversion value to an array in my main code.

    Something like this:

    sampled_data[i]=ADC10MEM;

    Now i want to use DTC to directly transfer the converted value to flash.

    Just to be clear, I think you meant to say that you want to use the DTC to directly transfer the converted value to RAM, not flash.

    Pallav Gandhi said:

    By the time this values are transfered i want to send the values already recieved to the rf ic tx pin so that it could be send to the access point.

    You mentioned currently using the CPU to read from ADC10MEM when the conversion has completed and copy it into an array.  Are you just sampling one input, or 1 channel of the ADC10?

    Pallav Gandhi said:

    What i want to do is continously sample data from the analog source and send it over the to the access point using CC2500.I would desired sampling rate of 20ksps.

    i dont want to miss the samples. currently i am missing out some samples when i trying to send it over the rf,so when i plot the graph at the access point i m getting distortions.

    Is this possible?

    Since you are currently copying the converted sample to an array, I did have a question about what is being transmitted over the RF link.  Are you transmitting just 1 sample at a time, or are you transmitting the entire array at once?
    This has implications on acceptable latency in your system.  If you are able to buffer several samples of data into an array and then send that entire array in a single transfer over the RF, a scheme can be implemented to use 2 arrays in memory for double-buffering or as a ping-pong buffer.
    One array would be allocated to the DTC to fill up while the other array has been allocated to the RF link to transmit.  When both the ADC10 and RF have completed their tasks, then the two buffers would be swapped.  In essence, new data from the ADC10 in sampled_data_ping[] would then be provided to the RF stack for transmission and sampled_data_pong[] would be provided to the DTC to fill up.  The CPU would need to execute some code to manage this and set the ADC10's DTC to change the start address for the DTC via ADC10SA to point to sampled_data_pong[] and vice versa.

    This should be a reasonable approach to prevent you from missing samples, as you have allocated a place for the ADC10 to work, while the RF has its own buffer to work from.

  • Dear Brandon,

    I don't know if the topic is still active, but I tried to implent the solution you suggest, and it doesn't work.

    It seems that ADC10SA can't be changed if a conversion is in progress. The only solution is to stop the current conversion and this leads to missing codes

    Do you agree with this?

    Gian

  • Gian Nicola said:

    It seems that ADC10SA can't be changed if a conversion is in progress.

    Yes, that is true.  The MSP430x2xx Family User's Guide (SLAU144) in Section 20.2.7 indicates this.

     

    Gian Nicola said:

    The only solution is to stop the current conversion and this leads to missing codes.

    I would phrase this as needing to wait until the current conversion is over, rather than stopping it.

**Attention** This is a public forum