LPC824-switch matrix SWM

Publisher:古通闲人Latest update time:2023-05-25 Source: elecfansKeywords:LPC824 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

[1] [2]
Keywords:LPC824 Reference address:LPC824-switch matrix SWM

Previous article:LPC824-pin configuration IOCON
Next article:LPC824-GPIO port application

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号