Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
Rev. 0.1 2/12 Copyright © 2012 by Silicon Laboratories AN671
AN671
PRECISION32™ PORT I /O CROSSBAR DECODER
1. Introduction
Precision32™ devices use one or more Port I/O Crossbar Decoders to assign internal digital signals to Port I/Opins. A crossbar decoder provides the system designer with flexibility to customize the pinout according to theneeds of the application. The Port I/O Crossbar Decoder is particularly useful in low pin count devices where thenumber of internal digital signals outnumber the available I/O pins.
The crossbars are fully supported by the Silicon Labs Precision32 SDK, including Hardware Access Layer (HAL)routines and code examples showing how to configure a crossbar for a particular peripheral. Additionally, thePrecision32 AppBuilder application provides a graphical interface to easily configure pins in a crossbar.
Figure 1 shows an example of how internal signals are routed to the Port Banks of SiM3U1xx devices through theuse of two crossbar decoders. Port Bank 0 (PB0) and Port Bank 1 (PB1) are connected to crossbar 0, andPort Bank 2 (PB2) and Port Bank 3 (PB3) are connected to crossbar 1.
Figure 1. Crossbar Example on a SiM3U167 Device
2. Relevant Documentation
Precision32 Application Notes are listed on the following website: www.silabs.com/32bit-mcu.
AN664: Precision32™ CMSIS and HAL User’s Guide
AN670: Getting Started with the Silicon Labs Precision32™ AppBuilder
SiM3U16780-Pin TQFP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PB4.4
PB4.5
VSSHD
PB4.3
PB4.2
VIOHD
PB4.0
PB4.1
PB3.0
60
59
58
57
56
55
54
53
52
51
50
49
48
47
46
45
44
43
42
41
PB
0.1
1
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
VS
S
VIO
PB
1.1
3
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
VB
US
VS
S
VD
D
VIO
D+
D-
RE
SE
T
PB
0.0
PB
0.1
PB
0.2
PB
0.3
PB
0.4
PB
0.5
PB
0.6
PB
0.7
PB
0.8
PB
0.9
PB
0.1
0PB0.13
PB0.14
PB0.15
PB1.0
PB1.1
PB1.2/TRST
PB1.3/TDO/SWV
PB1.4/TDI
PB1.5/ETM0
PB1.6/ETM1
VIO
PB1.8/ETM3
PB1.9/TRACECLK
PB1.10
PB1.11
PB1.12
PB
1.1
4
PB
2.3
PB
2.4
PB
2.5
PB
2.6
PB
2.7
PB
2.8
PB
2.9
PB
2.1
0
PB
2.1
1
PB
2.1
2
PB
2.1
3
PB
2.1
4
PB3.1
PB3.2
PB3.3
PB3.4
PB3.5
PB3.6
PB3.7
PB3.8
PB3.9
PB3.10
PB3.11
SWCLK/TCK
SWDIO/TMS
PB0.12
PB1.7/ETM2
PB
1.1
5
PB
2.0
PB
2.1
PB
2.2
VR
EG
IN
Crossbar 0(PB0 and PB1)
Crossbar 1(PB2 and PB3)
PB4Independent of the crossbars
AN671
2 Rev. 0.1
3. Crossbar Function
The primary function of a crossbar decoder is to route internal digital signals to Port Bank pins. Figure 2 is a blockdiagram of crossbar 0 on SiM3U1xx devices. The inputs to the crossbar are a number of internal digital signalsinside the device. The XBAR0H, XBAR0L, and PBSKIP registers in the port configuration module (PBCFG) definehow the internal digital signals are mapped to the I/O pins of PB0 and PB1.
Figure 2. Example Routing of Internal Digital Signals to Port Banks on SiM3U1xx Devices
Crossbar 0
Digital Crossbar 0
Priority Decoder
Port Match
PM
PMMSK
Not all Port I/O pins are available on all packages.
Port I/O
Cells
PB1.0
PB1.15
16
Port I/O
Cells
PB0.0
PB0.15
16
XBAR0H
XBAR0L
PBSKIP
Highest Priority
Lowest Priority
Flow Control
RX/TX
Clock
USART0
NSS
SCK/MISO/MOSISPI0
Flow Control
RX/TX
Clock
USART1
EPCA0 “N” Channels
PCA0 “N” Channels
PCA1 “N” Channels
EPCA0 ECI
PCA0 ECI
I2C0 SDA/SCL
CMP0A
CMP0SCMP0
CMP1A
CMP1SCMP1
T0EX
T0CTTIMER0
T1EX
T1CTTIMER1
I2S0 TX
PCA1 ECI
Flow Control
RX/TXUART0
RX/TXUART1
NSS
SCK/MISO/MOSISPI1
NSS
SCK/MISO/MOSISPI2
AHB Clock
Output ( 16)
AN671
Rev. 0.1 3
3.1. Crossbar Functionality on ResetAfter a device reset, all crossbars enter a disabled default reset state. Port Bank pins connected to a disabledcrossbar are forced into a high impedance digital input mode. Firmware must enable the crossbar associated witha specific Port Bank pin in order to use that pin as an output. In most applications, firmware will enable allcrossbars on the device to control all the available I/O pins on the device.
When a crossbar is enabled with no internal signals selected to be routed to I/O pins, the crossbar provides fullgeneral purpose input/output (GPIO) access to the Port Banks associated with it. Pins with full GPIO access canbe used as digital inputs, digital outputs, or may be used by various analog functions on the device. As internalsignals are selected to be routed to I/O pins (or “enabled in the crossbar”), the crossbar claims pins from theassociated port banks. Pins claimed by the crossbar cannot be used as GPIO and are under the full control of thecrossbar and the associated peripheral.
3.2. Skipping Pins in the CrossbarThe crossbars have a pin-skipping feature for pins that must be reserved GPIO or analog functions. Any Port Bankpin with its corresponding PBSKIPEN bit set to 1 cannot be claimed by the crossbar and will remain available forGPIO or analog functions. The ability to have the crossbar skip certain pins is useful when a system designer istrying to achieve a specific pinout for the device.
3.3. Crossbar Priority OrderAs internal signals are enabled in a crossbar, the crossbar claims pins from the Port Banks to connect to theinternal signal, starting with the least significant Port Bank pin and finishing with the most significant Port Bank pin.As an example, crossbar 0 of SiM3U1xx devices would start with PB0.0, then PB0.1, and continue in this fashionuntil reaching PB1.15. If the crossbar encounters a pin that has its PBSKIPEN bit set to 1, it skips over the pin andclaims the next available pin. Any pin not claimed by the crossbar can be used for GPIO or analog functions.
The crossbar uses a priority order to assign enabled internal signals to claimed Port Bank pins. This priority ordervaries with the specific crossbar implementation. Figure 3 shows an example priority order from crossbar 0 ofSiM3U1xx devices. In this example, there are four enabled peripherals that require pin assignment: SPI0, EPCA0,UART0, and UART1. From the enabled peripherals, SPI0 has the highest priority, so it will be assigned to the firstthree pins claimed by the crossbar. Note that in this example configuration, firmware configured the first 8 pins ofPB0 (PB0.0 - PB0.7) to be skipped by the crossbar; the crossbar will assign the SPI0 pins to PB0.8, PB0.9, andPB0.10. Following the priority order, the EPCA0 pins are assigned to PB0.11, PB0.12, PB0.15, PB1.0. The PB1.2.PB0.13 and PB0.14 pins are not assigned to EPCA0 because they are configured to be skipped by the crossbar.UART0 and UART1 are assigned to the next four available pins: PB1.3, PB1.4, PB.15, and PB1.6. The remainingpins (PB1.7–PB1.15) are not claimed by the crossbar.
3.4. Creating a Flexible Device PinoutThe definition of a system can sometimes change in the middle of the design cycle, necessitating a pinout change.Planning ahead for such changes in pinout can save costly PCB revisions and decrease time to market when asystem definition change does occur. In the example pinout shown in Figure 3, SPI0 is used in 3-wire mode. If thecommunication protocol was changed from 3-wire to 4-wire mode, then PB0.11 would be used for the NSS signal,causing all peripherals of lower priority order to shift by one pin. Using the crossbar’s skip functionality, the systemdesigner can plan ahead for such a change by skipping PB0.11 when the specification calls for 3-wire SPI mode.The skipped pin can later be un-skipped if the specification later requires the use of 4-wire SPI without affecting thelocation of peripherals with a lower priority order. If the specification does not change, the skipped pin can be usedfor GPIO (e.g., to control an LED or as a debug signal). Adding a few skipped pins when determining the originaldevice pinout can allow future functionality to be added with minimal impact on the device pinout.
AN671
4 Rev. 0.1
Figure 3. Example Crossbar Priority Order on SiM3U1xx Devices (Crossbar 0)
P0 P1
54 6 710 2 3 1312 14 1598 10 11 54 6 710 2 3 1312 14 1598 10 11Signal NamePeripheral
USART0_TXUSART0
USART0_RX
USART0_RTS
USART0_CTS
USART0_UCLK
SPI0_SCKSPI0
SPI0_MISO
SPI0_MOSI
SPI0_NSS
USART1_TXUSART1
USART1_RX
USART1_RTS
USART1_CTS
USART1_UCLK
EPCA0_CEX0EPCA0
EPCA0_CEX1
EPCA0_CEX2
EPCA0_CEX3
EPCA0_CEX4
EPCA0_CEX5
PCA0_CEX0PCA0
PCA0_CEX1
PCA1_CEX0PCA1
PCA1_CEX1
EPCA0_ECIEPCA0 ECI
PCA0_ECIPCA0 ECI
PCA1_ECIPCA1 ECI
I2S0_TX_WSI2S0 TX
I2S0_TX_SCK
I2S0_TX_SD
I2C0_SDAI2C0
I2C0_SCL
CMP0SCMP0
CMP0A
CMP1SCMP1
CMP1A
TIMER0_CTTIMER0
TIMER0_EX
TIMER1_CTTIMER1
TIMER1_EX
UART0_TXUART0
UART0_RX
UART0_RTS
UART0_CTS
UART1_TXUART1
UART1_RX
SPI1_SCKSPI1
SPI1_MISO
SPI1_MOSI
SPI1_NSS
SPI2_SCKSPI2
SPI2_MISO
SPI2_MOSI
SPI2_NSS
AHB_OUTAHB Clock / 16
11 1 111 1 1 10 1 000 0 0 00 0 000 0 0 00 0 000 0 0PBSKIPEN
AN671
Rev. 0.1 5
4. Configuring the Crossbar and Port I/O in Firmware
The Precision32 AppBuilder application provides a graphical interface to easily configure pins in the crossbars.This software uses the Hardware Access Layer (HAL), a part of the Silicon Labs SDK package that enables rapiddevelopment on SiM3xxxx devices. The crossbars and Port Banks on SiM3xxxx devices are part of the PBCFGand PBSTD modules.
The following steps show an example of how to initialize the crossbars and pins on SiM3U1xx devices to achievethe pinout shown in Figure 3 using the Silicon Labs HAL:
1. Enable the APB clock to the I/O modules:
2. Configure pins to be skipped by the crossbars and enable signals in the crossbars. A full list of signal names that may be enabled in the crossbars can be found in a file named SI32_PBCFG_A_Support.h.
3. Configure the functional and output mode of each pin:
4. Enable the crossbar or crossbars:
http://www.silabs.com
Silicon Laboratories Inc.400 West Cesar ChavezAustin, TX 78701USA
Simplicity Studio
One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux!
IoT Portfoliowww.silabs.com/IoT
SW/HWwww.silabs.com/simplicity
Qualitywww.silabs.com/quality
Support and Communitycommunity.silabs.com
DisclaimerSilicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons.
Trademark InformationSilicon Laboratories Inc.® , Silicon Laboratories®, Silicon Labs®, SiLabs® and the Silicon Labs logo®, Bluegiga®, Bluegiga Logo®, Clockbuilder®, CMEMS®, DSPLL®, EFM®, EFM32®, EFR, Ember®, Energy Micro, Energy Micro logo and combinations thereof, "the world’s most energy friendly microcontrollers", Ember®, EZLink®, EZRadio®, EZRadioPRO®, Gecko®, ISOmodem®, Precision32®, ProSLIC®, Simplicity Studio®, SiPHY®, Telegesis, the Telegesis Logo®, USBXpress® and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders.