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

Thread: 3 Phase Motor Driver and Fast Port Manipulation

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    8

    3 Phase Motor Driver and Fast Port Manipulation

    I am working on building the program for a 3 phase motor driver that I constructed, but I am noticing some timing discrepancies arising from small delays in digital write commands. Specifically, during times when I want all three phases to be low or high, I am seeing delays of approximately 250ns between each command. Using DigitalWriteFast offers nearly the same result as using DigitalWrite.

    So I have two questions:

    1. Does anyone know of an existing 3 phase driver library that is fairly well developed? I have not been able to locate anything of this nature and would rather not reinvent the wheel if not necessary.

    2. If I am using a Teensy 3.6, what would the direct port manipulation command look like to set pins 21, 22, 23 to either high or low, simultaneously?


    I can post code for the latter, but it would literally be three digitalWrite commands, one after another.

  2. #2
    Junior Member
    Join Date
    Feb 2019
    Posts
    8
    Update: I reformatted a few if statements and now the outputs are turning off almost simultaneously.

Posting Permissions

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