TIDUF74A April   2024  – April 2024

 

  1.   1
  2.   Description
  3.   Resources
  4.   Features
  5.   Applications
  6.   Design Images
  7. 1System Description
  8. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Design Considerations
    3. 2.3 Highlighted Products
  9. 3Hardware, Software, Testing Requirements, and Test Results
    1. 3.1 Hardware Requirements
    2. 3.2 Test Setup
    3. 3.3 Test Results
  10. 4Design and Documentation Support
    1. 4.1 Design Files
      1. 4.1.1 Schematics
      2. 4.1.2 BOM
    2. 4.2 Tools and Software
    3. 4.3 Documentation Support
    4. 4.4 Support Resources
    5. 4.5 Trademarks
  11. 5About the Author
  12. 6Revision History

Design Considerations

The TIDA-010950 provides a single board design for BLDC motor control and electronic expansion valves control. This reference design allows the user to choose between BLDC motor control and stepper motor control.

This section outlines the theory and design considerations used to develop and design the TIDA-010950.

Selectable 24 VAC or 24 VDC Input

This reference designs allows for the user to select between either a 24VAC or a 24VDC input. Figure 2-2 shows the 24VAC and 24VDC inputs along with the switch to select between the two inputs. J18 is the 24VAC input connector. J19 is the 24VDC input connector, and S1 is the switch to select which input is being used.

TIDA-010950 TIDA-010950 Input Power Source SelectFigure 2-2 TIDA-010950 Input Power Source Select

24VAC Rectification

In this design when 24VAC input option is selected a full-bridge rectifier is used for DC rectification of the 24VAC input. The 120VAC to 24VAC voltage transformer has a leakage inductance and a parasitic capacitance. When the four diodes of the bridge rectifier are not conducting, the devices form a resonant circuit that oscillates at a high frequency. One of the methods of reducing this oscillation is to use capacitors connected in parallel with the diodes, which helps to reduce the oscillation significantly.

Figure 2-3 below shows the simulation circuit and the resulting waveforms for the rectification stage leveraging a 100Ω resistor for the load.

TIDA-010950 24VAC Rectification TINA-TI Simulation CircuitFigure 2-3 24VAC Rectification TINA-TI Simulation Circuit
TIDA-010950 24VAC Rectification TINA-TI Simulation WaveformsFigure 2-4 24VAC Rectification TINA-TI Simulation Waveforms

eFuse Protection

The TIDA-010950 reference design leverages a TPS16410 eFuse to protect the ICs in the event of an overvoltage or overcurrent event. Figure 2-5 shows the implementation of the TPS16410 in this reference design. Depending on the input voltage applied, the TPS16410 can regulate the input power from 2W all the way up to 64W, based on the individual requirements of the implementation. For this design, the testing is done leveraging the 24VDC input, but the user can change the power regulation and protection thresholds as needed based on the following calculations.

TIDA-010950 TPS16410 E-Fuse Circuit ImplementationFigure 2-5 TPS16410 E-Fuse Circuit Implementation

To program the output power limit threshold of the TPS16410, use Equation 1 to calculate the required resistance of RPLIM (R36). To keep output power limit ≤ 15W, R36 was selected as 95.3kΩ.

Equation 1. PLIM= 13.82W95.3 kΩ × RPLIM

Input overvoltage protection setpoints can be set by connecting resistors (R31, R32) from the IN pin to OVP pin. The value of R31 and R32 can be calculated using Equation 2 and Equation 3. To set the OVP rising setpoint to 41V, R31 = 1MΩ and R32 = 38.3kΩ were selected. For a OVP setpoint of 28V in the case where the input voltage is 24VDC, R32 can be changed to 59kΩ.

Equation 2. OVP Rising Setpoint= VOVPR×(R31+R32)R32 
Equation 3. OVP Falling Setpoint= VOVPF×(R31+R32)R32 

