# ahgan84

Members

68

• #### Last visited

• Rank
Level 1

for(i=0;i<256;i++) { RAWvalue += DMA_DST[i]; // Summing up 256 raw values } I found out that it is the above for loop which run 256 times to sum up the raw value for each channel that increase my time. Is there any other way that I can write to reduce the time?

I'm planning to ON all channels from channel 0 to 15 for my ADC12 for a user to use. Just that I thought of maybe a user won't know the sequence which one is channel 0 or which one is channel 15. Then if he put his device on channel 15, then he'll have to wait a long time only can get a result. I mean like, can't I get the ADC conversion from channel 0 to channel 15 all at the same time? Is there a configuration for this? Because of you add an extra step which is the DMA transfer in the code, I felt like the conversion time with using DMA is slower compare to without using DMA. Am I right, or I'm just imagining? If I am right, is there any way to reduce the conversion time?

So it is mean that using the coding you showed, doesn't matter I use multiple channels like for example from channel 0 to 2 or channel 0 to 15, the conversion will always store in ADC10MEM0? I notice the coding will still use the ADC10CTL1 = ADC10CONSEQ_2 for repeat single channel instead of ADC10CTL1 = ADC10CONSEQ_3 for repeat sequence of channel? Why? I thought we are using multiple channels? So, the ADC conversion is in sequence from channel 0, 1, 2, 3, .... to finally channel 15. Then if my device input is at the last channel, which is channel 15, doesn't we have to wait a long time only get the conversion result? Cause it need to convert all other channels first before getting to channel 15. Then, it will be like my ADC response time is very slow. Is there any solutions to this?

I've found the below circuit which can measure resistance using ADC12. But what I don't understand is what is the 1M resistor in the middle for? We must put it or can we omit it?

My voltage is a stable one. I measured already, I don't experience voltage drop. Yup. You are right. I've change the upper resistor to 30k Ohm and it give me a correct voltage value. But do you know why we should use a larger value for the upper resistor?

I see. I've also saw the word software control from the internet. What exactly it is? Could you explain to me how do we use software control to trigger the DMA? Is the time we set for CCR registers (long or short) effecting the ADC accuracy? I've read the MSP430x5xxx family datasheet on ADC12 and DMA already. But I still have a lot don't understand. That's why I posted my questions here hoping somebody to explain to me.

Anybody willing to help me with the above question?

Do you guys know why i face the above problem?