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 rates

Other Parts Discussed in Thread: MSP430F5438A
Hi,

I am new to electronics. So, please be patient. I am trying to figure out the following problems for past 10 hours and can not get it solved.

I need to sample six sensors after every 20 minutes using a microcontroller. Four temperature sensors and two light sensors. Each sensor is connected to the six individual pin of the ADC. This ADC is integrated into the microcontroller chip.

The on chip microcontroller has 12 bit ADC an d let's suppose I configured it to sample at  10kSamples/sec.

So, what does it mean that 12bits + 12bits + 12bits + 12bits + 12bits + 12bits = 72 bits every 20 minutes.

20 minutes = 1200 seconds., So, its 72 bits every 1200 seconds. Let's say ADC sampling at 10kHz. How would that fit into this mathematical equation?

So, the data rate would be 0.06 bits /sec. I am so confused. I am also confused about taking into account the switching time of the ADC among all six sensors. I meant how much time does the microcontroller take to move from one channel to another.

I am planning to use the following microcontroller  MSP430F5438A. This processor might be able to sample at higher rate but lets ignore that right now and help me with understanding how can I calculate the data rate at 10Ksamples/sec.
  • At 10 kSample/sec, you can read all your six sensors in 0.6 msec. If you only need to read them every 20 minutes, that is no problem. you can spend the remaining time of each 20 minutes doing something else or take a nap.

    That is, in each 1200000 msec., you spend 0.6 msec to sample your six sensors and 1199999.4 msec doing other things or doing nothing.
  • Hi,

    Thanks for your reply! The microcontroller msp430F5438A has 16 KBytes of RAM, 12 bit resolution ADC and 256 KBytes of EEPROM. Every 20 minutes, I want to send the data to ZigBee module using UART ( 8 bit register, 9.6kbps).

    So, my confusion is that after every 20 minutes I will get 6 x 10k x 10 = 600kbits of data. So, I have to store it in the RAM. Would 16KBytes be enough? and can I be able to send 600kbits of data over Zigbee after every 20 minutes.  
    But it seems like that, I will not get 600kbits of data after 20 minutes. I will get  number of sensor x  12 bit  = 6 x 12 = 72 bits of data every 20 min and I will have 7.5msec to write 72 bit to ZigBee over UART. ( Since UART rate that I am using is 9600bps) Am I right about my calculations?
    What is the best way to run timer after every 20 min? Should I timer trigger an interrupt to sample data after every 20 min? If yes then how?
    jess 
  • This is a programmable device. Within the capability of the device, it is up to you to decide how many samples to take, how often to do it, etc.

    You can take no samples at all. You can take 6 samples every 20 minutes. (I thought that was what you want to do.) You can also take 100000 samples every 20 minutes if you know what to do with them. But you cannot take a million samples in that time interval because the ADC of this device is not fast enough to do so.

    If you buy a car that is capable of doing 300 km/Hr. It does not mean that you have to drive 7200 km each day.
  • What is the best way to do the 20 minutes timer in MSP430F5438A
  • Hi Jessica!

    Just as inspiration:

    This is not exactly what you are looking for, but with minor changes you could use it for your application, at least it can give you some ideas. But of course there are smarter approaches as well.

    Dennis

**Attention** This is a public forum