MCF8316A: I2C control vs dedicated pins

Part Number: MCF8316A

What are the advantages of using the dedicated speed/brake/dir pins versus controlling the motors using I2C? Our application requires three motors to be controlled from one MCU, and just using I2C for all three motors would reduce the number of wires significantly. Speed of all three motors are controlled by a PID system that self-balances a robot, so the speeds are updated pretty frequently. 

Other question regarding MPET: can this measurement be done once during assembly, or does MPET require to be executed after each reboot? While using the EVM I've noticed that the MPET values sometimes reset to 0 after the EVM is turned off and on. 

  • Hi Daan, 

    Our team is currently out of office today for July 4th holiday in the US - but we will review your question and aim to provide a response by end of the week. Thanks!

    For an initial answer, I believe the MPET procedure can be done once to determine the motor parameter values, and then the user can store them in EEPROM memory so that they don't need to re-run MPET after every system power cycle. More info on this in section: 7.3.13 Motor Parameter Extraction Tool (MPET) [page50-52 of datasheet]

    Best Regards, 

  • Hi Daan,

    Controlling the speed, brake and direction using the device HW pins would be quicker than controlling via I2C as there will be propagation delay over I2C lines. If these three signals are not changed at very high rate then I would recommend you to control all three using I2C.  

    MPET can be done once during assembly by setting MPED_CMD, MPET_R, MPET_L and MPET_KE to 1 or by programming R, L and Ke to zero. After the device completes MPET routine,  you can enable MPET_WRITE_SHADOW. This will copy the MPET measured motor parameters to the shadow registers MOTOR_RES, MOTOR_IND and MOTOR_BEMF_CONST. You can write the registers to EEPROM if you wish not to run MPET again. After power cycle, MOTOR_RES, MOTOR_IND and MOTOR_BEMF_CONST will be non-zero so the device will not run MPET. 

    Below block diagram explains the MPET sequence.



  • Hi Daan,

    Do you still need assistance on this thread? If not, please mark as Resolved.