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
MathWorks Support Team 2009년 6월 27일
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