I'm new to microcontroller programming. How can i configure one pin for input and another for output. If I am not wrong this could be done with GPIO registers that control device pins that are not connected to peripheral functions.
|
If you don't find the complete information in the datasheet you'll have to look at the LPC17xx family user manual. We're interested in Chapter 9: "LPC17xx General Purpose Input/Output (GPIO)". There you can read that FIODIR is the
The direction for each I/O port/pin is controlled by FIO0DIR through FIO4DIR. Page 122 gives you the corresponding addresses. If you don't know how to start looking in these rather long documents, use the "find" function in Acrobat Reader (CTRL-F) and look for "Direction". |
|||||||
|
|
Looking at the User Manual, it seems you would use the FIODIR register mentioned on pages 122-123. |
|||
|
|