In the first example above, there is a function Ext_Osc that changes the pin function. Later, due to the support of MDK, the oscillation was changed to the external mode in the visual system_LPC82x.c file and it was canceled. In fact, in the LPC824, changing pin functions is a common function. Not only that, you can even reassign certain functions to any non-power pin. Let’s discuss these functions in detail below.
Before discussing, several related concepts must be clarified. First, the pins of LPC824 (see the previous pin function diagram) are described in the form of GPIO0_x, that is, GPIO0_x is fixed. Take the GPIO0_13 port as an example. It is located on pin No. 1 of the chip in the HVQFN33 package. This is fixed, that is, the GPIO_13 port cannot be assigned to other chip pins, so it is generally named GPIO_13. Describe the pin where it is located, rather than pin No. 1 of the chip. The advantage of this is that even if the chip package is changed (that is, the physical pins of the chip change), the relative GPIO_13 pin name remains unchanged, that is, the description of the pin name has nothing to do with the chip package. Second, by default, pin No. 1 of the LPC824 chip not only has the GPIO_13 function, but also has the ADC_10 function, which is the input terminal of the 10th A/D conversion. In this way, two functions are integrated on the GPIO_13 pin, but by default it is the general-purpose input/output function of GPIO_13. Once again, the strict description here should be that the GPIO_13 pin of the LPC824 also has the ADC_10 function, rather than describing that there are two functions of GPIO_13 and ADC_10 on the No. 1 pin of the LPC824 chip, that is, not Describe to a specific physical pin (although both descriptions are the same thing). At the same time, ADC_10 is also a fixed function on the GPIO_13 pin, that is, it cannot be assigned to other pins. Therefore, to determine the specific functions of this type of "fixed function" pin, you need to operate a register to select. This register is the pin enable register PINENABLE0. In the previous function Ext_Osc, the GPIO0_8 and GPIO0_9 pins are configured as XTALIN and XTALOUT pins by operating this register. Third, there are some functions in LPC824 that are not assigned to specific pins, or even if they are assigned, they may need to be readjusted to other pins. For example, the clock output pin CLKOUT in the previous clock output example does not have a physical pin assigned to it by default, so the clock signal cannot be output. In the example, CLKOUT is assigned to the pin GPIO0_24, so it can Observe the clock waveform by measuring the GPIO0_24 pin with an oscilloscope. Functions like CLKOUT that can be assigned to all pins except power supply are called "movable functions", and the operating register is the pin assignment register PINASSIGN0. To sum up, the pin functions of "fixed function" can only be switched and cannot be moved, while the pins of "movable function" can be assigned arbitrarily (except power pins).
In LPC824, the module that implements the above pin functions is called the switch matrix (SWITCH MATRIX), which is an important part of the chip. In addition to the power supply, the 29 GPIO pins are all assigned functions by the switch matrix SWM, as shown in the figure below .
As can be seen from the above figure, basically all functions (such as USART, SPI, I2C, ADC...) are connected to the 29 external pins through the switch matrix. The specific allocation is determined by the two pins in the switch matrix. The registers PINENABLE0 and PINASSIGN0 are jointly determined. Let’s discuss the usage of these two registers in detail. Let’s first look at the pin enable register PINENABLE0. The following table shows its entire bit structure, and its byte address is 0x4000C1C0.
(1) Bit 0 is the function enable control bit on the PIO0_0 pin. When the value is 0, the ACMP_I1 function on the pin is enabled. When the value is 1, the ACMP_I1 function is disabled (that is, it returns to the PIO0_0 function). The default is the PIO0_0 function. .
(2) Bit 1 is the function enable control bit on the PIO0_1 pin. When the value is 0, the ACMP_I2 function on the pin is enabled. When the value is 1, the ACMP_I2 function is disabled (that is, it returns to the PIO0_1 function). The default is the PIO0_1 function. .
(3) Bit 2 is the function enable control bit on the PIO0_14 pin. When the value is 0, the ACMP_I3 function on the pin is enabled. When the value is 1, the ACMP_I3 function is disabled (that is, it returns to the PIO0_14 function). The default is the PIO0_14 function. .
(4) Bit 3 is the function enable control bit on the PIO0_23 pin. When the value is 0, the ACMP_I4 function on the pin is enabled. When the value is 1, the ACMP_I4 function is disabled (that is, it returns to the PIO0_23 function). The default is the PIO0_23 function. .
(5) Bit 4 is the function enable control bit on the PIO0_3 pin. When the value is 0, the SWCLK function on the pin is enabled. When the value is 1, the SWCLK function is disabled (that is, it returns to the PIO0_3 function). The default is the SWCLK function. .
(6) Bit 5 is the function enable control bit on the PIO0_2 pin. When the value is 0, the SWDIO function on the pin is enabled. When the value is 1, the SWDIO function is disabled (that is, it returns to the PIO0_2 function). The default is the SWDIO function. .
(7) Bit 6 is the function enable control bit on the PIO0_8 pin. When the value is 0, the XTALIN function on the pin is enabled. When the value is 1, the XTALIN function is disabled (that is, it returns to the PIO0_8 function). The default is the PIO0_8 function. .
(8) Bit 7 is the function enable control bit on the PIO0_9 pin. When the value is 0, the XTALOUT function on the pin is enabled. When the value is 1, the XTALOUT function is disabled (that is, it returns to the PIO0_9 function). The default is the PIO0_9 function. .
(9) Bit 8 is the function enable control bit on the PIO0_5 pin. When the value is 0, the RESETN function on the pin is enabled. When the value is 1, the RESETN function is disabled (that is, it returns to the PIO0_5 function). The default is the RESETN function. .
(10) Bit 9 is the function enable control bit on the PIO0_1 pin. When the value is 0, the CLKIN function on the pin is enabled. When the value is 1, the CLKIN function is disabled (that is, it returns to the PIO0_1 function). The default is the PIO0_1 function. .
(11) Bit 10 is the function enable control bit on the PIO0_6 pin. When the value is 0, the VDDCMP function on the pin is enabled. When the value is 1, the VDDCMP function is disabled (that is, it returns to the PIO0_6 function). The default is the PIO0_6 function. .
(12) Bit 11 is the function enable control bit on the PIO0_11 pin. When the value is 0, the I2C0_SDA function on the pin is enabled. When the value is 1, the I2C0_SDA function is disabled (that is, it returns to the PIO0_11 function). The default is the PIO0_11 function. .
(13) Bit 12 is the function enable control bit on the PIO0_10 pin. When the value is 0, the I2C0_SCL function on the pin is enabled. When the value is 1, the I2C0_SCL function is disabled (that is, it returns to the PIO0_10 function). The default is the PIO0_10 function. .
(14) Bit 13 is the function enable control bit on the PIO0_7 pin. When the value is 0, the ADC_0 function on the pin is enabled. When the value is 1, the ADC_0 function is disabled (that is, it returns to the PIO0_7 function). The default is the PIO0_7 function. .
(15) Bit 14 is the function enable control bit on the PIO0_6 pin. When the value is 0, the ADC_1 function on the pin is enabled. When the value is 1, the ADC_1 function is disabled (that is, it returns to the PIO0_6 function). The default is the PIO0_6 function. .
(16) Bit 15 is the function enable control bit on the PIO0_14 pin. When the value is 0, the ADC_2 function on the pin is enabled. When the value is 1, the ADC_2 function is disabled (that is, it returns to the PIO0_14 function). The default is the PIO0_14 function. .
(17) Bit 16 is the function enable control bit on the PIO0_23 pin. When the value is 0, the ADC_3 function on the pin is enabled. When the value is 1, the ADC_3 function is disabled (that is, it returns to the PIO0_23 function). The default is the PIO0_23 function. .
(18) Bit 17 is the function enable control bit on the PIO0_22 pin. When the value is 0, the ADC_4 function on the pin is enabled. When the value is 1, the ADC_4 function is disabled (that is, it returns to the PIO0_22 function). The default is the PIO0_22 function. .
(19) Bit 18 is the function enable control bit on the PIO0_21 pin. When the value is 0, the ADC_5 function on the pin is enabled. When the value is 1, the ADC_5 function is disabled (that is, it returns to the PIO0_21 function). The default is the PIO0_21 function. .
(20) Bit 19 is the function enable control bit on the PIO0_20 pin. When the value is 0, the ADC_6 function on the pin is enabled. When the value is 1, the ADC_6 function is disabled (that is, it returns to the PIO0_20 function). The default is the PIO0_20 function. .
(21) Bit 20 is the function enable control bit on the PIO0_19 pin. When the value is 0, the ADC_7 function on the pin is enabled. When the value is 1, the ADC_7 function is disabled (that is, it returns to the PIO0_19 function). The default is the PIO0_19 function. .
(22) Bit 21 is the function enable control bit on the PIO0_18 pin. When the value is 0, the ADC_8 function on the pin is enabled. When the value is 1, the ADC_8 function is disabled (that is, it returns to the PIO0_18 function). The default is the PIO0_18 function. .
(23) Bit 22 is the function enable control bit on the PIO0_17 pin. When the value is 0, the ADC_9 function on the pin is enabled. When the value is 1, the ADC_9 function is disabled (that is, it returns to the PIO0_17 function). The default is the PIO0_17 function. .
(24) Bit 23 is the function enable control bit on the PIO0_13 pin. When the value is 0, the ADC_10 function on the pin is enabled. When the value is 1, the ADC_10 function is disabled (that is, it returns to the PIO0_13 function). The default is the PIO0_13 function. .
(25) Bit 24 is the function enable control bit on the PIO0_4 pin. When the value is 0, the ADC_11 function on the pin is enabled. When the value is 1, the ADC_11 function is disabled (that is, it returns to the PIO0_4 function). The default is the PIO0_4 function. .
(26) Bits 25 to 31 are reserved bits.
Previous article:LPC824-pin configuration IOCON
Next article:LPC824-GPIO port application
- Popular Resources
- Popular amplifiers
- Signal Integrity and Power Integrity Analysis (Eric Bogatin)
- 4G Mobile Broadband Revolution - A Comprehensive Analysis of EPC and 4G Packet Networks (Original Book 2nd Edition)
- Simulink simulation and code generation technology entry to master
- Design and simulation of a new type of DC power supply based on dual-bridge matrix converter
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Core Route FPGA Learning Kit [ADV7123/GM7123 VGA Video Output Module] Schematic Diagram
- Thanksgiving is here. Who do you want to thank the most today?
- Live broadcast has ended | Littelfuse [How to improve the safety and reliability of electronic equipment in smart buildings]
- Circuit board manufacturing experience
- Practical Tips | What to do if 5G RF challenges put you in a dilemma?
- Solar Photovoltaic Application 3
- Filter learning materials
- Today afternoon 1:00-5:30 award-winning live broadcast | Keysight World 2019 "Automotive Electronics and New Energy Vehicle Testing" Forum
- The influence of filter on the voltage waveform at the terminals of PWM variable frequency speed regulating motor
- Main and auxiliary power switching circuit