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.

MSP430FR2155: Maximum clock frequency we can get from a GPIO pin

Part Number: MSP430FR2155

Hello,

I am working on SPI communication and I have configured SPI protocol using GPIO pins without using SPI registers(UCxCTL).

What is the maximum frequency I can achieve on GPIO pins. I want configure my SPI protocol clock frequency to minimum of 1MHz. Can GPIO pins configurable for that frequency?

Thank You.

Regards.

Balaji

  • Hi Balaji,

    According the FR2155 datasheet, the maximum SPI clock rate is 8MHz, even though the GPIO pins can be clocked faster than this, so you are limited to 8MHz.

  • According the FR2155 datasheet, the maximum SPI clock rate is 8MHz, even though the GPIO pins can be clocked faster than this, so you are limited to 8MHz.

    CPU need minimum 3 CPU clocks (one assembler instruction) for port write. In case with devices running on 24 MHZ it can't go faster than 8 MHz. It is possible to do it in 2 CPU cycles with DMA, but AFAIK there is no DMA in FR2xx family.

  • Thank you for the response,

    Is it required to program clock frequency to GPIO port seperately or will it automatically takes the system clock frequency.

    If we need to program means, Can you provide a sample code for configuring 8MHz Clock frequency to GPIO port pins(specifically P1.5, this is my clock pin).

    Thank you.

  • If for transfer is used hardware peripheral module, than module clock should be selected, and than clock signal on pin (if exists) is generated by peripheral.

    If it is bit banging / software based, than MCLK CPU instruction define timing. In this case for clock signal on pin (if it is constant) can be used timer to release CPU bandwidth.

  • Hi Balaji,

    It's been a while since we have heard from you, so I'm going to assume you were able to move forward with your project.
    I will mark this posting as RESOLVED, but 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 is locked, 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.

  • Hello Dennis,

    Sorry for the late response, I was testing with some other methods. But I am unable resolve the issue. My doubt is can we set the clock frequency to GPIO Peripheral as we do it for other peripherals like UART,SPI, etc. If we can set means how can we do that.

    I am implementing SPI communication using GPIO pins(without configuring SPI driver). The implementation is working fine as I can send data. But clock frequency is the main issue I am facing. I have configured GPIO P1.5 as the clock pin and now I want to generate minimum of 1MHz clock. How can I achieve this??

    Thank you.

  • Hello zrno soli,

    Sorry for the late response, I was testing with some other methods. But I am unable resolve the issue. My doubt is can we set the clock frequency to GPIO Peripheral as we do it for other peripherals like UART,SPI, etc. If we can set means how can we do that.

    I am implementing SPI communication using GPIO pins(without configuring SPI driver). The implementation is working fine as I can send data. But clock frequency is the main issue I am facing. I have configured GPIO P1.5 as the clock pin and now I want to generate minimum of 1MHz clock. How can I achieve this??

    Thank you.

  • No, you can not set clock directly for GPIO bit banging like for other hardware peripherals. MCLK is clock source for GPIO and it can be aligned in assembler (counting CPU clocks for related assembler instructions). For example here...

    https://forum.43oh.com/topic/1284-software-async-serial-txrx-without-timer/

    you can see how cycle aligned assembler code is used on F2xx family for software UART.

    When you change state for clock pin (P1.5) until other state change there are some other operation inside code that take some time, and because of this you can not achieve 1 MHz (or some other value).

**Attention** This is a public forum