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.

Reg: toggle frequency of GPIO pins on MSP430F5529 ...

Other Parts Discussed in Thread: MSP430F5529

Hi all. 

I was using the MSP430F5529 eval board and I had set the mclk to around 33 MHz. What I am trying to do is toggle a GPIO pin (or any other pin) on the  micro at a frequency as close to 20MHz as possible. The code I use for toggling is - 

for (; ;)

P1OUT ^= BIT0;                          

One of the previous posts say that the for and the toggle statement will take around 12 to 15 cycles to execute so the max. toggle frequency I am looking at is 33/15 = around 2 MHz. 

I know this is a limitation of the micro, but is there any other way of increasing the toggle frequency of the I/O pins to bring it upto 20 MHz, maybe like using a timerA on an I/O pin etc.? I know I can set the MClk to 20MHz and bring it out on a pin, but I need to do some more calculations with the toggle freq. (phase shift etc.) so I need to toggle a GPIO pin that I can control easily by keeping it in a for loop.  Also, is 50MHz the max. MClk freq for the MSP430F5529?

Do let me know. Help will be greatly appreciated ...

Thanks ...

z.

  • Zubin,

     

    Firstly that device is spec'd to run no faster than 25 MHz so running the part at 33MHz is out of spec.

    If you would like to toggle a pin as fast as possible I would use a timer in a PWM fashion. Please see the various code examples we have to implement something like this:

    http://www.ti.com/litv/zip/slac300d

    If you would like a faster toggle rate take a look at the MSP430F51x1/51x2 devices which have two TimerD units supporting up to 256MHz operation.

**Attention** This is a public forum