フィルターのクリア

How to enable the MCU's internal pullup/pulldown resistors at Embedded Coder Support Package for Texas Instruments C2000 Processors?

12 ビュー (過去 30 日間)
Dear friends,
I am working in a prototype with the F28379D development board, with the Embedded Coder Support Package for Texas Instruments C2000 Processors tool, and enjoying it very much. But, I have a question. How can I enable the internal pullup/pulldown resistors at the MCU's GPIOs that are defined as Digital Inputs?
Thanks,
Gabriel

採用された回答

Venkatesh Chilapur
Venkatesh Chilapur 2018 年 5 月 14 日
HI,
If you can try the following:
Please use the "System Initialize" block found under "Simulink coder->Custom Code" library blocks and add the following lines that will execute during the system Initialization.
Under "System Initialize Function Execution Code" section:
EALLOW; GpioCtrlRegs.GPAPUD.bit.GPIO16 = 0; /* To Enable the Pull - Up for GPIO16
EDIS;
The below extract is from controller manual:
(Optional) Enable internal pullup resistors "To enable or disable the pullup resistors, write to the appropriate bits in the GPIO pullup disable registers (GPyPUD). All pullups are disabled by default. pullups can be used to keep input pins in a known state when there is no external signal driving them"
Regards,
Venkatesh C
  1 件のコメント
Gabriel Pauka
Gabriel Pauka 2018 年 5 月 17 日
Thank you very much, Venkatesh!
By the way, to enable the pulldown resistor would it be the following?
EALLOW; GpioCtrlRegs.GPAPUD.bit.GPIO16 = 1; EDIS;

サインインしてコメントする。

その他の回答 (1 件)

Venkatesh Chilapur
Venkatesh Chilapur 2018 年 5 月 18 日
Hi Gabriel,
There is no Pulldown circuit. You need to add an external one if required. If pullup is disabled, the pin would be floating. Please refer the following post from TI forum.
https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/569358/2087265#2087265
Regards,
Venkatesh C

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by