To set the output overcurrent setpoint, a resistor (R37) is required on the IOCP pin. To calculate the value of R37, use Equation 4. R37 was selected as to set IOCP to 1.5A, yielding a resistance to the nearest 1% value of 11kΩ.

Equation 4. IOCP= 2.25ARIOCP × 7.32kΩ

The TPS16410 also provides blanking time for overload or overcurrent events. This blanking time can be configured by connecting a capacitor on PDLY, and can be calculated using Equation 5. To set the blanking time to 6.5ms, C48 was selected to be 12nF.

Equation 5. Blanking Time (PDLY)= 6.5 ms12 nF × C48

For charging the large capacitors on output, the output slew rate can be controlled by using a capacitor on dV/dt pin. The value of inrush current can be estimated by Equation 6. To keep the inrush current below 75mA, C47 is selected as 150nF.

Equation 6. IINRUSH= IdVdt×GdVdt × COUT C47

TVS diode (D3) was added to protect the TPS16410 against voltage transients.

LMR38020 Voltage Rail

The LMR38020 is used to convert the 24V source to 15VDC for powering the motor drives and as an input to the 3.3V buck.
TIDA-010950 LMR38020 Circuit
                    Implementation Figure 2-6 LMR38020 Circuit Implementation

The choice of switching frequency is a compromise between conversion efficiency and overall design size. Lower switching frequency implies reduced switching losses and usually results in higher system efficiency. However, higher switching frequency allows the use of smaller inductors and output capacitors, hence, a more compact design. For this design a switching frequency of 400kHz is used.

The output voltage of LMR38020 is externally adjustable using a resistor divider network. The range of recommended output voltage is found in the Recommended Operating Conditions of the data sheet. The divider network is comprised of R29 and R30, and closes the loop between the output voltage and the converter. The converter regulates the output voltage by holding the voltage on the FB pin equal to the internal reference voltage, VREF. The resistance of the divider is a compromise between excessive noise pickup and excessive loading of the output. Smaller values of resistance reduce noise sensitivity but also reduce the light-load efficiency. The recommended value for R29 is 100kΩ, this design follows the recommended value. After R29 is selected, Equation 7 is used to select the value of . VREF is nominally 1V.

Equation 7. R 30 =   R 29 V O U T V R E F - 1

The parameters for selecting the inductor are the inductance and saturation current. The inductance is based on the desired peak-to-peak ripple current and is normally chosen to be in the range of 20% to 40% of the maximum output current. Experience shows that the best value for inductor ripple current is 30% of the maximum load current. Note that when selecting the ripple current for applications with much smaller maximum load than the maximum available from the device, use the maximum device current. Equation 8 can be used to determine the value of inductance. The constant K is the percentage of inductor current ripple. For this design, choose K = 0.175 and find an inductance of L = 60µH. Select the next standard value of L = 68µH for L2.

Equation 8. L 2 =   ( V I N - V O U T ) f s w × K × I O U T M A X × V O U T V I N

Inductors with a ferrite core material have very hard saturation characteristics, but usually have lower core losses than powdered iron cores. Powered iron cores exhibit a soft saturation, allowing some relaxation in the current rating of the inductor. The inductor saturation current must not be less than the device low-side current limit. To avoid sub-harmonic oscillation, the inductance value must not be less than that given in Equation 9:

Equation 9. L M I N M × V O U T f S W = 0.42 × 15 V 400   k H z =   15.75   μ H

Where

  • LMIN = minimum inductance (H)
  • M = 0.42
  • fSW = switching frequency (Hz)

TPS62932 Voltage Rail

The TPS62932 is a highly integrated, synchronous, step-down, DC-DC converter. This device is used to convert the 15VDC output from the LMR38020 to a 3.3VDC rail to provide power to the MSPM0 and peripherals in this reference design.
TIDA-010950 TPS62932 Circuit
                    Implementation Figure 2-7 TPS62932 Circuit Implementation

The output voltage is set with a resistor divider from the output node to the FB pin. TI recommends using 1% tolerance or better divider resistors. Referring to Figure 2-7, start with 10kΩ for R39 and use Equation 10 to calculate R38 = 30.9kΩ. To improve efficiency at light loads, consider using larger value resistors. If the values are too high, the converter is more susceptible to noise and voltage errors from the FB input leakage current are noticeable.

Equation 10. R 38 =   V O U T - V R E F V R E F × R 39

The choice of switching frequency is a compromise between conversion efficiency and overall design size. Higher switching frequency allows the use of smaller inductors and output capacitors, and hence, a more compact design. However, lower switching frequency implies reduced switching losses and usually results in higher system efficiency, so the 500kHz switching frequency was chosen for this reference design by leaving the RT pin floating.

The large CSS can reduce inrush current when driving large capacitive load. In this design 33nF is chosen for C45, which sets the soft-start time, tSS, to approximately 5ms.

A 0.1µF ceramic capacitor must be connected between the BST to SW pins for proper operation. TI recommends to use a ceramic capacitor with X5R or better grade dielectric. The capacitor C46 must have a 16V or higher voltage rating.

The EN pin for the TPS62932 has an internal pullup current source, which allows the user to float the EN pin to enable the device. In this reference design the EN pin is left floating to enable to device.

The most critical parameters for the inductor are the inductance, saturation current, and the RMS current. The inductance is based on the desired peak-to-peak ripple current, which can be calculated by Equation 11.

Equation 11. i L =   ( V I N _ M A X - V O U T ) f s w × L × V O U T V I N _ M A X

Usually, the K coefficient represents the amount of inductor ripple current relative to the maximum output current of the device, a reasonable value of K is 20% to 60%. For this reference design a value of 40% was chosen for K. Since the ripple current increases with the input voltage, the maximum input voltage is always used to calculate the minimum inductance L. Use Equation 12 to calculate the minimum value of the output inductor to be 6.44. Given this minimum inductance value, L3 = 7.8 was selected for this design.

Equation 12. L 3 =   ( V I N - V O U T ) f s w × K × I O U T M A X × V O U T V I N

DRV8316C BLDC Motor Driver

For the TIDA-010950 the SPI variant was selected. The SPI variant supports a serial communication bus that allows the MSPM0 to send and receive data with DRV8316C. This allows the MSPM0 to configure device settings and read detailed fault information. The SPI is a four-wire interface using the SCLK, SDI, SDO, and nSCS pins.

TIDA-010950 DRV8316C Circuit ImplementationFigure 2-8 DRV8316C Circuit Implementation

The DRV8316C integrates three, high-performance low-side current sense amplifiers for current measurements using built-in current sensing. Low-side current measurements are commonly used to implement overcurrent protection, external torque control, or brushless-DC commutation with an external controller. The three amplifiers can be used to sense the current in each of the half-bridge legs (when the low-side FET of the corresponding phase is conducting current). In the TIDA-010950 these current sense measurements are being read by the integrated ADC on the MSPM0.

The buck regulator in DRV8316C device is primarily designed to support low inductance of 47µH and 22µH inductors. In this reference design a 47µH inductor was selected for L1 which allows the buck regulator to operate up to 200mA load current support at 5V out. This reference design does not utilize this power source, but this can be leveraged to provide power to an MCU or other low voltage peripherals as needed.

DRV8428 Stepper Motor Driver

A simple STEP/DIR interface allows for an external controller to manage the direction and step rate of the stepper motor. The internal microstepping indexer can execute high-accuracy micro-stepping without requiring the external controller to manage the winding current level. The indexer is capable of full step, half step, and 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, and 1/256 microstepping. High microstepping contributes to significant audible noise reduction and smooth motion. In addition to a standard half stepping mode, a noncircular half stepping mode is available for increased torque output at higher motor RPM. Stepper motor drivers need to re-circulate the winding current by implementing several types of decay modes. The DRV8428 comes with smart tune decay modes. The smart tune is a decay mechanism that automatically adjusts for superb current regulation performance agnostic of voltage, motor speed, variation and aging effects. Smart tune Ripple Control uses a variable off-time, ripple current control scheme to minimize distortion of the motor winding current. Smart tune Dynamic Decay uses a fixed off-time, dynamic fast decay percentage scheme to minimize distortion of the motor winding current while minimizing frequency content and significantly reducing design efforts. Along with this seamless, effortless automatic smart tune, DRV8428 also provides the traditional mixed decay mode.

TIDA-010950 DRV8428 Circuit ImplementationFigure 2-9 DRV8428 Circuit Implementation

This reference design uses the Decay set to 0 and HI-Z, enabling the smart tune ripple control or Smart Tune Dynamic Decay. This can also be set based on preference using the configurations shown below in Decay Mode Settings.

Table 2-2 Decay Mode Settings
DECAY/TOFFDECAY MODEOFF TIME
0Smart tune Ripple Control-
14.7kΩ to GNDMixed 30% Decay7µs
44.2kΩ to GND16µs
100kΩ to GND32µs
249kΩ to GNDSmart tune Dynamic Decay7µs
Hi-Z16µs
DVDD32µs

The microstepping level is set by the M0 and M1 pins and can be any of the settings listed in Microstepping Settings. Higher microstepping results in a smoother motor motion and less audible noise, but requires a higher ƒstep to achieve the same motor speed. Through this reference design, the designer has the option of populating or depopulating R6, R7, R8, and R12 to set the desired step mode in Microstepping Settings. For the testing of this design M0 is set at 0 and M1 is connected through a 330kΩ resistor to ground.

Table 2-3 Microstepping Settings
M0M1STEP MODE
00Full step (2-phase excitation) with 100% current
0330kΩ to GNDFull step (2-phase excitation) with 71% current
10Non-circular 1/2 step
Hi-Z01/2 step
011/4 step
111/8 step
Hi-Z11/16 step
0Hi-Z1/32 step
Hi-Z330kΩ to GND1/64 step
Hi-ZHi-Z1/128 step
1Hi-Z1/256 step

DRV8428 External Components below shows the recommended discrete component values for the DRV8428 circuit, along with the connections for each pin.

Table 2-4 DRV8428 External Components
COMPONENTPIN 1PIN 2RECOMMENDED
CVM1VMPGNDOne X7R, 0.01µF, VM-rated ceramic capacitor
CVM2VMPGNDBulk, VM-rated capacitor
CDVDDDVDDGNDX7R, 0.47µF to 1µF, 6.3V ceramic capacitor
RREF1VREFVCCResistor to limit chopping current. The value of parallel combination of RREF1 and RREF2 must be less than 50kΩ.
RREF2 (Optional)VREFGND

Position Sensing

The TIDA-010950 leverages the TMAG5273 for position sensing of the damper/EEV. The TMAG5273 has an integrated angle calculation engine (CORDIC) that provides full 360° angular position information for both on-axis and off-axis angle measurement topologies. The angle calculation is performed using two user-selected magnetic axes. The device features magnetic gain and offset correction to mitigate the impact of system mechanical error sources.

This references design utilizes the angular output for the control loop feedback. More details are given in the software section of this guide.

TIDA-010950 TMAG5273 Circuit ImplementationFigure 2-10 TMAG5273 Circuit Implementation

ISO1212

The ISO1212 is an isolated 24V to 60V digital input receiver, compliant to IEC 61131-2 Type 1, 2, and 3 characteristics. This device enables 9V to 300VDC and AC digital input modules in programmable logic controllers (PLCs), motor-control, and other industrial applications. Unlike traditional optocoupler designs with discrete, imprecise current limiting circuitry, the ISO121x devices provide a simple, low-power design with an accurate current limit to enable the design of compact and high-density I/O modules. These devices also do not require field-side power supply and are configurable as sourcing or sinking inputs.

