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.

CCS/MSP432P401R: The maximum turn frequency of I/O port

Part Number: MSP432P401R
Other Parts Discussed in Thread: TM4C129XNCZAD, TM4C129XKCZAD

Tool/software: Code Composer Studio

I write a test code to test the maximum turn frequency of a GPIO of MSP432P401R on CCS6.2. CPU clock is set to 48MHz. And P5.0 is set to output mode and only be alternately pulled up and pulled down when code is running. The time cost of turning the I/O is 250ns(then the frequency is only 4MHz). Is this the maximum speed of the I/O? I haven't searched any information about this in the datasheet of MSP432. 

Thanks.

  • guangjun lv said:
    I haven't searched any information about this in the datasheet of MSP432. 

    So you want that someone search it for you and provide in edible form? How convenient :) Hint: chapter "Timing and Switching Characteristics"

    guangjun lv said:
    The time cost of turning the I/O is 250ns(then the frequency is only 4MHz). Is this the maximum speed of the I/O?

    No. GPIO can toggle much faster than that. Such way you are not testing maximum speed of I/O, but speed of (your) I/O pin toggle code.

  • Hi  Ilmars

    Sorry, for your first replication, it's my describe fault. What i want to say is that i have searched in the spec but don't find relevant information.

    Thanks for your information about the toggle speed of I/O.  Maybe  some register about the I/O should be configured while i don't know. Could you give me some suggestion where i could investigate tommorrow

    ? Thanks.

    Best Regards

  • IO operations, like GPIO writes, are read-modify-write operations on Cortex M, and take more than one or two cycles. The port peripherals of this controllers are more complex than that of older 8-bit MCUs, and need to take care that all states (output registers and read-back registers) are consistent.

    This in-famous "fastest GPIO toggle" is no use case for such a MCU. The peripherals are designed to work in a highly autonomous fashion, with as few core intervention (code) as possible. Pulling a GPIO pin up and down in a mega-hertz loop renders the whole MCU useless.

    Better search for a MCU with a peripheral that implements you required functionality in hardware.

  • guangjun lv said:
    What i want to say is that i have searched in the spec but don't find relevant information.

    Datasheet, Table 5-23. Digital Outputs, Normal I/Os

    It says that I/O at normal speed mode can toggle up-to 24MHz which at 48MHz system clock is theoretical maximum anyway. Thou you can't toggle pin so fast using CPU, you shall use one of peripherals like timer, SPI or DMA+GPIO.

    Why you are looking for pin toggle speed? What's the application? What you want to achieve?

  • f. m. said:
    IO operations, like GPIO writes, are read-modify-write operations on Cortex M

    Not if you use bit-banding of Cortex-M3/M4 which is supported by msp432 too.

  • Hi Ilmars

    Thanks for your detailed explanation and telling me the location of I/O toggling speed in spec. 

    I want to use MSP432 to realize a 1-wire controller. When running in the overdrive mode of 1-wire protocol, MCU and I/O should ack request as soon as possible.

    Best Regards

  • guangjun lv said:
    I want to use MSP432 to realize a 1-wire controller. When running in the overdrive mode of 1-wire protocol, MCU and I/O should ack request as soon as possible.

    Maxim/Dallas 1-wire protocol? - As far as I know, overdrive mode requires 1us reaction time and 0.25us delay capability which is withing reach of msp432 at 48MHz. If you care about performance, you could find maxim appnote using uart for 1-wire useful.

  • Protocol emulation seems a legitimate case for "bitbanging". One just needs to keep in mind that the core is hooked up at that time.
    BTW, this Dallas 1-wire protocol does not appear to have widespread MCU hardware support. I found just one AVR controller with such a peripheral.
  • f. m. said:
    BTW, this Dallas 1-wire protocol does not appear to have widespread MCU hardware support.

    The TM4C129XNCZAD and TM4C129XKCZAD have 1-Wire Master hardware support.

    [From a quick look at the TI selection guides didn't find any other TI MCUs with 1-wire hardware support]

  • Thanks, didn't see that.

    My LM4C Launchpads than propably have not. However, I never had the need for this protocol yet.

  • Hi Ilmars

    Yes, Maxim/Dallas 1-wire protocol. MSP432 could match my requirement if working in 48MHz. And uart could realize 1-wire communication is a good news too. I will choose a simple one. Anyway, thanks for your kind-hearted help.

    Best Regards

  • Hi f.m.
    Thanks. 1-wire protocol has few hardware support, fortunately, it's not a complex protocol. Which AVR controller has this peripheral?

    Best Regards
  • Sorry, seems I misread the link that came up in the search. This example I referred to is actually an application node, decribing software implementations - no peripheral.

    However, it might still be of interest for you. It presents two implementations, one based on simple GPIO, and one using the UART peripheral.

    See here (PDF): www.atmel.com/.../Atmel-2579-Dallas-1Wire-Master-on-tinyAVR-and-megaAVR_ApplicationNote_AVR318.pdf

  • Hi f.m.

    Thanks for all your(and Ilmars) attentive help. 

    Best Regards

**Attention** This is a public forum