zxd.life Blog
website·Indexed 31 days ago
https://blog.zxd.lifeA technical blog featuring guides and tutorials on embedded systems (ESP32, ESP8266, STM32F103C8T6, STC89C52, nRF52811), hardware interfacing with e-paper displays, 3D modeling with Fusion360 and SketchUp, and software development topics including C/C++, Qt, Vue, and Linux system configuration.
What's inside zxd.life
- The Taishanpai Camera project focuses on mastering Rockchip's MPP (Media Process Platform) through practical implementation on the Taishanpai hardware. Key practical milestones include porting the OV8858 camera and enabling the MIPI screen.
Overview of the TaishanPi Monitoring System (cctv_monitor)
The TaishanPi Monitoring System is a project designed for CCTV monitoring using the TaishanPi (RK3566) platform. The system consists of a lower-computer (embedded side) for camera capture and streaming, and an upper-computer (client side) for video playback.# Project Source Code https://github.com/Zhuang-xd/cctv_monitorOverview of STC89C52 Microcontroller Learning Project
This project focuses on learning C language and hardware fundamentals using the STC89C52 microcontroller and the Puzhong A2 (普中A2) development board. The primary objectives include:
- Reading schematic diagrams to identify pins.
- Using chip datasheets to drive peripherals (identifying device addresses and converting timing diagrams into code).
- Implementing common communication protocols such as I2C, SPI, and 1-Wire.
Develop the monitoring client (Upper-Computer)
The upper-computer application is developed using Qt. It utilizes thexvideoviewlibrary, which provides a shallow wrapper around FFmpeg and SDL for RTSP stream pulling and video display. The architecture is intended to be further refined using the Chain of Responsibility design pattern.Configure CMake toolchain for Taishanpai (RK3566/RK3568) cross-compilation
To cross-compile for the Taishanpai board (aarch64 Linux), create atoolchain.cmakefile. You must specify the system name, processor architecture, the absolute paths to the aarch64-buildroot-linux-gnu GCC and G++ compilers, and the target system root directory (sysroot).set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR aarch64) # Replace with your actual toolchain paths set(CMAKE_C_COMPILER "/path/to/buildroot/output/rockchip_rk3566/host/bin/aarch64-buildroot-linux-gnu-gcc") set(CMAKE_CXX_COMPILER "/path/to/buildroot/output/rockchip_rk3566/host/bin/aarch64-buildroot-linux-gnu-g++") # Replace with your actual target system root directory set(CMAKE_FIND_ROOT_PATH /path/to/buildroot/output/rockchip_rk3568/target/) # Configure how CMake searches for programs and libraries set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)1-Wire communication for DS18B20 and IR Receivers
The 1-Wire protocol (used by the DS18B20 temperature sensor) and IR receiver protocols distinguish between high and low logic levels based on the duration of the time interval. Data is typically sent from LSB to MSB (low to high).Understand I2C protocol characteristics and physical layer
The I2C (Inter-Integrated Circuit) bus is used for communication between multiple integrated circuits (ICs). It is a serial communication protocol characterized by:
- Low Pin Count: Uses only two lines: SCL (Serial Clock) and SDA (Serial Data).
- Variable Speed: Communication speed is controlled by the switching frequency of the SCL line.
- Multi-Slave Architecture: Supports one master and multiple slaves. Slaves are identified by a 7-bit address, allowing up to 111 unique devices (out of a theoretical 128, minus reserved addresses).
Understand the Qt Signal and Slot mechanism
The Signal and Slot mechanism is a communication pattern used in Qt for object-to-object interaction. It is based on the Meta-Object System and implements a publish-subscribe pattern. Key characteristics include:
- Thread Safety: Safe for communication across different threads.
- Decoupling: Objects remain independent; a single signal can be connected to multiple slots, and a single slot can be connected to multiple signals.
Build an E-Paper Desktop Calendar using nRF52811
This project implements a desktop electronic photo album/calendar using a three-color E-paper display powered by the Nordic nRF52811 microcontroller. The system supports displaying calendars and wallpapers via Bluetooth image transfer.Start BLE Advertising on ESP32
After configuring the server and services, you must start advertising so that clients can discover the ESP32. This involves getting the advertising object, adding the service UUID to the advertisement packet, and enabling the scan response.// Start advertising p_advertising = BLEDevice::getAdvertising(); p_advertising->addServiceUUID(SERVICE_UUID); p_advertising->setScanResponse(true); p_advertising->start();Set up network and NFS mount in Taishan-pai init script
Configure the/etc/init.d/rcSscript to initialize the network interfaceeth0with a static IP and mount a remote NFS directory to/mnt. The script also iterates through and executes all other initialization scripts in/etc/init.d/S??*in numerical order.#!/bin/sh # Network configuration ifconfig eth0 up ifconfig eth0 192.168.0.150 netmask 255.255.255.0 # Mount NFS share mount -t nfs -o nfsvers=3,nolock 192.168.0.200:/home/shelton/Workspaces/projects /mnt # Start all init scripts in /etc/init.d executing them in numerical order for i in /etc/init.d/S??* ;do # Ignore dangling symlinks [ ! -f "$i" ] && continue case "$i" in *.sh) # Source shell script for speed ( trap - INT QUIT TSTP set start . $i ) ;; *) # No sh extension, so fork subprocess $i start ;; esac doneExport SketchUp models for 3D printing
To export a model in a 3D printable format, navigate to: File (文件) $\rightarrow$ Export 3D Model (导出三维模型) $\rightarrow$ select STL format.