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.

MSP430FR6047: MTIF frequency output not as expected

Part Number: MSP430FR6047

Hi,

I used your example to send for example 3 pulses every 2 Seconds

MTIF_clearPulseGenCounter(MTIF_BASE);
MTIF_enablePulseGen(MTIF_BASE);
MTIF_setPulseGenPulseGridFreq(MTIF_BASE, MTIF_PULSE_GRID_FREQUENCY_64HZ);
MTIF_setPulseGenCountNum(MTIF_BASE, 3);
MTIF_clearPulseKCountUpdateRequest(MTIF_BASE);
while(MTIF_isPulseKCountUpdated(MTIF_BASE) == MTIF_K_COUNT_IS_NOT_UPDATED);
// Enable the MTIF terminal pins
MTIF_enableTestPortOutput(MTIF_BASE);
// Enable test port output
MTIF_enableTestPortTerminalActivationBySW(MTIF_BASE);
// Clear pulse counter and enable pulse counter
MTIF_clearPulseCounter(MTIF_BASE);
MTIF_enablePulseCounter(MTIF_BASE);

I expect 3 pulses equally spreaded over the 2 seconds window

What I see is this:

In this frame marked I want to have just 3 pulses. I do not get the documentation. Maybe it could be clarified something.

Kind regards

  • Hi Tunguskar,

    It looks like you are working from the MTIF example in the SDK. Is that correct?

    I started running the example to try to achieve the output you are looking for, and I noticed that the example doesn't quite show how to change the pulse grid frequency properly. Are you seeing this as well?

    I ended up fixing it by adding the MTIF_clearPulseGridFreqUpdateRequest() function after updating the pulse grid frequency, and things started to behave as expected. I now have the MTIF set up to output 3 pulses every two seconds, so I'll paste the code for this below. It looks quite similar to yours. I assume that you pulse grid frequency is just "stuck" at an incorrect value.

    To use the code below, simply replace the entire section between "/* ---Begin initialize the MTIF--- */" and "/* ---End initialize the MTIF--- */" with the code snippet below:

            /* ---Begin initialize the MTIF--- */
        // Enable the pulse generator, and set the initial grid frequency
        // Pulse grid freq. = 1024Hz (frame freq. = 1024/256 = 4Hz)
        MTIF_clearPulseGenCounter(MTIF_BASE);
        MTIF_enablePulseGen(MTIF_BASE);
        MTIF_setPulseGenPulseGridFreq(MTIF_BASE, MTIF_PULSE_GRID_FREQUENCY_64HZ);
        MTIF_clearPulseGridFreqUpdateRequest(MTIF_BASE);
        // KVAL = 4. 8 pulses per 256 periods of 1024Hz.
        MTIF_setPulseGenCountNum(MTIF_BASE, 3);
        // K-count update request
        MTIF_clearPulseKCountUpdateRequest(MTIF_BASE);
        // Wait for update acknowledge
        while(MTIF_isPulseKCountUpdated(MTIF_BASE) == MTIF_K_COUNT_IS_NOT_UPDATED);
        // Enable the MTIF terminal pins
        MTIF_enableTestPortOutput(MTIF_BASE);
        // Enable test port output
        MTIF_enableTestPortTerminalActivationBySWAndHW(MTIF_BASE);
        // Clear pulse counter and enable pulse counter
        MTIF_clearPulseCounter(MTIF_BASE);
        MTIF_enablePulseCounter(MTIF_BASE);
            /* ---End initialize the MTIF--- */

    Please let me know if this does not help or if you have additional questions.

**Attention** This is a public forum