Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Teensy 3.6 Fast pinMode alternative?

  1. #1

    Teensy 3.6 Fast pinMode alternative?

    Hi, I can switch the complete ports with GPIOE_PDOR and GPIOE_PDIR very fast (High/Low ~7ns)

    I was searching here in this forum for an also fast pinMode alternative, but I found nothing.
    My question: I want to switch a whole port from Input to Output. Is this possible?

    I've tried GPIOE_PDDR, but this is not working

    "pinMode" alone takes ~200ns ... and this is very slow.

  2. #2
    I found the solution by myself.

    You have to use pinMode(x, INPUT) and then you can manipulate the Port with GPIOE_PDDR very fast. Without pinMode before its not working!

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    8,000
    This is the code for Teensy 3.x pinMode(): https://github.com/PaulStoffregen/co...teensy.c#L1090

    Maybe it is somehow useful.

  4. #4
    Senior Member
    Join Date
    Dec 2013
    Location
    East Stroudsburg PA.
    Posts
    302
    fast pinMode alternative
    Use Global Pin Control Low Register (PORTx_GPCLR) :https://forum.pjrc.com/threads/64970...x_GPCHR-How-to

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •