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/LAUNCHXL-F28379D: Level Shifting for PWM and GPIO

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: TXB0106, LAUNCHXL-F28069M, , LAUNCHXL-F280049C

Tool/software: Code Composer Studio

Hello!

I am currently working with a Teknic ClearPath motor that has an integrated servo drive, which applies torque proportional to a PWM duty cycle as supplied using a microcontroller (the F28379D in this case). The motor drive requires the PWM signal and other inputs to be 5V, whereas the F28379D GPIO pins provide 3.3V. The motor drive also requires a "motor enable" signal and the "motor direction" signal, which are digital high or low. I am currently using the SparkFun bidirectional level shifter to convert the 3.3V signal from ePWM1A and GPIO 2 and 3 of the microcontroller to 5V which is then fed into the motor drive. In the F28379D datasheet, I see that the LaunchPad has an in-built level shifter, which connects GPIO 20, 21, 99, 54, 55, 57 to EQEP pins. I would like to know if I can use these pins to provide the signals to the motor instead of using an external logic level shifter. If it is possible to use the in-built level shifter, I would like to know which specific pins to configure, and how exactly to configure them. Thank you.

Regards,

Samvrit

  • Samvrit,

    As a rule, no C28x device can drive a 5 V signal. That being said, the level shifter on the LaunchPad was placed there for easy connection to a 5 V linear or rotary encoder coming through eQEP. If you don't need to use the signals for an encoder, you are obviously free to use the GPIOs as you require. You have 6 GPIOs (as you mentioned) and all associated peripheral functions as determined by each GPIO's muxing options. Please refer to the datasheet (www.ti.com/.../tms320f28379d.pdf) to determine if the signals you require are there - GPIO20/GPIO21 have EPWM11A/B. no other GPIO on those headers have a PWM. You have 4 other GPIOs that can be connected to 5 V through the Level Shifter.

    Regards,
    -Mark
  • Thanks Mark,

    I tried it, and it seems to work partially. The high signal on GPIO 21 (corresponds to EQEP1B) gives correctly 5V, but the low signal gives 4V, and not 0V. Please let me know if I am doing something wrong. Following is my code:

       EALLOW;
       GpioCtrlRegs.GPAPUD.bit.GPIO20 = 1;
       GpioCtrlRegs.GPAPUD.bit.GPIO21 = 1;
    
       GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 5; //PWM11A
       GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 0; //GPIO
    
       GpioCtrlRegs.GPADIR.bit.GPIO20 = GPIO_OUTPUT;
       GpioCtrlRegs.GPADIR.bit.GPIO21 = GPIO_OUTPUT;
       EDIS;
    
       GPIO_WritePin(21,0);
    
    

    Thank you.

  • Samvrit,

    I will have to take a look at this tomorrow.

    Thanks,
    Mark
  • Hi Mark,

    Any updates?

    Thanks,
    Samvrit
  • Samvrit,

    I have finally been able to get around to looking into this further.

    I have located the culprit to be our circuit design for the TXB0106. This is a bi-directional level-shifter intended for push/pull signals. The TXB0106 is on the board for an external encoder to be connected while using our motor control kits. Typically, incremental encoders utilize an open-drain where a pullup is required.

    The TXB0106 has 1k pullup on the B side (5 V region). The TXB0106 does not have sufficient drive strength to overcome this pullup when used as you require. the TXB0106 datasheet recommends greater than 50k ohm pullups if they are needed. Since our intended usage is actually single directional, B side to A side direction, the Pullup was placed to help tune the rise time of the encoder signals.

    You can remove the pullup resistors on the 5 V side of this device with no ill-effects. It will allow you to drive a 3.3 V to 5 V push-pull I/O.

    I have tested this and confirmed the behavior.

    For those coming through later, this is applicable to :
    LAUNCHXL-F28069M
    LAUNCHXL-F28377S
    LAUNCHXL-F28379D
    LAUNCHXL-F280049C

    Regards,
    Mark
  • Hi Mark,

    Thanks for taking the time to look into this. I shall test this solution soon. Just to confirm, do the resistors that you talk about correspond to R13, R29, R48 on QEP_A and R49, R50, R52 on QEP_B for this specific board?

  • Correct for LAUNCHXL-F28379D only. They will be different for the other LaunchPads. Refer to the Schematics for the correct resistors.

    -Mark