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

11 views (last 30 days)
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

Accepted Answer

Venkatesh Chilapur
Venkatesh Chilapur on 14 May 2018
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

More Answers (1)

Venkatesh Chilapur
Venkatesh Chilapur on 18 May 2018
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!