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.

MSP430FE427A: MSP430 measurement cycle rate

Part Number: MSP430FE427A
Other Parts Discussed in Thread: MSP430F6736A, EVM430-F6736

We use MSP430 to measure RMS current

I have set MCLK = 8 MHz, SD16DIV = 8, SD16OSR256 --> Fmsp = 1 MHz --> Fadc = 4096 Hz --> 4096 samples = 1 second cylce for new energy and RMS value
In that configuration I see every second 1 new IMRS result which is OK
We want to have more RMS current values per second. If I change SD16DIV to 4, 2 or 1 than I have in all three situations a get the same result. The MSP gives each 0,5 seconds a new IRMS value.
1. Why has change the input clock via SD16DIV > 1MHz of the MSP430 this strange behaeviour?
2. What is the specification of the SD16CONF1 register? In the EMeter.c demo software a value of 0x48 is written but I can't find the definition of this register in the datasheets.
3. I also changed SD16OSR (oversampling) settings but this has no effect in timing at all.  How does SD16OSR effect the output cycle time of the MSP?
I would expect that MSP430 measurement cycle will be affected by the OSR setting but is not.
How can I get more RMS values per second and keep the energy measurement working?
TNX in advance
  • Hi Marcel,

    First, I have some questions about your hardware and software setup. Which EVM are you using? I'm assuming it's the EVM430-FE427A. For your software, are you running the generic MSP430-ENERGY-LIBRARY on this EVM?

    Next, are you wanting to increase the sampling rate (e.g. 4kHz to 8kHz) or the frequency of obtaining the accumulated energy values (e.g. updating every 0.5 second instead of 1 second) or both?

    When you made the changes above, did you rebuild all the projects before reprogramming the MSP430?

    When you changed the SD16OSR value, did you increase it? If so, try reducing it. Keeping the modulation frequency the same, reducing the OSR should increase your sample rate.

    Regards,

    James

    MSP Customer Applications
  • Hi James,

    Our own PCB is based on EVM430-FE427A and the software is based on the MSP430-ENERGY-LIBRARY. Our software and hardware are working fine with standard settings for 1 second measurement cycle.

    Our customer want to increase the frequency of obtaining the measured and calculated I RMS values in de ESP430 (more values per second). The frequency of obtaining the accumulated energy values is less important. So obtain I RMS value for example every 0.5 or 0.25 second instead of each 1 second.

    Yes I rebuild all the projects before programming the MSP430.

    In my default setup I used SD16OSR_256 like in the energy library. This gives the 1 second update rate for the ESP430 return registers.
    If I recompile with SD16OSR_64 and programming the ESP430. I assume that the update rate will be 4 times higher, but I see no change. Update rate stays 1 second.

    Changing the sampling rate gives a change but also not exactly what I expected.
    @8 kHz the ESP430 return registers are updated each 0.5 second. So this is what I expect, but sampling rate is now out of spec according the datasheet.
    @16kHz the update rate stays at 0.5 second. This is strange but yes I think I'am way out of spec now!

    Regards,

    Marcel de Jong
  • Hi Marcel,

    If I understand you correctly, your customer wants to increase the sampling rate (e.g. from 4kHz to 8kHz)? What's the reasoning behind their request? For example, do they want to capture certain harmonics and need the additional bandwidth? I'm sorry for all the questions, but I'm just trying to understand this application at all levels.

    Could you please explain how the device is out of spec when you change the OSR from 256 to 128? A specific section, table, or page in the datasheet would be helpful. The modulation frequency of the SD16 can be around 1MHz max. However, the sampling frequency can be calculated by the modulation frequency divided by the OSR. Since we can't increase the modulation frequency, the only option is to decrease the OSR to increase the sampling frequency. Does this make sense?

    Looking at how the metrology code works, a counter counts the number of samples. After a certain number of samples (let's say 4k), the registers will be updated with the latest energy values. If we increase the sample frequency by double (OSR = 128), I'd expect that the registers for the energy values would be updated in half the time (every 0.5 second instead of 1 second). If you want to keep the update time to 1 second, you'll probably have to double this counter. Otherwise, it's not an issue.

    The behavior you observed for other OSR values is definitely strange.

    Regards,

    James

    MSP Customer Applications
  • Hi James

    There is no reason to increase the sampling rate but it may be one possibility to speed up the update of the ESP430 return registers.
    What we need for now is accurate I RMS measurement and a bit higher response time to changes in this I RMS value. Lets say 250 ms. The IRMS_LO/HIGH return registers are only updated when the 4096 cycles of the ESP430 are complete. We need some I RMS values in between.

    The way my software works is like the metrology code. It counts 1024 samples get an interrupt from the ESP430 and reads the return registers. This principal works fine and each 250 ms I get an interrupt, but the return registers are only updated with new values once a second.

    Concerning out of spec:
    I think you misunderstand my comment. The SD16 modulation frequency has a maximum of 1 MHz / 256 OSR = 4 kHz sampling rate. It needs 4096 samples for a complete measurement. If I change modulation frequency with SD16DIVx register I can double the modulation frequency to 2 MHz / 256 OSR = 8 kHz sampling rate. This means 2x 4096 samples a second and I see the higher update rate of the return registers. This works but the modulation frequency is out of spec now. When I double it once more to 4 Mhz / 256 OSR = 16 kHz sampling rate. I expect 4x 4096 samples and 4 times an update of the return registers but this doesn't work. It only gives 2 updates per second. Strange behaviour but I agree Fmod is way out of spec.
    Conclusion modulation frequency should be fixed at its highest rate = 1 MHz; 4096 samples is a fixed value for calculation; So only the SD16OSRx setting can really change the update rate of th registers. Am I right?

    I don't understand why changing to SD16OSRx registers in my software have no effect. I will look to that again.

    Is there another way to read in between values of IRMS_LO/HIGH during a 4096 samples measurement?

    Regards,

    Marcel de Jong
  • Hi Marcel,

    I'm sorry for the delayed response, but I've spent some time digging into this topic. Here's what I've found.

    Like you observed, the return registers from the ESP430 are only updated with new values every 1 second. Unfortunately, this update rate is the fastest for the ESP430 in the MSP430FE427A. According to Section 1.2.4 in the ESP430CE1A Peripheral Modules User's Guide, the number of samples for a complete ESP430 calculation sequence is 4096 and is independent of the AFE sampling frequency (fM/SD16OSRx).

    Since this may be a limitation for the customer, I'd recommend that they look at the MSP430F6736A and the EVM430-F6736 if they need to revise this design.

    With regards to increasing the sampling frequency, I wouldn't recommend exceeding 1 MHz for the modulation frequency. Instead, keep this frequency at 1 MHz and decrease the OSR value to increase the sampling frequency. This is general feedback, since you don't need to increase the sampling frequency here.

    Regards,

    James

    MSP Customer Applications

**Attention** This is a public forum