[求助] 请问如果ePWM上拉电阻使能的话会有什么后果?

dxj   2016-8-26 16:14 楼主
TI piccolo手册中“对于可以用作ePWM的输出的引脚,默认内部上拉电阻禁止使能“,请问如果ePWM上拉电阻使能的话会有什么后果?谢谢!
  1. void InitEPwm1Gpio(void)
  2. {
  3.    EALLOW;

  4. /* Disable internal pull-up for the selected output pins
  5.    for reduced power consumption */
  6. // Pull-ups can be enabled or disabled by the user.
  7. // Comment out other unwanted lines.

  8.     GpioCtrlRegs.GPAPUD.bit.GPIO0 = 1;    // Disable pull-up on GPIO0 (EPWM1A)
  9.     GpioCtrlRegs.GPAPUD.bit.GPIO1 = 1;    // Disable pull-up on GPIO1 (EPWM1B)

  10. /* Configure EPWM-1 pins using GPIO regs*/
  11. // This specifies which of the possible GPIO pins will be EPWM1 functional pins.
  12. // Comment out other unwanted lines.

  13.     GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1;   // Configure GPIO0 as EPWM1A
  14.     GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1;   // Configure GPIO1 as EPWM1B

  15.     EDIS;
  16. }

  17. 改为

  18. void InitEPwm1Gpio(void)
  19. {
  20.    EALLOW;

  21. /* Disable internal pull-up for the selected output pins
  22.    for reduced power consumption */
  23. // Pull-ups can be enabled or disabled by the user.
  24. // Comment out other unwanted lines.

  25.     GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0   // Enable pull-up on GPIO0 (EPWM1A)
  26.     GpioCtrlRegs.GPAPUD.bit.GPIO1 = 0    // Enalbe pull-up on GPIO1 (EPWM1B)

  27. /* Configure EPWM-1 pins using GPIO regs*/
  28. // This specifies which of the possible GPIO pins will be EPWM1 functional pins.
  29. // Comment out other unwanted lines.

  30.     GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1;   // Configure GPIO0 as EPWM1A
  31.     GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1;   // Configure GPIO1 as EPWM1B

  32.     EDIS;
  33. }


回复评论 (2)

人家不使能就算了,你为什么偏偏要让它使能呢? PWM脚输出有拉能力,也有灌能力,上拉与下拉都是端口的负担。 再者,设置为PWM功能时,整个硬件部分都由IO功能块切换到了PWM功能块那里了,IO功能就失效了 本帖最后由 dontium 于 2016-8-26 17:18 编辑
点赞  2016-8-26 17:17
楼主看看GPIO MUX的功能。
点赞  2016-8-26 17:21
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复