Posts

XPM52C PD/QC charging module overview

Image
Today I want to review and test a simple PD/QC charging module. It is built on the XPM52C chip — a synchronous buck converter that promises to deliver up to 65W at the output (we’ll check this a bit later). This module is unbranded, but very similar ones labeled CKCS U1E can also be found, which feature a higher-quality PCB and convenient mounting slots. The chip supports a wide range of protocols, including USB PD 3.1, Qualcomm QC 2.0/3.0/3.0+, Huawei FCP/SCP, Samsung AFC, VOOC 2.0/4.0, and others, ensuring universal compatibility. Key features include support for an input voltage up to 31V, an output voltage range of 3.3–21V, built-in XPD-LINK™ technology for intelligent power management, and a full suite of protection mechanisms (overvoltage, short circuit, overheating, etc.). Thanks to its specifications, the XPM52C serves as a comprehensive solution for car chargers, portable equipment, and smart sockets, supplied in a compact QFN4x4-16L package. On the tester, I see the fol...

How Flash Memory Partitioning Works in ESP32

Image
The organization of Flash memory in the ESP32 strongly reminds me of how hard drives on PCs worked during the MBR era. There is also a bootloader, a partition table, and, of course, the data partitions themselves. And regardless of the flash size, the partitioning rules remain the same. Usually, the partition table starts at the address 0x8000 and takes up 4 KB. However, in some cases, a larger bootloader might be needed, which requires shifting the partition table further down. The structure of a single entry in the partition table looks like this: struct PartitionEntry { uint8_t magic ; // Magic number for entry validation uint8_t type ; // Partition type uint8_t subtype ; // Partition subtype uint8_t reserved ; // Reserved uint32_t offset ; // Partition offset in flash memory uint32_t size ; // Partition size char name [ 16 ]; // Partition name uint32_t flags ; // ...

How to Add CH32V Support to PlatformIO

Image
CH32V are quite cheap RISC-V architecture microcontrollers from WinChipHead (Nanjing Qinheng Microelectronics). There is also CH32F — these are microcontrollers based on the ARM architecture. To get started, we will need two things: A CR-CH32VXX development board (devboard) with a CH32V003 — which is one of the cheapest microcontrollers. And a WCH-LinkE — a programmer for the CH32V. You can find standard WCH-Link programmers on sale, but they are not suitable for the CH32V00x series because it uses a single-wire programming and debugging protocol. And this is only supported by the more expensive WCH-LinkE. By the way, there are projects that turn an RP2040 into a similar programmer, but the official utilities (MounRiver Studio) do not support anything other than WCH-Link. However, I don’t use the official IDE anyway. Therefore, I will probably try doing this and describe the process in the near future. Why do I use PlatformIO instead of MounRiver Studio? On the one hand, Mou...

Review and Setup of the A7670E LTE Modem on Linux

Image
Features: Connectivity : GSM/GPRS/EDGE: 900/1800 MHz and LTE-FDD: B1, B3, B5, B7, B8, B20. Navigation : Includes an input for a GNSS antenna for satellite positioning. Data Rates : Over LTE — Downlink up to 10 Mbps, Uplink up to 5 Mbps. Over EDGE: up to 236.8 Kbps in both directions. Power Supply : 3.4 V to 4.2 V — perfectly matching the operating voltage range of Li-Ion batteries. Interfaces : USB — the module emulates a network card (RNDIS) and UART. There is also a separate, “real” UART. However, it lacks an analog audio interface for sound and a microphone. Card Slot : A standard, convenient NanoSIM slot is soldered onto the board. In addition to the micro-USB connector, the board features a standard 7-pin header. Here is their pinout: Letter Function G Ground (GND) R UART RX T UART TX K Module power control (Power Key) V Power (VCC) G Ground (GND) S Sleep — this pin can be used to put the modem into deep sleep mode for minimal power ...

Power-Off Reset: How to Unbrick the CH32V003 in a SOP-8 Package

Image
I continue to explore CH32V microcontrollers. Today, I have the tiny CH32V003J4M6 in a SOP-8 package on my desk.   This is the smallest package with a bare minimum of pins — 2 are for power, leaving 6 available for use. It doesn’t even have a hardware reset pin (NRST). Like other microcontrollers in the CH32V00x series, it is programmed via a single SWIO wire ( pin 8 ). And here lies an interesting problem: if you initialize this pin in your firmware for other tasks, it stops working as SWIO. After that, programming the chip using the standard method becomes impossible. For example, the following code prints “Hello world” to the UART: #include <ch32v00x.h> #include <debug.h> void NMI_Handler ( void ) __attribute__ (( interrupt ( "WCH-Interrupt-fast" ))); void HardFault_Handler ( void ) __attribute__ (( interrupt ( "WCH-Interrupt-fast" ))); int main ( void ) { SystemCoreClockUpdate (); Delay_Init (); USART_Printf_Init ( 96...

How to Minimal-Boot and Flash CH32V203C8T6 on an Adapter Board

Image
I received a large batch of CH32V203C8T6 microcontrollers. And a question arose: how do I check if these microcontrollers are good? There are no ready-made device boards available at the moment, but they still need to be tested somehow. Fortunately, I have a few LQFP48 to PGA adapter boards. I haven’t had to solder such complex chips before. I’ll try using a mini-oven for the soldering process. Additionally, I’ll need solder paste. I have a tube that has been sitting around for quite a while. I once tried it on some small parts and put it aside, thinking that one day I’d be soldering serious stuff and this paste would come in handy. Several years have passed, and that moment has come. But as it turns out, solder paste can dry up, especially if the tube isn’t sealed tightly :) It used to be almost liquid, but now it feels like playdough. I managed to squeeze some out and smear it across the adapter. This is my first time soldering packages like this, let alone using bottom heating...