For this reference design, the ISO1212 is used as an interface for a 24VDC open/closed controller signal. When the input on the SENSE 1 pin is high, the damper motor is engaged until the 90⁰ (fully closed) damper position is reached. When SENSE 2 is high, the damper motor is also engaged according to the TMAG5273, moving the damper to the 0⁰ position (fully open).

TIDA-010950 ISO1212 Circuit ImplementationFigure 2-11 ISO1212 Circuit Implementation

The RSENSE resistor (R24, R25) limits the current drawn from the field input. In each case, a (slightly) lower value of RSENSE can be selected based on the need for a higher current limit or component availability. A 1% tolerance is recommended on RSENSE but 5% resistors can also be used if higher variation in the current limit value is acceptable. The relationship between the RSENSE resistor and the typical current limit (IL) is given by Equation 13:

Equation 13. IL=2.25mA × 562ΩRSENSE

The maximum voltage on the SENSE pins of the ISO121x device is 60V. However, because the RTHR resistor drops additional voltage, the maximum voltage supported at the module inputs is higher and given by Equation 14

Equation 14. VInmax=60V+RTHR × 2.1mA × 562ΩRSense

The RTHR resistor sets the voltage thresholds (VIL and VIH) as well as limits the surge current. A value of 1kΩ is recommended for RTHR in Type 3 systems (maximum threshold voltage required is 11V). A value of 2.5kΩ is recommended for RTHR in Type 1 systems (maximum threshold voltage required is 15V) and a value of 330Ω is recommended for RTHR in Type 2 systems. More information on calculating the discrete component values can be found in the ISO1212 data sheet.

TCAN334

Termination is typically a 120Ω resistor at each end of the bus. If filtering and stabilization of the common mode voltage of the bus is desired, then split termination can be used. Split termination uses two 60Ω resistors with a capacitor in the middle of these resistors to ground. Split termination improves the electromagnetic emissions behavior of the network by eliminating fluctuations in the bus common mode voltages at the start and end of message transmissions.

Care must be taken in the power ratings of the termination resistors used. Typically, the worst-case condition is if the system power supply was shorted across the termination resistance to ground. In most cases the current flow through the resistor in this condition is much higher than the transceiver's current limit.

The designer has the option of utilizing the onboard TCAN interface if desired, and there is an additional external crystal oscillator provided on the board which is required by this interface, shown below. The MSPM0 SDK can be leveraged for implementation examples for CAN.

TIDA-010950 External Crystal Oscillators for TCAN CommunicationFigure 2-12 External Crystal Oscillators for TCAN Communication

4-20mA and 0-10V Circuitry

For this reference design, the damper and EEV position is adjusted based on the input signal received from either the 0-10V control interface or the 4-20mA control interface. The input front-end converts the industries typical signal input range to the ADCs input voltage range as well as setting the input impedance and providing required overvoltage and overcurrent protection. For both the 0-10V as well as the 4-20mA control interfaces, a single TLV9002 op-amp is used as a buffer before the control signal is sent to the M0 ADC. The TLV9002

The TLV9002 is a low-voltage (1.8V to 5.5V) operational amplifier with rail-to-rail input and output swing capabilities. This op amps provide a cost-effective design for space-constrained applications or applications where low-voltage operation and high capacitive load drive are required.

TIDA-010950 0-10V and 4-20mA Control Interface Circuit ImplementationFigure 2-13 0-10V and 4-20mA Control Interface Circuit Implementation

For the 0-10V input, a simple voltage divider is used to scale the voltage range to match that of the MSP M0 ADC. Leveraging the known input range and the VREF of the M0 ADC (2.5V), along with Equation 15 below, the resistance values of R48 and R49 are calculated to be:

Equation 15. 2.5=10 ×R49R48+ R49

Choosing 49.9k for R49 yields a nearest 1% resistor value of 149.7k, but the gain factor of the input stages is chosen so that the 10V or 20mA input signals result in an input voltage to the ADC a bit lower than the full-scale of 2.5V to avoid saturation in consideration of offset, gain, and other errors, so a 158k resistance value is chosen for R48 . For the voltage input stage, a gain of 0.24V/V is used, that is, 2.4V corresponds to the 10V input. For the current input stage, a 20mA input current over the 120Ω shunt resistor results in 2.4V at the ADC input.

