Generate stabilized PWM signals
A standard technique for generating analog voltages using µCs is to use a PWM output and filter the signal with a simple RC filter (Figure 1). The voltage of the PWM signal is directly proportional to the µC's supply voltage, so it is not necessarily clean or stable. To overcome this problem, you can use the circuit in Figure 2. Here, a 74HC14 Schmitt-trigger array serves as an output stage for three PWM signals from an SX18 µC. (The idea applies to other µCs, too.) The 74HC14 derives its supply voltage, VCCA, from the stabilization circuit comprising the inexpensive shunt regulator, SR1. You can adjust VCCA by trimming R1. The test circuit used VCCA=4.096V. The PWM signals now have a stable amplitude that varies less than 0.1% when the µC's supply varies from 4.5 to 5.5V. Resistors R3 to R5 limit the current flowing from the µC through the 74HC14's input-protection diodes when VCCA is too low. The values of R and C depend on the application. The test circuit uses 10 kW and 4.7 µF. If you feed multiple analog (or PWM) signals through a single IC, you usually encounter crosstalk. To characterize the circuit in Figure 1 for internal crosstalk and unmatched delays, conduct the following tests.
Generated three PWM signals with different frequencies and 1-to-1 duty cycles. With a 0-dB reference-level square-wave signal at test point TP1, crosstalk to test points TP2and TP3 measures –70 dB. The first harmonic of the PWM signal (theoretically zero for a 1-to-1 duty cycle) is down 65 dB at test point TP1. At test point TP0, spurs are down 75 dB. So, the circuit in Figure 1 has very good crosstalk characteristics. Also, if the duty cycle of one PWM channel changes, the influence on the voltage that other channels generates is less than 0.1%. You must take care to ensure that the switching delays of the 74HC14 do not change with varying VCC applied to the µC. If the switching delays change with VCC because of the changing levels of the driving signals, VCC influences the generated output voltage, even if VCCA is constant. You can use the circuit for precise generation of voltages, thanks to the temperature stability of the TL431. You can also use it for inexpensive implementations of sigma-delta converters, or to generate voltage-stabilized rectangular waveforms. (DI #2573)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本