T5AI Pin Mapping
This reference lists the pin definitions and multiplexing maps for the TUYA_T5AI_BOARD and TUYA_T5AI_CORE development boards, so you can quickly look up GPIO numbers and peripheral function assignments. The pin definitions of both boards are identical.
GPIO overviewโ
The T5AI provides pins P0โP55. The tables below list the Arduino alias and available multiplexed functions for each pin.
UART serialโ
| Port | Signal | Arduino Alias | T5 Hardware Pin |
|---|---|---|---|
| UART0 (default serial) | TX | TX | P11 |
| UART0 (default serial) | RX | RX | P10 |
| UART1 | TX | TX1 | P0 |
| UART1 | RX | RX1 | P1 |
| UART2 (default) | TX | TX2 | P31 |
| UART2 (default) | RX | RX2 | P30 |
| UART2 | TX | TX2 | P41 |
| UART2 | RX | RX2 | P40 |
Serial uses UART0 (P10/P11) by default.
I2C busโ
| Signal | Arduino Alias | T5 Hardware Pin |
|---|---|---|
| SCL | SCL | P20 |
| SDA | SDA | P21 |
SPI busโ
Default clock frequency: 8 MHz.
| Signal | Arduino Alias | T5 Hardware Pin |
|---|---|---|
| SCK | SCK | P14 |
| SS (CS) | SS | P15 |
| MOSI | MOSI | P16 |
| MISO | MISO | P17 |
ADC analog inputโ
Resolution: 12-bit. Mode: continuous sampling.
| Arduino Alias | T5 Hardware Pin | ADC Channel | Description |
|---|---|---|---|
A0 | P25 | CH1 | Recommended analog input |
A1 | P24 | CH2 | Recommended analog input |
A2 | P23 | CH3 | Recommended analog input |
A3 | P28 | CH4 | Recommended analog input |
A4 | P22 | CH5 | Recommended analog input |
A5 | P21 | CH6 | Shared with I2C SDA |
A0โA4 are dedicated analog input pins with no multiplexing conflicts โ use them first. A5 also serves other functions; verify there are no multiplexing conflicts before using it for ADC.
PWM outputโ
12 PWM channels in total:
| PWM Channel | T5 Hardware Pin | Arduino Alias | Description |
|---|---|---|---|
| PWM0 | P18 | D0 | โ |
| PWM1 | P24 | A1 / D1 | Shared with ADC CH2 |
| PWM2 | P32 | D2 | โ |
| PWM3 | P34 | D3 | โ |
| PWM4 | P36 | D4 | โ |
| PWM5 | P19 | D5 | โ |
| PWM6 | P8 | โ | โ |
| PWM7 | P9 | โ | โ |
| PWM8 | P25 | A0 | Shared with ADC CH1 |
| PWM9 | P33 | โ | โ |
| PWM10 | P35 | โ | โ |
| PWM11 | P37 | โ | โ |
D0โD5 are the recommended PWM output pins.
Analog pin aliases (Ax)โ
| Alias | T5 Hardware Pin | ADC Channel | Note |
|---|---|---|---|
A0 | P25 | CH1 | Also usable as PWM8 |
A1 | P24 | CH2 | Also usable as PWM1, shared with D1 |
A2 | P23 | CH3 | โ |
A3 | P28 | CH4 | โ |
A4 | P22 | CH5 | โ |
A5 | P21 | CH6 | Shared with I2C SDA |
Digital pin aliases (Dx)โ
| Alias | T5 Hardware Pin | PWM Channel | Note |
|---|---|---|---|
D0 | P18 | PWM0 | โ |
D1 | P24 | PWM1 | Shares P24 with A1 |
D2 | P32 | PWM2 | โ |
D3 | P34 | PWM3 | โ |
D4 | P36 | PWM4 | โ |
D5 | P19 | PWM5 | โ |
A1 and D1 share P24 and support both ADC and PWM. Avoid enabling both peripherals at the same time.