For the current input stage, a 20mA input current over the 120Ω shunt resistor results in 2.4V at the ADC input. The 4-20mA input front-end has an additional 24V PTC resistor (R52 = PRG18BB470MB1RB), which is used for protection. More information on the Input front-end can be found in Reducing Cost for PLC Analog Input Modules Using the MSP430 MCU.

Software

The software for TIDA-010950 relies on several of the MSPM0 peripherals including SPI, I2C, GPIO, and PWM. For both the damper BLDC motor control as well as the EEV stepper motor control use a very similar firmware loop, only differing in the motor control method respectively.

After initializing the communication channels, the ADC inputs are enabled which is primarily responsible for sensing the control voltage/current, as well as sensing the temperature from the LMT84 temperature sensor. The ADC VREF is set to be internally referenced at 2.5V.

Next, in the case of the DRV8316, the SPI communication is established with the device, after which the motor control IC is enabled for operation. The direction of rotation as well as the end position is based on the current position of the damper (sensed by the TMAG5273) in relation to the control signal coming from the 0-10V or 4-20mA input front-end. Once the firmware computes the necessary changes, if any, the direction and PWM values are set, engaging the motor.

TIDA-010950 BLDC Motor Control Software
                    Control Loop Diagram Figure 2-14 BLDC Motor Control Software Control Loop Diagram

Code Implementation Example:

while (1) {
    /* check 2 digital isolator pins for high */
    /* Read iso1 and iso2 states */
    iso1Status = HAL_readGPIOPin(iso1);
    iso2Status = HAL_readGPIOPin(iso2);

    if (iso1Status) {
        desiredDamperPosition = 90;
    }

    else if (iso2Status) {
        desiredDamperPosition = 0;
    }

    else {
        /* Read mV value of current control and control inputs */
        controlVoltage = (HAL_getmvFromADC(vControl) * 2500) / 2400; // scale to 0 - 2.4V input
        desiredDamperPosition = controlVoltage * 0.036;              // 0-2500mV = 0-90 degrees
    }
    do {
        /* Read in TMAG angle result and set to current damper
            position */
        tmagAngleResult();
        currentDamperPosition = tmagAngle;

        correctPosition = currentDamperPosition * 0.9 <= desiredDamperPosition &&
                          currentDamperPosition * 1.1 >= desiredDamperPosition;

        /* Set duty cycle to 0% when current position reaches the desired
        position */
        if (correctPosition) {
            firmVar.pulsewidth = 0x00;
            break;
        }

        /* Set motor direction */
        else if (currentDamperPosition < desiredDamperPosition) {
            firmVar.motorDirection = MOTOR_DIR_FORWARD;
        }

        else {
            firmVar.motorDirection = MOTOR_DIR_REVERSE;
        }

        /* Set PWM duty cycle */
        firmVar.pulseWidth = 0x64;

        /* Read mV value of current control and control inputs */
        controlVoltage = (HAL_getmvFromADC(vControl) * 2500) / 2400; // scale to 0 - 2.4V input
        desiredDamperPosition = controlVoltage * 0.036; // 0-2500mV = 0-90 degrees

       } while (!correctPosition);
    }

For the EEV stepper motor control, the user has the option to employ an additional component in the control loop, the temperature output from the LMT84 as shown below in Figure 2-15. This is used as an example implementation of a thermal feedback loop which can be used to modulate the EEV to allow more or less refrigerant to flow through the valve. for peripheral setup, the ADC is initialized in an identical manner to that of the DRV8316C firmware. There is no need for SPI communication for this firmware, this can be removed if the user so chooses.

