Reading port pins in FX2LP
Anonymous
Not applicable
Jul 05, 2010
07:01 AM
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Jul 05, 2010
07:01 AM
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
Rate this article:
Contributors
-
This widget could not be displayed.Anonymous