Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Reading port pins in FX2LP

Reading port pins in FX2LP

Anonymous
Not applicable
Question: How to read ports pins in FX2LP?

 

Answer:

Consider that PORT C has to be configured as input port and its data has to be read. The below code configure PORT C as input port and reads the PORTC pins.

 
BYTE pinData;
PORTCCFG = 0x00;            // PORTC is is configured as an I/O 
OEC = 0x00;                    // PORTC is an input
pinData = IOC;                 // Reading the Port C pins
0 Likes
330 Views
Contributors