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.

MSP430G2553: determine difference between two input signals

Other Parts Discussed in Thread: MSP430G2553

Tool/software: Code Composer Studio

Hello everyone ..
I am new to this group and I would like to ask you questions about the programming of MSP430 ... it is possible to compare two signals of two input pins and to make their difference with the MSP430..I use a MSP430G2553 .

Thank you
  • Hi,

    the MSP430 has an integrated single-supply A/D converter which you can use to convert input signals. Please be aware that you can only convert signals between 0V and Vcc though.

    You can use the external ADC channels to convert the signal and internally determine the difference between the two signals.

    Please refer to the MSP430x2xx Family User's Guide for the right peripheral configuration and also check out the number of software examples provided via Code Composer Studio-. Resource Explorer-> Software-> MSp430Ware->Devies -> MSP430G2xx-> MSP430G2553 -> Peripheral Examples -> Register Level.

    Those will help you to get started with the internal 10-Bit ADC.

    Please let me know if this answers your question.

    Best regards,

    Britta

  • Hi,

    have you been able to troubleshoot and solve your problem?
    Please verify the answer if it solved your problem or otherwise provide further information on the issue.

    Note that I will close this thread soon in case I won't hear back from you.
    Thanks and best regards,
    Britta
  • Hello,
    sorry for the delay, but what I want. it is to have the difference of time between two external interrupts on two different pin. 
    I therefore want to have the delay for example between an interruption A and B. How can I do to have this duration. Thank you very much,
  • hi ,
    if you want to measure the time difference between occurrence of two external interrupt you can use timer. when interrupt A occurs start the timer and when interrupt B occurs stop the timer.

    regards
  • Hello
    What you can give me a sample code to do this. Because I do not know how to recover this duration
    thank you.
  • Example msp430g2xx3_ta_21.c [SLAC485D, see "Tools and Software" on the product page] demonstrates Timer Capture mode [see also SLAU144J section 12.2.4]. You just need to extend it from one to two CCRs for your two signals.
  • Hi,

    have you been able to troubleshoot and solve your problem?
    Please verify the answer if it solved your problem or otherwise provide further information on the issue.

    Note that I will close this thread soon in case I won't hear back from you. IF your problem persists just reply to the thread again and it will be re-opened.
    Thanks and best regards,
    Britta

  • in fact, my goal is to control a triac that has inductive loads, so we know that there is a voltage-current phase shift ... The question what, how can I order this triac so that the pulse falls at the right time, so I need a sample code if there is someone who can help me. I use MSP430G2553.

    thank you very much.

  • "in fact, my goal is to control a triac..."

    your goalpost seems to keep changing each time someone tried to help you.

    why don't you just lay it out exactly what you are trying to do in the beginning and be done with it?

  • My goal is to control a triac by a generator of the pulse signal made by the MSP, specifying that the triac has an inductive load so there is a phase difference between the voltage and current, but the goal is to have a maximum current in the load.I have in my disposal a circuit that detects the passage of zero voltage and current, but my problem is at the level of the coding on MSP.pour know the right moment to start the trigger triac.

    That's the goal in all.
    thank you very much
  • Did you look at the example program I mentioned? It measures the time difference between two successive pulses (edges) on a single input, but if you duplicate the setup for a second CCR you can measure the difference between corresponding edges on the two inputs. Using a second CCR (rather than another timer) means the two signals are measured using the same time base, so it's meaningful to just subtract them.
  • hello ..i'm well looked at the example code that you gave me ,, yes me aussie I thought the same thing .if I understand the fact actually the same code but with another timer .. 
    I'm going to first, if I get a result, I'll signal you ..
    thank you very much
  • Hi,

    you actually don't need a second timer, you can work with just one timer but use two Capture/Compare Registers. That way you'll actually work with the same time base for your measurements.

    Take a look at the MSP430x2xx Family User's Guide, Section 12 Timer_A, especially part 12.2.5.3 and 12.2.5.4 could help you understand how to work with two different CCR of the same timer.

    Please let us know if this helps you moving forward.

    Best regards,

    Britta

  • Hi,

    were you able to move forward? Please let me know if there are still open questions or if I can go ahead closing this thread.

    Best regards,
    Britta

**Attention** This is a public forum