LPC_IOCON->R_PIO1_0 &= ~0x07;
LPC_IOCON->R_PIO1_0 |= 0x02;
The above statement sets P1.0 to AD1. The lower three bits of P1.0 are the pin function selection bits, so you can configure the pin function by configuring the lower three bits. For specific functions, see the IOCON register definition section of the lpc1114 user manual.
Many students don’t understand why the first statement should be added. The answer is as follows:
The first statement is used to clear the lower three bits, that is, to set the lower three bits to 0; the second statement is to set bit1 to 1, setting it to AD1 function. If there is no first statement, if bit0 is 1 before, after executing the second statement, the final result is that both bit0 and bit1 are 1, which is not the AD1 function you want to configure.
Previous article:lpc1114 MCU infrared remote control program
Next article:lpc1114 driver 1602_0802 program
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What problems have you encountered recently when using the forum? Feel free to comment!
- Intelligent LED lighting solution based on sensor and MCU
- What is the difference between embedded system development and directly developing projects in MCU using assembly? Does the former have to be developed on OS?
- Gods, what's going on?
- What are the uses and characteristics of common pulse circuits?
- MSP430F5438a uses BSL downloader to download program
- [RISC-V MCU CH32V103 Review] PWM Adjustment of LED Lights
- 【mpy】The SD/MMC bus can be configured to 1 or 4 bits
- Introducing several circuit simulation software that can run on mobile phones
- The microcontroller uses a dip switch to set the address