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.

MSP430FR6043: MSP430FR6043

Part Number: MSP430FR6043

Hey E2E Team,
i have a problem regarding the MTIF pulsgeneration. I tried to understand its function using Example msp430fr6043_mtif_02.c but i don't get it at all. 
Firstly with the example of 8 pulses per 250ms, i tried to see after 10 seconds the number of pulse it should be 320 pulses, but i get 316 and i wonder why the 4 pulse are missing. 
secondly  i don't see any difference if i use PGFS_0, or PGFS_7, or other PGFS defined in msp430fr6043.h, so i don't undertand, which criteria i have look at in order to choose PGFS. 
the third and last one, i don't really understand how got MTIFPGKVAL = 4, in order to have 8 pulses in 250ms. what should be my MTIFPGKVAL if i want for example to have 200 pulses per second assuming PGS is PGFS_7 and how did you get this MTIFPGKVAL? 

thank you

  • This module is obtuse, and the documentation is not always 100% correct. In fact, I remember one of the examples (possibly the one you're referencing) did not actually work as TI intended. In my application, I implemented a TIMER_B instance instead for my output pulses. This would especially be required if you want a consistent output frequency; the MTIF does not output a stable frequency, there will always be a missing pulse at the end of the frame.

    Make sure you read the User Guide (SLAU367) Chapter 23 carefully to setup and update the output. Some of the descriptions are incorrect based on my testing in the past so it will require some trial and error. For example, Table 23.1 and the MTIFPGCNF register descriptions are not consistent; one states PGFS_0 is a 16 Hz grid frequency, while the other states the grid frequency is 8 Hz.

    PGFS essentially limits your output pulse rate. For example, PGFS_5 sets the output grid frequency to 256 Hz. This means you can only output a pulse rate of 128 Hz. However, in each "frame", one of the time slots is reserved for updating the next frame and no pulse will be output. Keeping with PGFS_5, you can output from 0 up to 127 pulses in one second (frame duration). You will need to figure out what your maximum number of pulses per second is from your meter and choose the correct PGFS value.

    KVAL is how many pulses are output per "frame". In your case, PGFS_7 represents a 1024 Hz grid frequency according to the register description, which in theory is a 250 mSec frame duration. If you wanted 200 pulses in one second, you'd set your KVAL to 50 since there will be four frames in one second. Choosing PGFS so that you have a 1 second frame duration, your KVAL would be directly the number of pulses output in a single second.

  • Hello Seth, 
    Thank you for your Information. but i still have an issue. for me whether i use PGFS_0 or PGFS_7, or the the others the limit is always 127 pulse per Frame. 
    this is what made totally confused. as you said in msp430fr6043 it is not the same as in SLAU367. can you share me your codes for the TIMER_B if possible?  may be it will be help full. 

  • the limit is always 127 pulse per Frame

    That is correct, the PFGS value is only limiting your output pulse rate. As I mentioned in the original post, if you have a requirement on output frequency/pulses per second, you will need to choose the correct PFGS value.

    It would take ~4 seconds at 32 Hz pulse rate to output 127 pulses (4 sec * 32 pulses per second == 128 pulses), while at 128 Hz output rate, it would take slightly less than 1 second (1 sec * 128 pulses per second == 128 pulses). Another example, 1024 Hz output rate which is 125 mSec frame duration, 0.125 sec * 1024 pulses per second == 128 pulses. However, the MTIF needs time to update the next frame which is why it only allows for up to 127 pulses per frame instead of 128.

**Attention** This is a public forum