Cardputer ADV Multi-interface Expansion with CC1101, NR24L01, LoRa, and W5500 Ethernet
This project modifies Bruce firmware for the M5Stack Cardputer ADV to support CC1101, NRF24L01, LoRa, and W5500 Ethernet modules on one portable device.
Cardputer ADV 멀티 통신 확장: CC1101, NRF24L01, LoRa와 W5500 Ethernet 지원
이 프로젝트는 M5Stack Cardputer ADV용 Bruce 펌웨어를 수정하여 CC1101, NRF24L01, LoRa 및 W5500 Ethernet 모듈을 하나의 휴대형 장치에서 사용할 수 있도록 확장한 사례입니다. 여러 통신 모듈이 동일한 SPI 버스와 일부 GPIO를 공유하면서 발생하는 충돌을 해결하기 위해 개별 Chip Select 관리, 키보드 I2C/GPIO 핀 멀티플렉싱 및 모듈 초기화 순서 제어를 적용했습니다.
하나의 Cardputer에서 여러 무선 모듈과 Ethernet을 사용할 수 있을까?
M5Stack Cardputer는 ESP32-S3, 디스플레이, 키보드와 배터리를 하나의 소형 장치에 통합한 휴대형 개발 플랫폼입니다.
기본 장치만으로도 다양한 애플리케이션을 구현할 수 있지만, 외부 무선 모듈과 Ethernet을 동시에 연결하려면 제한된 GPIO와 SPI 버스를 여러 장치가 공유해야 합니다.
이 프로젝트는 Cardputer ADV용 Bruce 펌웨어를 수정하여 다음 외부 통신 모듈을 지원합니다.
- CC1101 Sub-GHz RF 모듈
- NRF24L01 2.4GHz 무선 모듈
- LoRa 모듈
- W5500 Ethernet 모듈
프로젝트의 핵심은 단순히 모듈의 핀을 연결하는 것이 아니라, 여러 SPI 장치와 Cardputer 키보드가 같은 핀을 사용할 때 발생하는 충돌을 펌웨어에서 관리하는 것입니다.
원본 저장소:
https://github.com/JosephCGS/Cardputer-ADV-CC1101-NRF24L01-LoRa
프로젝트 구성
리포지토리에는 다음 자료가 포함되어 있습니다.
- Cardputer ADV용 펌웨어 바이너리 압축 파일
- Bruce 펌웨어 수정 절차
- 외부 모듈별 빌드 플래그와 핀 정의
- 키보드 I2C와 NRF24L01 GPIO 간 핀 공유 처리 방법
- CC1101과 NRF24L01의 SPI 충돌 방지 코드
- 펌웨어 다운로드 절차
현재 리포지토리는 완전한 소스 코드 포크보다 Bruce 펌웨어에 필요한 변경 사항과 빌드 설정을 설명하는 가이드 성격이 강합니다.
지원 통신 인터페이스
| 모듈 | 통신 방식 | 주요 역할 |
|---|---|---|
| CC1101 | SPI | Sub-GHz RF 송수신 |
| NRF24L01 | SPI | 2.4GHz 저전력 무선 통신 |
| LoRa | SPI | 장거리 저속 무선 통신 |
| W5500 | SPI Ethernet | 유선 TCP/IP 네트워크 확장 |
| TCA8418 Keyboard | I2C | Cardputer 키보드 입력 |
CC1101, NRF24L01, LoRa와 W5500은 동일한 기본 SPI 신호선을 공유하도록 설정됩니다.
각 장치는 별도의 CS 또는 SS 핀을 사용하며, 사용하지 않는 장치의 CS 핀은 HIGH 상태로 유지해야 합니다.
W5500 Ethernet 설정
Bruce 펌웨어의 Cardputer 보드 설정에는 W5500을 활성화하기 위한 다음 빌드 옵션이 포함됩니다.
USE_W5500_VIA_SPI
W5500은 Cardputer의 기본 SPI 버스를 사용합니다.
- SS: 기본 SPI SS 핀
- MOSI: 기본 SPI MOSI 핀
- MISO: 기본 SPI MISO 핀
- SCK: 기본 SPI Clock 핀
- INT: Grove SDA 핀
이를 통해 Cardputer에 유선 Ethernet 연결을 추가할 수 있는 기반을 제공합니다.
다만 리포지토리에는 W5500을 이용한 DHCP, TCP Client, Web Server 또는 실제 네트워크 통신 결과가 별도로 제공되지 않습니다.
따라서 현재 자료에서 확인되는 범위는 W5500을 사용할 수 있도록 Bruce 펌웨어의 보드 설정과 핀 정의를 구성했다는 것입니다.
실제 사용 전에는 W5500 모듈 연결, Chip Select 동작, 네트워크 초기화와 다른 SPI 모듈 간 동시 사용을 추가로 검증해야 합니다.
공유 SPI 버스 관리
CC1101, NRF24L01, LoRa와 W5500은 같은 SPI 데이터선을 공유합니다.
공유 SPI 구조에서는 다음 조건이 중요합니다.
- 각 모듈은 고유한 CS 또는 SS 핀을 가져야 합니다.
- 통신하지 않는 모듈의 CS는 항상 HIGH 상태여야 합니다.
- 한 번에 하나의 SPI 장치만 활성화해야 합니다.
- 모듈 초기화 전 다른 장치가 SPI 버스에 응답하지 않도록 해야 합니다.
이 조건이 지켜지지 않으면 다음 문제가 발생할 수 있습니다.
- 장치 초기화 실패
- 잘못된 SPI 응답
- 모듈 간 상호 간섭
- 간헐적인 통신 오류
CC1101과 NRF24L01 충돌 방지
프로젝트는 NRF24L01을 초기화하기 전에 CC1101의 Chip Select 핀을 명시적으로 HIGH로 설정합니다.
CC1101의 SS 핀은 GPIO15로 설정되어 있습니다.
NRF24L01 초기화 함수가 시작될 때 다음 동작을 수행합니다.
- GPIO15를 출력 모드로 설정
- GPIO15를 HIGH로 유지
- CC1101을 SPI 버스에서 비활성화
- NRF24L01 초기화 실행
이 처리를 통해 CC1101이 NRF24L01용 SPI 트래픽에 잘못 반응하는 것을 방지합니다.
키보드와 NRF24L01의 핀 공유
Cardputer ADV의 TCA8418 키보드 컨트롤러는 다음 I2C 핀을 사용합니다.
- SDA: GPIO8
- SCL: GPIO9
하지만 프로젝트의 NRF24L01 설정은 같은 핀을 다음과 같이 사용합니다.
- CE: GPIO8
- SS: GPIO9
즉, 키보드와 NRF24L01이 GPIO8과 GPIO9를 공유합니다.
이를 해결하기 위해 펌웨어는 핀의 동작 모드를 상황에 따라 변경합니다.
평상시에는 GPIO8과 GPIO9를 NRF24L01용 일반 출력 핀으로 사용합니다.
키보드 인터럽트가 발생하면 다음 순서로 동작합니다.
- GPIO8과 GPIO9를 다시 I2C 모드로 설정
- TCA8418에서 키 이벤트 읽기
- I2C 통신 종료
- GPIO8과 GPIO9를 일반 출력 모드로 복구
- NRF24L01이 다시 핀을 사용할 수 있도록 해제
이 방식은 제한된 GPIO를 활용하는 실용적인 소프트웨어 멀티플렉싱 사례입니다.
모듈별 핀 구성
CC1101
- GDO0: GPIO13
- SS: GPIO15
- MOSI/MISO/SCK: 기본 SPI 버스 공유
NRF24L01
- CE: GPIO8
- SS: GPIO9
- MOSI/MISO/SCK: 기본 SPI 버스 공유
LoRa
- CS: GPIO5
- RST: GPIO3
- DIO0: GPIO4
- MOSI/MISO/SCK: 기본 SPI 버스 공유
W5500
- SS: 기본 SPI SS 핀
- INT: Grove SDA
- MOSI/MISO/SCK: 기본 SPI 버스 공유
데이터 흐름
이 프로젝트는 하나의 고정된 데이터 변환 게이트웨이라기보다, Cardputer에서 사용자가 필요한 인터페이스를 선택해 실행하는 멀티 통신 플랫폼에 가깝습니다.
개념적인 구조는 다음과 같습니다.
Cardputer ADV / Bruce Firmware
→ CC1101 Sub-GHz
→ NRF24L01 2.4GHz
→ LoRa Long-Range Radio
→ W5500 Ethernet
Cardputer의 화면과 키보드를 이용해 통신 기능을 선택하고, 외부 모듈을 제어할 수 있는 휴대형 인터페이스로 확장하는 구조입니다.
W5500이 제공하는 가치
CC1101, NRF24L01과 LoRa는 서로 다른 무선 주파수와 통신 범위를 제공합니다.
W5500은 이 휴대형 무선 도구에 안정적인 유선 네트워크 인터페이스를 추가합니다.
향후 펌웨어가 확장되면 다음과 같은 응용이 가능합니다.
- 무선 패킷을 Ethernet 서버로 전달
- 유선 네트워크를 통한 로그 저장
- TCP 또는 UDP 기반 원격 모니터링
- Sub-GHz 또는 LoRa-to-Ethernet 브리지
- Ethernet 기반 장치 설정 및 펌웨어 관리
- Wi-Fi 사용이 제한된 환경의 유선 접속
다만 이러한 기능은 현재 리포지토리에서 완성된 애플리케이션으로 입증된 것은 아니며, W5500 설정을 기반으로 한 향후 확장 가능성입니다.
프로젝트의 기술적 의미
이 프로젝트의 중요한 부분은 다양한 무선 기능의 수가 아니라, 제한된 MCU 자원을 공유하는 방법입니다.
특히 다음 세 가지 설계 포인트를 보여줍니다.
- 여러 SPI 장치에 독립적인 Chip Select 적용
- 사용하지 않는 SPI 장치의 CS를 HIGH로 유지
- 키보드 I2C와 외부 모듈 GPIO를 동적으로 전환
이 구조는 GPIO가 제한된 휴대형 장치에 Ethernet과 여러 무선 인터페이스를 동시에 추가하려는 개발자에게 유용한 참고 사례입니다.
확인이 필요한 사항
프로젝트를 재현하기 전 다음 항목을 확인해야 합니다.
- Cardputer 모델과 Bruce 펌웨어 버전
- 각 외부 모듈의 동작 전압
- 공통 GND 연결
- SPI 버스의 최대 Clock과 배선 길이
- 모듈별 CS 핀 초기 상태
- GPIO8·GPIO9의 I2C/GPIO 전환 안정성
- W5500 모듈의 RESET 및 INT 연결
- W5500 Ethernet 통신의 실제 동작 여부
- 여러 외부 모듈을 동시에 연결했을 때의 전력 소비
FAQ
Q1. 모든 무선 모듈이 동시에 통신하나요?
같은 SPI 버스를 공유하기 때문에 일반적으로 한 번에 하나의 SPI 장치만 선택해 통신해야 합니다.
각 모듈의 CS 핀을 올바르게 관리하면 여러 모듈을 하나의 버스에 연결할 수 있습니다.
Q2. W5500 Ethernet이 실제로 테스트됐나요?
리포지토리에는 W5500 빌드 플래그와 핀 설정이 포함되어 있습니다.
그러나 DHCP 연결, IP 할당, TCP 통신 등의 테스트 결과는 별도로 제공되지 않습니다. 따라서 실제 W5500 모듈을 연결해 추가 검증해야 합니다.
Q3. NRF24L01과 키보드가 같은 핀을 사용해도 되나요?
펌웨어가 GPIO8과 GPIO9를 I2C와 일반 GPIO 사이에서 전환하기 때문에 가능합니다.
다만 동시에 사용할 수는 없으며, 키보드 이벤트를 읽는 동안에는 NRF24L01 사용이 일시적으로 중단됩니다.
Q4. 왜 모든 비활성 SPI 장치의 CS를 HIGH로 유지해야 하나요?
CS가 LOW인 장치는 SPI 버스의 데이터에 응답할 수 있습니다.
여러 장치가 동시에 활성화되면 MISO 충돌이나 잘못된 응답이 발생할 수 있으므로, 현재 사용하는 장치를 제외한 모든 CS를 HIGH로 유지해야 합니다.
Q5. Cardputer 기본 모델에도 적용할 수 있나요?
프로젝트는 Cardputer ADV와 특정 Bruce 펌웨어 설정을 기준으로 작성되었습니다.
다른 Cardputer 버전에서는 키보드 컨트롤러, GPIO 배치와 주변장치 구성이 다를 수 있으므로 핀 설정을 다시 확인해야 합니다.
Q6. W5500과 LoRa를 연결하면 자동으로 LoRa-to-Ethernet 게이트웨이가 되나요?
아닙니다.
하드웨어와 보드 설정이 두 인터페이스를 지원하더라도, LoRa 패킷을 수신해 TCP나 UDP로 전달하는 애플리케이션 로직을 별도로 구현해야 합니다.
Q7. 이 프로젝트의 가장 큰 차별점은 무엇인가요?
휴대형 Cardputer에서 CC1101, NRF24L01, LoRa와 W5500을 지원하면서, SPI 장치 충돌과 키보드 핀 공유 문제를 펌웨어로 해결했다는 점입니다.
결론
이 프로젝트는 M5Stack Cardputer ADV를 CC1101, NRF24L01, LoRa 및 W5500 Ethernet을 지원하는 멀티 통신 플랫폼으로 확장합니다.
여러 모듈이 동일한 SPI 버스를 공유할 때 개별 CS 핀을 관리하고, 키보드 I2C 핀과 NRF24L01 제어 핀을 동적으로 전환하는 방법을 제시합니다.
W5500 설정은 Cardputer에 유선 Ethernet을 추가할 수 있는 기반을 제공하지만, 현재 공개 자료에는 완성된 Ethernet 애플리케이션이나 네트워크 테스트 결과가 포함되어 있지 않습니다.
따라서 이 프로젝트의 가치는 완성된 무선-to-Ethernet 게이트웨이보다, 제한된 GPIO와 SPI 자원을 활용해 휴대형 장치에 여러 통신 인터페이스를 통합한 펌웨어 설계 사례에 있습니다.
Cardputer ADV Multi-Interface Expansion with CC1101, NRF24L01, LoRa, and W5500 Ethernet
This project modifies Bruce firmware for the M5Stack Cardputer ADV to support CC1101, NRF24L01, LoRa, and W5500 Ethernet modules on one portable device. It addresses shared-bus and limited-GPIO challenges through dedicated chip-select control, dynamic keyboard I2C/GPIO multiplexing, and controlled SPI device initialization.
Can One Cardputer Support Multiple Radio Modules and Wired Ethernet?
The M5Stack Cardputer integrates an ESP32-S3, display, keyboard, and battery into a compact portable development platform.
Adding multiple external radio interfaces and Ethernet, however, requires several devices to share a limited number of GPIO pins and the same SPI bus.
This project modifies Bruce firmware for the Cardputer ADV to support:
- CC1101 Sub-GHz radio
- NRF24L01 2.4GHz radio
- LoRa radio
- W5500 Ethernet
The main challenge is not simply connecting the modules. The firmware must prevent conflicts when several SPI peripherals and the Cardputer keyboard reuse the same pins.
Original repository:
https://github.com/JosephCGS/Cardputer-ADV-CC1101-NRF24L01-LoRa
Repository Contents
The repository provides:
- A firmware archive for the Cardputer ADV
- Firmware flashing instructions
- Bruce firmware modification steps
- Build flags and pin definitions for external modules
- Keyboard I2C and NRF24L01 GPIO multiplexing logic
- SPI conflict-avoidance code for CC1101 and NRF24L01
The repository is primarily an adaptation guide and prebuilt firmware package rather than a complete fork containing the entire Bruce source tree.
Supported Interfaces
| Module | Interface | Main Function |
|---|---|---|
| CC1101 | SPI | Sub-GHz RF communication |
| NRF24L01 | SPI | Low-power 2.4GHz communication |
| LoRa | SPI | Long-range, low-data-rate communication |
| W5500 | SPI Ethernet | Wired TCP/IP expansion |
| TCA8418 Keyboard | I2C | Cardputer keyboard input |
The radio modules and W5500 share the main SPI data lines.
Each SPI device must use an independent chip-select pin, and every inactive device must keep its chip-select pin HIGH.
W5500 Ethernet Configuration
The Cardputer board configuration includes the following build option:
USE_W5500_VIA_SPI
The W5500 is configured to use the default SPI bus:
- SS: Default SPI SS pin
- MOSI: Default SPI MOSI pin
- MISO: Default SPI MISO pin
- SCK: Default SPI clock pin
- INT: Grove SDA pin
This configuration provides the firmware foundation for adding wired Ethernet to the Cardputer.
The repository, however, does not provide separate DHCP, TCP client, web-server, or network-performance test results.
The verified scope is therefore limited to the W5500 build configuration and pin definitions. Actual Ethernet operation and simultaneous use with the radio modules require additional hardware testing.
Shared SPI Bus Management
CC1101, NRF24L01, LoRa, and W5500 share the same SPI data lines.
A shared SPI design requires:
- A unique CS or SS pin for each module
- HIGH chip-select levels for every inactive device
- Only one active SPI peripheral at a time
- Controlled initialization so that another peripheral does not respond to the bus
Incorrect chip-select control may cause initialization failures, invalid responses, interference, or intermittent communication errors.
Preventing CC1101 and NRF24L01 Conflicts
Before initializing the NRF24L01, the firmware explicitly drives the CC1101 chip-select pin HIGH.
GPIO15 is assigned as the CC1101 SS pin.
At the beginning of NRF24L01 initialization, the firmware:
- Configures GPIO15 as an output
- Drives GPIO15 HIGH
- Keeps the CC1101 deselected
- Initializes the NRF24L01
This prevents the CC1101 from responding to SPI traffic intended for the NRF24L01.
Sharing Pins Between the Keyboard and NRF24L01
The Cardputer ADV keyboard controller uses:
- SDA: GPIO8
- SCL: GPIO9
The NRF24L01 configuration reuses the same pins:
- CE: GPIO8
- SS: GPIO9
The firmware solves this conflict by dynamically changing the pin function.
During normal operation, GPIO8 and GPIO9 are available as output pins for the NRF24L01.
When a keyboard interrupt occurs, the firmware:
- Restores GPIO8 and GPIO9 to I2C mode
- Reads the keyboard event from the TCA8418
- Stops the I2C interface
- Returns both pins to GPIO output mode
- Releases them for the NRF24L01
This is a practical software-multiplexing method for a platform with limited GPIO resources.
Pin Configuration
CC1101
- GDO0: GPIO13
- SS: GPIO15
- MOSI/MISO/SCK: Shared default SPI bus
NRF24L01
- CE: GPIO8
- SS: GPIO9
- MOSI/MISO/SCK: Shared default SPI bus
LoRa
- CS: GPIO5
- RST: GPIO3
- DIO0: GPIO4
- MOSI/MISO/SCK: Shared default SPI bus
W5500
- SS: Default SPI SS
- INT: Grove SDA
- MOSI/MISO/SCK: Shared default SPI bus
Conceptual Architecture
The project is not a fixed protocol-conversion gateway. It is better described as a portable multi-interface platform in which the user selects the required communication function.
Cardputer ADV / Bruce Firmware
→ CC1101 Sub-GHz
→ NRF24L01 2.4GHz
→ LoRa Long-Range Radio
→ W5500 Ethernet
The Cardputer display and keyboard provide a portable user interface for controlling the external modules.
Value of the W5500
CC1101, NRF24L01, and LoRa provide different wireless frequency ranges and communication characteristics.
The W5500 can add a stable wired network interface to the same portable platform.
Potential future applications include:
- Forwarding radio packets to an Ethernet server
- Wired network logging
- TCP or UDP remote monitoring
- Sub-GHz or LoRa-to-Ethernet bridging
- Ethernet-based configuration
- Wired access in environments where Wi-Fi is unavailable
These are potential extensions rather than functions demonstrated by the current repository.
Technical Significance
The most important aspect of the project is the management of limited MCU resources.
It demonstrates:
- Independent chip-select control for multiple SPI devices
- Keeping inactive devices deselected
- Dynamic switching between keyboard I2C and external-module GPIO functions
This makes the project useful for developers adding Ethernet and several radio interfaces to a compact portable device.
Items to Verify
Before reproduction, verify:
- The exact Cardputer and Bruce firmware versions
- Module operating voltages
- Common ground wiring
- SPI clock and wiring length
- Initial state of every chip-select pin
- Stability of GPIO8/GPIO9 multiplexing
- W5500 RESET and interrupt wiring
- Actual W5500 network operation
- Total current consumption with multiple modules attached
FAQ
Q1. Can all radio modules communicate simultaneously?
They share one SPI bus, so normally only one SPI device should be selected at a time.
Multiple devices can remain connected when their chip-select signals are properly controlled.
Q2. Has W5500 Ethernet operation been tested?
The repository includes W5500 build flags and pin definitions.
It does not provide separate results for DHCP, IP assignment, or TCP communication, so additional testing is required.
Q3. Can the keyboard and NRF24L01 use the same pins?
Yes, because the firmware switches GPIO8 and GPIO9 between I2C and GPIO modes.
They are not used simultaneously. NRF24L01 access is interrupted while a keyboard event is being read.
Q4. Why must inactive SPI chip-select pins remain HIGH?
A device with a LOW chip-select signal may respond to SPI traffic.
If multiple devices are selected, MISO contention and invalid responses may occur.
Q5. Does connecting LoRa and W5500 automatically create a LoRa-to-Ethernet gateway?
No.
Application logic must still be written to receive LoRa packets and forward them through TCP or UDP.
Q6. What is the main difference of this project?
It adds several radio interfaces and W5500 Ethernet to a portable Cardputer while solving SPI conflicts and keyboard pin-sharing problems in firmware.
Conclusion
This project expands the M5Stack Cardputer ADV into a multi-interface platform supporting CC1101, NRF24L01, LoRa, and W5500 Ethernet.
It demonstrates independent SPI chip-select management and dynamic pin multiplexing between the keyboard and NRF24L01.
The W5500 configuration provides a foundation for wired networking, although the repository does not document a completed Ethernet application or network test.
Its primary value is therefore the firmware architecture for integrating several communication interfaces into a compact device with limited GPIO and shared SPI resources.

