Pinout & GPIO Mapping
Hardware Overview
The Snake V1 is powered by the STMicroelectronics STM32WB35CEU6A, a dual-core microcontroller supporting Bluetooth Low Energy (BLE) and 802.15.4 protocols. This section provides the logical mapping between the MCU pins and the integrated peripherals, essential for firmware development and hardware debugging.
GPIO Mapping Table
The following table outlines the primary pin assignments for the Snake V1. These mappings are required when initializing peripheral drivers in your application code.
| GPIO Pin | Function | Peripheral | Description | | :--- | :--- | :--- | :--- | | PA11 | USB_DM | USB-C | USB Data Minus | | PA12 | USB_DP | USB-C | USB Data Plus | | PA15 | SPI1_NSS | CC1101 | Sub-GHz Transceiver Chip Select | | PA5 | SPI1_SCK | CC1101 | Sub-GHz Transceiver Clock | | PA6 | SPI1_MISO | CC1101 | Sub-GHz Transceiver Data Out | | PA7 | SPI1_MOSI | CC1101 | Sub-GHz Transceiver Data In | | PB2 | GDO0 | CC1101 | Sub-GHz Programmable Output | | PB3 | GDO2 | CC1101 | Sub-GHz Programmable Output | | PA8 | TIM1_CH1 | IR TX | IR Transmitter (TSAL6400) PWM Control | | PA0 | TIM2_CH1 | IR RX | IR Receiver (TSOP38238) Signal Input | | PB5 | SPI2_MOSI | microSD | SD Card Data In | | PB4 | SPI2_MISO | microSD | SD Card Data Out | | PB10 | SPI2_SCK | microSD | SD Card Clock | | PB1 | GPIO_CS | microSD | SD Card Chip Select |
Peripheral Reference
Sub-GHz (Texas Instruments CC1101)
The CC1101 transceiver is interfaced via SPI1. It is designed for low-power wireless applications operating in the sub-1 GHz bands.
- Data Interface: SPI1 (PA5, PA6, PA7).
- Interrupts: GDO0 and GDO2 are connected to PB2 and PB3, allowing the MCU to respond to packet reception or transmission events without constant polling.
Infrared (IR) System
The IR system consists of a dedicated transmitter and receiver for remote control emulation and signal analysis.
- Transmitter (TSAL6400): Driven by PA8. It is recommended to use a Timer PWM at 38kHz for standard consumer IR protocols.
- Receiver (TSOP38238): Connected to PA0. Use Input Capture mode on Timer 2 to measure the pulse widths of incoming signals.
microSD Storage
The Molex 47352-1001 connector is wired for SPI communication.
- Interface: SPI2.
- Compatibility: Supports standard microSD cards for logging captured RF data or storing IR hex codes.
Connectivity (BLE & Wi-Fi)
While the STM32WB35 provides native Bluetooth Low Energy (BLE) support via its Cortex-M0+ radio core, additional connectivity options are managed through the internal shared bus. No external GPIO pins are required for the integrated BLE radio as it uses the internal IP stack.
Configuration Example
To initialize the IR Transmitter in your firmware using the STM32 HAL:
/* GPIO Initialization for IR Transmitter */
GPIO_InitTypeDef GPIO_InitStruct = {0};
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_8;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; // Alternate Function for PWM
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
[!TIP] Always ensure that the internal clock speed of the STM32WB is correctly configured to match the baud rate requirements of the CC1101 SPI interface (typically up to 10 MHz).