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.

TMS320F2800137: Setting GPIO pin as output pulls down nSLEEP pin and shuts down LDO on DRV8317

Part Number: TMS320F2800137
Other Parts Discussed in Thread: DRV8317,

Tool/software:

Hi,

I am developing a BLDC ESC with DRV8317 driver IC and TMS320F2800137 microcontroller. Later is supplied by LDO from DRV8317. I am using the same nSLEEP circuit as it is used in EVM board, where 3.3V Zener diode is used with 10kOhm pull-up to VDC. I do not need to use sleep mode on DRV8317, but short pulse is needed to reset the faults (as described in datasheet). The problem is when the nSLEEP GPIO fom F2800137 is configured as output, the CPU looses debug connection. I believe the GPIO configuring is somehow responsible to put the DRV8317 chip into sleep mode and as a result LDO is shutdown. I can see the 3.3V voltage begining to drop down and then BOR is resetting the CPU. After that CPU is returning and again in the init routine, where GPIO is set again, everything repeats. If I am disabling the nSLEEP GPIO setup, everything works. I am working with Universal Motor Control example and the code for GPIO setup is:

// GPIO29->M1_nSLEEP, 1-Active, 0-Low Power Sleep Mode

GPIO_setPinConfig(GPIO_29_GPIO29);

GPIO_writePin(29, 1);

GPIO_setDirectionMode(29, GPIO_DIR_MODE_OUT);

GPIO_setPadConfig(29, GPIO_PIN_TYPE_OD);

When I step over GPIO_setDirectionMode, debugger shuts down. I have tried also to set this pin as open-drain (as it should be anyway) and is the same.

When I measure the voltage on nSLEEP pin, it is showing me approx. 2.5V, although I have a 3.3V Zener diode.

I am puzzled here and I need a solution, because otherwise I would not been able to reset fault conditions.

Thank you.

  • Hi,

    The problem is when the nSLEEP GPIO fom F2800137 is configured as output, the CPU looses debug connection.

    Which CPU loses debug connection? Are you talking about f280013x CPU? GPIO config has no connection to CPU state,

    can you check the MCU separately (standalone) without connecting DRV, Zener or pull up. and toggle gpio

    Thanks

  • Hi,

    Maybe I was not clear in my description. I am debugging F2800137 CPU, which is supplied by LDO from DRV8317 IC. This driver IC has nSLEEP pin which needs to be at level 1 in order for LDO to work. If the DRV8317 goes into sleep mode (through pulling nSLEEP pin low) it shuts down LDO and F2800137 CPU looses 3.3V power supply. This of course leads to loosing the debug connection over cJTAG. Because I use Zener diode and 10kOhm pullup on nSLEEP pin, this is enough to start everything up. LDO starts automatically  and F2800137 gets power supply and the booting procedure starts. Later in GPIO init routine I am setting GPIO29 (which is also connected to nSLEEP pin) to output and OD type. When the routine for changing direction is called, it is somehow pulling pin down and this leads to LDO shutdown. Then BOR reset on F2800137. Reset puts GPIO29 pin back into default input mode and LDO starts again. Everything is repeating endlessly. My question was, what is causing GPIO pin to pull down? I am setting it to 1 before changing the direction.

    Regards,

    Jernej

  • I have already post this to DRV8317 forum and they redirect me to C2000 forum. Maybe setting pin which has some voltage on it to output mode triggers pulling down the pin somehow?

  • Why I am trying to control nSLEEP pin from F2800137 is because short pulse (less then 50us) on this pin resets fault condition state inside DRV8317 and does not put IC to sleep mode.

  • GPIO_setPinConfig(GPIO_29_GPIO29);

    GPIO_writePin(29, 1);

    GPIO_setDirectionMode(29, GPIO_DIR_MODE_OUT);

    GPIO_setPadConfig(29, GPIO_PIN_TYPE_OD);

    In the Open Drain output mode, if the buffer is configured for output mode, a 0 value to be driven out comes out on the on the PAD while a 1 value to be driven out tri-states the buffer

    Why are you wanting to tristate the pin with setting it to open drain type?

    Can you not just set the pin in Push-pull output configuration and drive pin as you would like?

    Thanks

  • Hi,

    I have tried to set the pin in push-pull mode also and the same thing happened. Whenever I call GPIO_setDirectionMode, it pulls pin down. Regarding the OD mode, I need that because I just need to short the Zener diode for a short time in order to pull nSLEEP down. I was also reading the errata for 280049, where there is similar errata entry, regarding the OD mode. Maybe something similar is happening here.

    Thanks