TI piccolo手册中“对于可以用作ePWM的输出的引脚,默认内部上拉电阻禁止使能“,请问如果ePWM上拉电阻使能的话会有什么后果?谢谢!
- void InitEPwm1Gpio(void)
- {
- EALLOW;
- /* Disable internal pull-up for the selected output pins
- for reduced power consumption */
- // Pull-ups can be enabled or disabled by the user.
- // Comment out other unwanted lines.
- GpioCtrlRegs.GPAPUD.bit.GPIO0 = 1; // Disable pull-up on GPIO0 (EPWM1A)
- GpioCtrlRegs.GPAPUD.bit.GPIO1 = 1; // Disable pull-up on GPIO1 (EPWM1B)
- /* Configure EPWM-1 pins using GPIO regs*/
- // This specifies which of the possible GPIO pins will be EPWM1 functional pins.
- // Comment out other unwanted lines.
- GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A
- GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B
- EDIS;
- }
- 改为
- void InitEPwm1Gpio(void)
- {
- EALLOW;
- /* Disable internal pull-up for the selected output pins
- for reduced power consumption */
- // Pull-ups can be enabled or disabled by the user.
- // Comment out other unwanted lines.
- GpioCtrlRegs.GPAPUD.bit.GPIO0 = 0 // Enable pull-up on GPIO0 (EPWM1A)
- GpioCtrlRegs.GPAPUD.bit.GPIO1 = 0 // Enalbe pull-up on GPIO1 (EPWM1B)
- /* Configure EPWM-1 pins using GPIO regs*/
- // This specifies which of the possible GPIO pins will be EPWM1 functional pins.
- // Comment out other unwanted lines.
- GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A
- GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B
- EDIS;
- }
复制代码
此帖出自
小平头技术问答
人家不使能就算了,你为什么偏偏要让它使能呢?
PWM脚输出有拉能力,也有灌能力,上拉与下拉都是端口的负担。
再者,设置为PWM功能时,整个硬件部分都由IO功能块切换到了PWM功能块那里了,IO功能就失效了
一周热门 更多>