Share this

Intelligent Instrument Design Based on HT47 Series RISC Microcontroller

2026-04-06 04:31:21 · · #1
The HT47 series MCU is an 8-bit Reduced Instruction Set Computing (RISC) microcontroller launched by Holtek Semiconductor in recent years. Besides possessing the advantages of RISC microcontrollers, such as a small instruction set, easy memory, pipelined instruction execution, and high operating speed, its on-chip two-channel RF A/D conversion circuit, dynamic LCD driver circuit, and software dongle timer provide great convenience for designing small and even portable intelligent instruments. The entire hardware consists of a sensor, an HT47C20 chip, an LCD panel, and a small number of resistors and capacitors. Figure 1 shows the structure of the HT47C20's two-channel RF A/D conversion circuit. Figure 2 shows the RF A/D conversion process. Figure 3 shows the relationship curve between temperature θ and the calculated value Nt. Figure 4 shows the θ-Nt relationship curve processed using piecewise linear interpolation. RF A/D. Figure 1 shows the structure of the HT47C20's two-channel RF A/D conversion circuit. In the figure, Timer A and Timer B are two 16-bit programmable counters, whose initial count values ​​can be set by the program. Timer A counts the system clock, the system clock/4 divided signal, or the overflow signal (RTC Output) of the real-time clock; Timer B counts the pulse signals generated by the RC oscillation circuit of channel 1 or channel 2. Below, we will take a temperature instrument constructed using channel 1 as an example to introduce its temperature measurement principle and design method. Figure 2 clearly illustrates the RF-type A/D conversion process: 1. As shown in Figure 2(a), Timer B counts the oscillation pulses generated by the oscillation circuit composed of reference resistor Rs and reference capacitor Cs, while Timer A counts the system clock. By setting the relevant bits in the special function register, Timer A and Timer B can be started simultaneously. Timer B counts from the initial value 0000H-NS to 0000H (overflow); Timer A counts from the initial value 0000H to m, and both stop counting simultaneously. The value of NS must ensure that Timer B overflows first; this period is the gate time. 2. As shown in Figure 2(b), the initial value of Timer A is changed to 0000H-m, and the initial value of Timer B is changed to 0000H. Timer B counts the oscillation pulses generated by the oscillation circuit composed of the sensor (NTC thermistor) resistor Rt and the reference capacitor Cs, while Timer A still counts the system clock. When they are started simultaneously again, both stop counting and request an interrupt when Timer A overflows. It can be seen that the gate time for the two counts is equal, and at this time the count value of Timer B is Nt. From the above process, we can see that: NS·(1/fs)=Nt·(1/ft) So Nt=NS·ft/fs (1) And fs=1/(ks·Rs·Cs) ft=1/(kt·Rt·Cs) In the formula, ks and kt are constants related to the power supply voltage, ambient temperature and the product of RsCs or RtCs (generally taken as 1.9~2.3), which can be regarded as approximately equal here, so we have: ft/fs=Rs/Rt Substituting this formula into the above expression for Nt, we can get: Nt=NS·Rs/Rt (2) As we can see from the above, NS is the count value of the oscillation pulse generated by the Timer B on the oscillation circuit composed of the reference resistor Rs and the reference capacitor Cs within the specified gate time. Like Rs, it is a constant set in advance. Formula (2) shows that the count value Nt and the sensor resistance Rt are approximately inversely proportional. The relationship between them is shown in Figure 3(a). The resistance-temperature relationship curve of the thermistor itself is shown in Figure 3(b). The relationship curve between the measured temperature and the count value Nt can be obtained by graphical transformation, as shown in Figure 3(c). By processing the relationship curve between the measured temperature and the count value Nt using piecewise linear interpolation, the corresponding measured temperature can be calculated from the count value Nt. Divide the q-Nt relationship curve in Figure 4 into several segments, and replace each segment with a corresponding broken line. The linear function of qN can be obtained relative to each broken line: q = a·Nt+b Where: a is the slope of the broken line segment, and b is the intercept. It is worth noting that when using the two-channel RF type A/D conversion circuit in the HT47C20 chip for temperature measurement, the Timer B uses the same oscillation capacitor Cs (i.e., the reference capacitor) for the two counts of the external RC oscillation circuit. It can be seen from equation (2) that the count value Nt and the capacitor Cs are not directly related. Therefore, the temperature measurement result will not be affected when the capacitance changes with the ambient temperature. This is very meaningful for improving the system measurement accuracy of the instrument. Figure 5 shows the software flowchart of the main program and interrupt service routine. Figure 6 shows the layout of the display buffer and related pins. Figure 7 shows the software flowchart of a temperature measuring instrument constructed using the HT47C20's on-chip RF-type A/D converter . Figure 5 illustrates the software flowchart of a temperature measuring instrument constructed using the HT47C20's on-chip RF-type A/D converter circuit. The HT47C20's on-chip dynamic LCD display circuit consists of a display buffer and a drive output circuit. The display buffer occupies internal RAM addresses 40H to 53H (which can be used as ordinary RAM units when the LCD circuit is not used in the system). Any character code written to the display buffer using indirect addressing will directly (via the drive output circuit) cause the LCD screen to display the corresponding character. Figure 6 shows the layout of the display buffer and the correspondence between each memory unit and the relevant external pins of the chip. As shown in Figure 6, only the lower 4 bits of each memory cell in the display buffer are valid. The entire display circuit can be externally connected to a 20*2, 20*3, or 19*4 (i.e., 1/2 duty, 1/3 duty, or 1/4 duty) C-type LCD display via the chip's internal mask selection. Figure 7 shows a very simple instrument hardware circuit constructed using the HT47C20 as the core component. Only one measurement channel, In0, is shown in the figure. If the other measurement channel, In1, is also utilized, two analog quantities can be measured simultaneously without adding external circuitry. It can be seen that its cost-effectiveness is incomparable to that of ordinary microcontroller circuits. Conclusion: In addition to the HT47C20, the HT47 series also includes the HT47C20L (mask/low-power version) and the HT47R20 (OTP version) with the same structure and function. It is worth noting that Holtek Semiconductor's latest product, the HT47C10, has undergone significant structural simplifications, such as a reduction in on-chip program memory, data memory capacity, and the number of driving strokes in the LCD circuit. The RF-type A/D conversion channel has been reduced to one. However, in some applications, its cost-effectiveness is higher. [b]References[/b] 1 Holtek Semiconductor. HT47C20 Product Technical Data 2 Mao Liqun, Song Jiaren. Linearization of Nonlinear Curves Implemented in VB5.0. Metrology Technology, 2000(2) Editor: He Shiping
Read next

CATDOLL CATDOLL 115CM Dora (TPE Body with Hard Silicone Head)

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22