Input port MC9S12XHZ512

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Input port MC9S12XHZ512

405件の閲覧回数
kdn
Contributor III

I have connected two switch at PP3 and PP2 port of MC9S12XHZ512 microcontroller , I want to read both independently, Can any one provide me code for that using processor expert .

ラベル(1)
タグ(3)
0 件の賞賛
1 返信

294件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

Go to Component Library window.

Select Port I/O

Select InputPin

The Component Inspector InpB1:Input pin will appear.

in the roll down menu for Component Inspector select pin you want to use as input: for example PP3_PWM3

In the ProcessorExpert Tab of the project window you will find InpB1.c and InpB1.h (in the generated modules->component modules) which says:

  c file says:        This method is implemented as a macro. See InpB1.h file.

making the file we can see InpB1.h in the InpB1.c file (icon on left top) which presents:

#define InpB1_GetVal() ( \

(bool)((getReg8(PTIP) & 0x08U)) /* Evaluate to port raw data */ \

  )

So when I want to use it and get the value of the pin I will write into a code:

x = InpB1_GetVal(); // get PP3 pin

pastedImage_3.png

Best Regards, Ladislav

0 件の賞賛