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.

  • Resolved

MSP430FR2633: Conversion of capacitance into counts

Prodigy 40 points

Replies: 18

Views: 855

Part Number: MSP430FR2633

Hi,

I am trying to figure out what formula does the MSP430FR2633 controller follow to convert capacitance into counts. I read at another post that this controller is particularly good at sensing change in capacitance. So, how can I calculate analytically the conversion of delta in capacitance to delta in counts? What I am trying to do is create a script that will automate the calculation of the conversion count and conversion gain, providing as input the relative change in capacitance before and after touch, and the targeted sensitivity. I do take into consideration parasitic capacitance from traces as well.

Thank you in advance,

Giannis

  • In reply to Dennis Lehman:

    Hello Konstantinos,

    I setup an experiment with the MSP430FR2633 EVM kit (CAPTIVATE-PGMR + MSP430FR2633 MCU PCB only) and did the following:

    1. created a single self capacitive button in the Captivate design center using channel CAP0.0.
    2. imported and programmed the MCU.
    3. set conversion_gain = 100, conversion_count = 500.
    4. in real time I see LTA = Conversion Count = 492.
    5. connect 1pf capacitor to CAP0.0
    6. Conversion Count drops to 277.
    7. Using the formula provided I calculate a 16% change.

    Formula: ((conversion_gain/count)-(conversion_gain/conversion_count))
    conversion_gain = 100
    Conversion Count = 492
    count = 277 (this is the actual reported count).

    Now this tells me that when I added 1pf to the baseline capacitance of the MCU + traces + connector (which is unknown at this point) I see a 16% change. I can now back calculate what the baseline capacitance is:
    (Where Cx = unknown or baseline capacitance)

    1.16 = (Cx + 1pf)/Cx
    1.16Cx = Cx + 1pF
    1.16Cx - Cx = 1pF
    Cx(1.16-1) = 1pF
    Cx(0.16) = 1pF
    Cx = 1pF/0.16
    Cx = 6.25pF

    Now that we know what the baseline circuit capacitance is I add a 1.5pf capacitor and repeat the same measurements.
    This time I see:
    count = 230.
    Doing the calculation tells me there is a 23% change.
    Knowing that Cx = 6.25pF then (6.25 + 1.5)/6.25 = 1.24 or 24% change.

    Next I change the conversion_gain = 200 and repeat the same measurements and calculations and get 16% with 1pf and 24% with 1.5pF.

    Now I set my conversion_gain back to 100 and change the conversion_count from 500 to 300 and repeat.
    I get the same results.

    This time I'll bump the conversion_gain way up to 800 and repeat.
    Once again I get essentially the same values.

    See if you can duplicate what I have done.

    Dennis Lehman

  • In reply to Dennis Lehman:

    Hello Dennis,

    Thank you, your answer was very enlightening.

    I will try to duplicate what you describe. 

    I have a question: The known capacitors that you used (1pF and 1.5pF) , are the reference capacitors of the CapTIvate peripheral ?

    Konstantinos

  • In reply to Konstantinos Bazirgiannis:

    Exactly.

    I attached my code.  Should give you some idea how to setup and use the internal ref caps.

    7318.main.c

    Dennis Lehman

  • In reply to Dennis Lehman:

    Hi Konstantinos,

    I was curious if you are making progress.

    Dennis Lehman

  • In reply to Dennis Lehman:

    Hi Dennis,

    Thanks for your quick response.

    I will do the experiment on Monday and I'll get back to you as soon as I am done.

    Konstantinos

  • In reply to Konstantinos Bazirgiannis:

    Hi Konstantinos,

    I haven’t heard from you for a couple of days now, so I’m assuming you were able to get everything working the way you wanted.
    If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

    Dennis Lehman

  • In reply to Dennis Lehman:

    Hello Dennis,

    I am sorry for the delay, but in the last week I didn't have much time to replicate your suggestions. 
    I am on it this week and I'll post my findings as soon as I am done.

    Konstantinos

  • In reply to Konstantinos Bazirgiannis:

    Hi Dennis,

    I’ve tested the procedure you recommended and everything is working as expected.

    e.g. for conv_count = 500 and conv_gain = 100 I measure 493 for the LTA and when I connect the 1pF ref cap the counts drop at 274 resulting in 16.2% change and 6.2 pF baseline capacitance. Likewise, for the sets of values 500-200, 600-100 and 600-200 I get essentially the same percentage change.

    Thanks a lot for your guidance.

    Konstantinos

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.