How to Use the Built-in Operational Amplifier in CH32V003
The CH32V003 microcontrollers (as well as the CH32V006) feature a very interesting piece of hardware - a built-in operational amplifier (OPA). In this article, I will explore and practically demonstrate how to use it for measuring small voltages, such as reading data from various sensors or current shunts. Before we get to soldering, let’s take a quick look at the architecture. The built-in OPA has multiplexed inputs, meaning it can be software-switched to take a signal from different pairs of pins. For example, the TSSOP20 package offers two groups: Group 0 ( PA1 — OPN0, PA2 — OPP0) and Group 1 ( PD0 — OPN1, PD7 — OPP1). However, the output always remains the same — it is hardwired to the PD4 pin (OPO). The situation is slightly different with the smaller chips in the SOP8 and SOP16 packages. The multiplexing mechanism is still present in the silicon, but the required pins are simply not physically broken out, so there are effectively no switching options. (By the way, there is...