Input port MC9S12XHZ512

cancel
Showing results for 
Search instead for 
Did you mean: 

Input port MC9S12XHZ512

230 Views
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 .

Labels (1)
Tags (3)
0 Kudos
1 Reply

119 Views
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 Kudos