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

조회 수: 8 (최근 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
  댓글 수: 2
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