The motor control interface is very simplistic, only requiring EN and nSLEEP pins controlled by the MCU. These pins enable and wake the device up when driven high and disable or put the device to sleep if driven low. For both examples below, a simple toggle of the STEP GPIO in the control loop is used to rotate the stepper motor. The user can adjust the pulse time in the firmware by increasing or decreasing the delay definition assigned value.

Once the device is set up and the peripherals are running, the temperature data is taken by the on-board LMT84. The user can also implement an offboard temp sensor if preferred through the boosterpack headers on the board. Based on the temperature reading, simulating the temperature at the suction line from the evaporator, the valve either rotates forward in the case of the suction line temperature being greater than the target temp, or vice-versa for suction line temperatures less than the target temp. In this example, the TMAG5273 is used only for rotation and position verification and does not play a part in the overall control loop.

TIDA-010950 Stepper Motor Control Software Control Loop Diagram (Temperature Based)Figure 2-15 Stepper Motor Control Software Control Loop Diagram (Temperature Based)
#define ADC12_BIT_RESOLUTION (12)
#define ADC12_REF_VOLTAGE (2.5)
uint16_t gVolt = 0;

uint16_t getVolts() {

    uint16_t Voltage = 0;
    DL_ADC12_startConversion(VControl_ADC_INST);

    gAdcResult = DL_ADC12_getMemResult(VControl_ADC_INST, DL_ADC12_MEM_IDX_0);
    Voltage = (gAdcResult * ADC12_REF_VOLTAGE) / (1 << ADC12_BIT_RESOLUTION) * 3;
    DL_ADC12_enableConversions(VControl_ADC_INST);

    return (Voltage);
}
    while (1) {
        // Set the DRV8428 control pins to known values before entering loop
        gVolt = getVolts();
    If (gVolt != Target_TMP) { // now that we have a condition where desired and 
                            // current position dont match, enable the device for
                            // the position change loop
        DL_GPIO_setPins (GPIO_LEDS_PORT,
                        (GPIO_LEDS_USER_LED_1_PIN); // Using this is a status pin
        DL_GPIO_setPins (GPIO_LEDS_PORT,
                         GPIO_LEDS_DRV8428_EN_PIN); // Logic high to enable outputs
        DL_GPIO_setPins (GPIO_LEDS_PORT,
                         GPIO_LEDS_DRV8428_SLP_PIN); // Logic high to enable device

    While (gVolt < Target_TMP) {
        DL_GPIO_setPins(
            GPIO_LEDS_PORT,
            GPIO_LEDS_DRV8428_DIR_PIN; // Set Direction pin for CW or CCW

        DL_GPIO_setPins(
            GPIO_LEDS_PORT,
            GPIO_LEDS_DRV8428_STEP_PIN; // Move motor ahead by one step

        DL_GPIO_SetPins(GPIO_LEDS_PORT,
                        GPIO_LEDS_USER_LED_1_PIN); // Using this as status pin
        
        delay_cycles(DELAY_MOTOR);

        DL_GPIO_clearPins(
            GPIO_LEDS_PORT,
            GPIO_LEDS_DRV8428_STEP_PIN); // Set Direction pin for CW or CCW

        DL_GPIO_ClearPins(GPIO_LEDS_PORT,
                          GPIO_LEDS_USER_LED_1_PIN); // Using this as status pin

        delay_cycles(DELAY_MOTOR);
    }

In the case where the modulation is not controlled by the temperature feedback loop as shown below in Figure 2-16, the 0-10V and 4-10mA control interfaces can be used to control the stepper direction and target end position. This example is almost identical to the previous example, but in this instance, the TMAG5273 is used in combination with the control front-end to provide current angular position relative to desired position and rotate the stepper motor accordingly.

TIDA-010950 Stepper Motor Control Software
                    Control Loop Diagram (Control Input Based) Figure 2-16 Stepper Motor Control Software Control Loop Diagram (Control Input Based)

In this specific example, a combination of the first 2 examples can be used to implement this in firmware, instead leveraging the GPIO control pins for the DRV8428 to control direction and rotation.