How do I disable a pull-up resistor for MPC555 and its variants using Embedded Target for Motorola MPC555?

1 次查看(过去 30 天)
I would like to know how I can change the PRDS bit value in the PDMCR for MPC555 (or one of its variants, such as MPC565) in order to disable a pull-up resistor in my Embedded Target model.

采纳的回答

MathWorks Support Team
The pull-up resistor can be disabled by setting the PRDS bit in the PDMCR (Pad Module Configuration Register):
PRDS:
0 = Enable pull-up/pull-down devices
1 = Disable pull-up/pull-down devices
On power up, the PRDS bit is set to 0 and the pull-up resistor is active.
Note that PRDS is used to enable or disable devices in the pads related to SGPIO and all IMB module pads; that is, setting this bit will have an effect on functions other than the QADC inputs.
For additional information, refer to the attached example of how to set PRDS. You can see the following changes implemented in this model by double-clicking on the Target_LED block followed by double-clicking on each of the Header File and Model Initialization Function blocks.
Header File Custom Code: Adds
#include "m_usiu.h"
to the Target_LED.h generated header file.
Model Initialize Function Custom Code: Adds
/* disable the internal pull-up resistor */
USIU.PDMCR.B.PRDS = 1;
to the Target_LED.c generated source file.
These changes should set the PRDS bit and disable the pull-up resistor.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by