6''Hot_TC1767_PWM_ADC_Synchronous
- 格式:pdf
- 大小:1.41 MB
- 文档页数:52
A VR产生PWM波实例程序(1)一个实例:那个程序是用ICC的向导生成的,专门简单。
T0是作为一般8位定时器,频率100KHz,每次中断将PB0(pin1)状态反转,产生的是200KHz占空比50%的方波。
T1是作为工作模式9:相频可调PWM波发生器,频率初始化16KHz,占空比50%。
请注意:TCNT1是T0的定时器计数值,确实是每个定时器时钟加1,和一般定时器的计数值寄存器作用一样。
OCR1A作为比较的TOP值。
OCR1B作为匹配输出值。
当TCNT1的值增加到OCR1B相等时,OC1B(pin18)清零,确实是对应低电平;然后TCNT1连续增加到OCR1A(确实是TOP)的值,然后TCNT1开始减少,那个中间,OC1B(Pin18)状态不变;当TCNT1减少到OCR1B相等时,OC1B(pin18)置1,确实是对应高电平。
然后TCNT1连续减少到0x00(确实是BOTTOM),然后TCNT1又开始增加,那个中间,OC1B(pin18)状态不变。
OCR1B的值与OCR1A的比值确实是PWM的占空比!因此那个值必须比OCR1A小。
当OCR1B为0时,PWM波就一直为低电平(相当于占空比为0);当OCR1B为OCR1A 时,PWM波就一直为高电平(相当于占空比为100);当OCR1B为OCR1A的一半时,PWM波确实是占空比为50%。
你能够修改OCR1B的值,然后重新下载程序运行,看看占空比的改变;也能够修改OCR1A的值,然后重新下载程序运行,看看频率的改变,只是要注意修改OCR1A时,同时注意OCR1B的值不要比OCR1A大。
模式9确实是PWM生成中最复杂的一种,只要你明白得了那个,对别的几种PWM都好明白得。
TCNT0 = 0xB0; //set countOCR0 = 0x50;即使工作在normal模式下,那个OCR0仍旧在和TCNT0进行比较,一旦匹配后,就会产生中断或者改变OC0脚上的电平(产生PWM)。
Personal Systems Reference Lenovo® ThinkCentre Desktops January 2011 - Version 391Lenovo ThinkCentre M90/M90p(Eco Ultra Small, Small, Tower Form Factors)Visit /psref for the latest versionLenovo ® USB-to-DVI Monitor Adapter45K52961GB PC3-8500 DDR3 UDIMM 45J54342GB PC3-8500 DDR3 UDIMM 45J54351GB PC3-8500 DDR3 Low-Halogen SODIMM 55Y37062GB PC3-8500 DDR3 Low-Halogen SODIMM 55Y3707(UDIMM for SFF , Tower only; SODIMM for Eco USFF only)Kensington ®MicroSaver ®Cable Lock73P2582Kensington Twin Head Cable Lock45K1620NVIDIA ® GeForce ® 310 DMS59 (2-DVI, 2-VGA)57Y4167Lenovo ThinkCentre M58 Eco Ultra Small with dual Lenovo ThinkVision monitorsLenovo ThinkCentre M58 Small with Lenovo ThinkVision monitorLenovo ThinkCentre M58 SmallLenovo ThinkCentre M58 and M58p Eco Ultra Small, Small, TowerLenovo ThinkCentre M58 Eco Ultra Small☞☞☞☞☞☞☞☞☞☞☞Partial list of accessories supported on ThinkCentre M58 and M58pMemoryEco Ultra Small 8820/7359/7637/9961/7479/6136 use notebook memory:1GB PC3-8500 DDR3 Low-Halogen SODIMM 55Y3706 ann 06/23/09 1GB PC3-8500 DDR3 L-H SODIMM (25-Pack) 57Y4385 ann 06/23/09 2GB PC3-8500 DDR3 Low-Halogen SODIMM 55Y3707 ann 06/23/09 2GB PC3-8500 DDR3 L-H SODIMM (25-Pack) 57Y4386 ann 06/23/09 Small 8910/7360/6258/7638/9964/7483/7220/6137/6234, andTower 9960/7373/6239/9965/7484/7188/6138/6209/3063/3285/9728/ 7639 use desktop memory:1GB PC3-8500 DDR3 UDIMM 45J5434 ann 11/18/08 1GB PC3-8500 DDR3 UDIMM (25-Pack) 57Y4421 ann 11/10/09 2GB PC3-8500 DDR3 UDIMM 45J5435 ann 11/18/08 2GB PC3-8500 DDR3 UDIMM (25-Pack) 57Y4422 ann 11/10/09 More information at/support/desktopmemorycompatibilityOpticalAll:DVD-ROM DL SATA 1.5Gb/s 16X-48X Max4 41N5618 ann 09/26/06 Super Multi-Burner DL DVD±RW SATA Drive 41N5620 ann 09/26/06 Tower 9960/7373/6239/9965/7484/7188/6138/6209/3063/3285/9728/ 7639 support:Blu-ray™ Burner SA TA 1.5Gb/s Drive 45K1675 ann 03/31/09 Storage and removable storage250GB SATA 3.0Gb/s Disk (7200 rpm) 41N3015 ann 01/24/06 500GB SATA 3.0Gb/s Disk (7200 rpm) 43R1990 ann 11/06/07 1TB SATA 3.0Gb/s Disk (7200 rpm) 45J7918 ann 08/19/08 USB 2.0 Portable 320GB Hard Disk 45K1689 ann 03/17/09 USB 2.0 Portable 500GB Hard Disk 45K1690 ann 05/26/09 USB 2.0 Portable Secure 160GB Hard Disk 43R2018 ann 11/18/08 USB 2.0 Portable Secure 320GB Hard Disk 43R2019 ann 11/18/08 eSATA/USB 2.0 Secure 500GB Hard Drive 57Y4400 ann 01/07/10 USB 2.0 Portable DVD Burner 43N3264 ann 01/05/10 GraphicsSmall 8910/7360/6258/7638/9964/7483/7220/6137/6234 support Low Profi le:ADD2 DVI-D Monitor Connection (HDCP) 43R1985 ann 11/06/07 NVIDIA® Quadro® 256MB NVS 290(2-DVI or 2-VGA via DMS59 dongles) 43R1765 ann 12/18/07 NVIDIA GeForce® 310 512MB DMS59(2-DVI or 2-VGA via DMS59 dongles) 57Y4167 ann 03/02/10 Tower 9960/7373/6239/9965/7484/7188/6138/6209/3063/3285/9728/ 7639 support 75 watts max:ADD2 DVI-D Monitor Connection (HDCP) 43R1985 ann 11/06/07 NVIDIA Quadro 256MB NVS 290 43R1765 ann 12/18/07 NVIDIA Quadro 256MB NVS 295 (2-DP) 45K1669 ann 04/21/09 NVIDIA GeForce 310 512MB DMS59 57Y4167 ann 03/02/10 More information at /support/graphiccards KeyboardPreferred Pro USB Keyboard 73P5220 ann 06/21/05 Preferred Pro Full Size PS/2 Keyboard 31P7415 ann 06/04/02 Enhanced Performance USB Keyboard 73P2620 ann 03/23/04 Ultraslim Wireless Keyboard and Mouse52 57Y4700 ann 09/15/09 Lenovo® USB Fingerprint Keyboard 73P4730 ann 02/22/05 Lenovo USB Smartcard Keyboard 51J0155 ann 03/24/09 52 Wireless via 2.4GHz technology using a micro-size USB receiver. More information at /support/keyboardsMouseLenovo Optical Mouse (USB) 06P4069 ann 05/21/03 Lenovo ScrollPoint® Mouse (USB, Optical) 31P7405 ann 08/27/02 Lenovo Laser Mouse (USB) 41U3074 ann 01/23/07 Lenovo Wireless Laser Mouse - Black5245K1696ann 11/25/08 Lenovo Wireless Laser Mouse - Red/Black5251J0198 ann 11/25/08 More information at /support/mice MultimediaThinkPad® In-Ear Headphones6057Y4488ann 01/07/10 60 Has a 1.2 meter (3.9-foot) cable. Best when systems are in closeproximity. Example: SFF placed on a desk.SecurityKensington® MicroSaver® Cable Lock56 73P2582ann 12/29/03 Kensington Twin Head Cable Lock56 45K1620ann 09/30/08 Lenovo Security Cable Lock 57Y4303 ann 08/24/10 USB Gemplus GemPC Smart Card Reader 41N3040 ann 02/21/06 56 Attaching to any form factor not only secures the ThinkCentre tothe work area, but it also prevents users from opening the chassis itself.Mounting DeviceEco Ultra Small 8820/7359/7637/9961/7479/6136 supportunder desk mounting device:ThinkCentre Ultra Small Under Desk Mount 40Y8625 ann 09/06/05 MonitorsLenovo L2230x Wide 21.5" Monitor 5453HB1 ann 06/10/10 ThinkVision® L1711p 17" Monitor 5047HB2 ann 10/20/09 ThinkVision L1900p 19" Monitor 4431HE1 ann 11/11/08 ThinkVision L1951p Wide 19" Monitor 2448HB6 ann 10/20/09 ThinkVision L2250p Wide 22" Monitor 2572HB6 ann 10/20/09 ThinkVision L2251p Wide 22" Monitor 2572HD6 ann 10/20/09 ThinkVision L2251x Wide 22" Monitor 2578HB6 ann 10/20/09 ThinkVision L2321x Wide 23" Monitor 4014HB6 ann 06/10/10 ThinkVision L2440p Wide 24" Monitor 4420HB2 ann 09/17/08 More information at /thinkvisionMonitor Accessories46Eco Ultra Small 8820/7359/7637/9961/7479/6136 support:Lenovo Vertical PC and Monitor Stand II 41R4474 ann 01/27/09 All:Lenovo USB-to-DVI Monitor Adapter 45K5296 ann 05/12/09 DisplayPort™ to Single-link DVI-D Cable 45J7915 ann 08/05/08 DisplayPort to VGA Monitor Cable 57Y4393 ann 08/04/09 ThinkVision USB Soundbar 40Y7616 ann 08/23/05 ThinkVision Soundbar 45K1263 ann 09/16/08 Kensington MicroSaver Cable Lock56 73P2582ann 12/29/03 Kensington Twin Head Cable Lock56 45K1620ann 09/30/08 Lenovo Security Cable Lock 57Y4303 ann 08/24/10 ThinkCentre Extend Arm 57Y4352 ann 07/06/10 46 Compatible on selected Lenovo and ThinkVision monitors.More information at /support/monitoraccessoriesFor more information on desktop accessories, please visit:/support/accessories/support/desktopaccessories/support/securityOther accessories at /accessoriesAccessories Guide pdf at /accessoriesguideThinkCentre® M58, M58p Accessories Personal Systems Reference (PSREF)Lenovo ThinkCentre M70e Tower with Lenovo ThinkVision monitorLenovo ThinkCentre M70e Small with Lenovo ThinkVision monitorLenovo ThinkCentre M70e Smallwith optional PS/2 keyboard and mouse ports Lenovo ThinkCentre M70e Small and TowerLenovo ThinkCentre M70e Small andLenovo ThinkCentre M70e TowerThinkCentre® M70e Small (0809) - TopSeller (Windows 7)Personal Systems Reference (PSREF)Partial list of accessories supported on ThinkCentre M70eMemory1GB PC3-8500 DDR3 UDIMM 45J5434 ann 11/18/08 1GB PC3-8500 DDR3 UDIMM (25-Pack) 57Y4421 ann 11/10/09 2GB PC3-8500 DDR3 UDIMM 45J5435 ann 11/18/08 2GB PC3-8500 DDR3 UDIMM (25-Pack) 57Y4422 ann 11/10/09 More information at/support/desktopmemorycompatibilityOpticalDVD-ROM DL SATA 1.5Gb/s 16X-48X Max441N5618 ann 09/26/06 Super Multi-Burner DL DVD±RW SATA Drive 41N5620 ann 09/26/06Storage and removable storage250GB SATA 3.0Gb/s Disk (7200 rpm) 41N3015 ann 01/24/06 500GB SATA 3.0Gb/s Disk (7200 rpm) 43R1990 ann 11/06/07 USB 2.0 Portable 320GB Hard Disk 45K1689 ann 03/17/09 USB 2.0 Portable 500GB Hard Disk 45K1690 ann 05/26/09 USB 2.0 Portable Secure 160GB Hard Disk 43R2018 ann 11/18/08 USB 2.0 Portable Secure 320GB Hard Disk 43R2019 ann 11/18/08 eSA TA/USB 2.0 Secure 500GB Hard Drive 53 57Y4400ann 01/07/10 USB 2.0 Portable DVD Burner 43N3264 ann 01/05/10 53 USB-only attach.GraphicsSmall 0809/0822/0830/0833/0843 support Low Profi le:DisplayPort™ to Single-link DVI-D Cable50 45J7915ann 08/05/08 DisplayPort to VGA Monitor Cable50 57Y4393ann 08/04/09 ADD2 DVI-D Monitor Connection (HDCP) 43R1985 ann 11/06/07 NVIDIA® Quadro® 512MB FX 380 LP(DP, DVI with a DVI to VGA converter) 57Y4396 ann 02/02/10 NVIDIA GeForce® 310 512MB (DP, VGA) 57Y4397 ann 02/02/10 NVIDIA GeForce 310 512MB DMS59(2-DVI or 2-VGA via DMS59 dongles) 57Y4167 ann 03/02/10 Tower 0806/0829/0832/0842 support:DisplayPort to Single-link DVI-D Cable50 45J7915ann 08/05/08 DisplayPort to VGA Monitor Cable50 57Y4393ann 08/04/09 ADD2 DVI-D Monitor Connection (HDCP) 43R1985 ann 11/06/07 NVIDIA GeForce 310 512MB (DP, VGA) 57Y4397 ann 02/02/10 NVIDIA GeForce 310 512MB DMS59 57Y4167 ann 03/02/10 50 Attaches to theThinkCentre compatible DisplayPort graphics card. More information at /support/graphiccardsKeyboardPreferred Pro USB Keyboard 73P5220 ann 06/21/05 Preferred Pro Full Size PS/2 Keyboard 31P7415 ann 06/04/02 Enhanced Performance USB Keyboard 73P2620 ann 03/23/04 Ultraslim Wireless Keyboard and Mouse52 57Y4700ann 09/15/09 ThinkPad USB Keyboard with T rackPoint 55Y9003 ann 08/18/09 Lenovo® USB Fingerprint Keyboard 73P4730 ann 02/22/05 Lenovo USB Smartcard Keyboard 51J0155 ann 03/24/09 52 Wireless via 2.4GHz technology using a micro-size USB receiver.More information at /support/keyboardsMouseLenovo Optical Mouse (USB) 06P4069 ann 05/21/03 ThinkPad® USB Laser Mouse 57Y4635 ann 12/15/09 Lenovo ScrollPoint® Mouse (USB, Optical) 31P7405 ann 08/27/02 Lenovo Laser Mouse (USB) 41U3074 ann 01/23/07 Lenovo Wireless Laser Mouse - Black52 45K1696ann 11/25/08 Lenovo Wireless Laser Mouse - Red/Black52 51J0198ann 11/25/08 More information at /support/mice MultimediaThinkPad In-Ear Headphones6057Y4488ann 01/07/10 60 Has a 1.2 meter (3.9-foot) cable. Best when systems are in closeproximity. Example: SFF placed on a desk.ModemUSB 2.0 Lenovo Modem 43R1814ann 02/26/08 SecurityKensington® MicroSaver® Cable Lock5673P2582ann 12/29/03 Kensington T win Head Cable Lock5645K1620ann 09/30/08 Lenovo Security Cable Lock 57Y4303 ann 08/24/10 USB Gemplus GemPC Smart Card Reader41N3040ann 02/21/06 56 Attaching to any form factor not only secures the ThinkCentre tothe work area, but it also prevents users from opening the chassis itself.MonitorsLenovo D186 Wide 18.5" Monitor 2580AB1 ann 01/12/10 Lenovo L2230x Wide 21.5" Monitor 5453HB1 ann 06/10/10 ThinkVision® L1711p 17" Monitor 5047HB2 ann 10/20/09 ThinkVision L1900p 19" Monitor 4431HE1 ann 11/11/08 ThinkVision L1951p Wide 19" Monitor 2448HB6 ann 10/20/09 ThinkVision L2250p Wide 22" Monitor 2572HB6 ann 10/20/09 ThinkVision L2251p Wide 22" Monitor 2572HD6 ann 10/20/09 ThinkVision L2251x Wide 22" Monitor 2578HB6 ann 10/20/09 ThinkVision L2321x Wide 23" Monitor 4014HB6 ann 06/10/10 ThinkVision L2440p Wide 24" Monitor 4420HB2 ann 09/17/08 More information at /thinkvisionMonitor Accessories46Lenovo USB-to-DVI Monitor Adapter 45K5296 ann 05/12/09 ThinkVision USB Soundbar 40Y7616 ann 08/23/05 ThinkVision Soundbar 45K1263 ann 09/16/08 Kensington MicroSaver Cable Lock56 73P2582ann 12/29/03 Kensington Twin Head Cable Lock56 45K1620ann 09/30/08 Lenovo Security Cable Lock 57Y4303 ann 08/24/10 ThinkCentre Extend Arm 57Y4352 ann 07/06/10 46 Compatible on selected Lenovo and ThinkVision monitors.More information at /support/monitoraccessoriesFor more information on desktop accessories, please visit:/support/accessories/support/desktopaccessories/support/securityOther accessories at /accessoriesAccessories Guide pdf at /accessoriesguideThinkCentre® M70e Accessories Personal Systems Reference (PSREF)Lenovo ThinkCentre M75e Tower with Lenovo ThinkVision monitorLenovo ThinkCentre M75e Small with Lenovo ThinkVision monitorLenovo ThinkCentre M75e SmallLenovo ThinkCentre M75e Small and TowerLenovo ThinkCentre M75e Small andLenovo ThinkCentre M75e Tower。
正弦波脉宽调制代码下面是一个使用Python编程语言编写的正弦波脉宽调制(PWM)的示例代码:python.import numpy as np.import matplotlib.pyplot as plt.# 生成正弦波。
t = np.linspace(0, 1, 500, endpoint=True) # 时间从0到1秒,共500个点。
f = 5 # 正弦波的频率为5Hz.x = np.sin(2 np.pi f t) # 生成正弦波信号。
# 脉宽调制。
duty_cycle = 0.5 # 占空比为50%。
pwm = np.zeros_like(t)。
pwm[x > 0] = 1 # 正半周部分为1,负半周部分为0。
# 绘制图形。
plt.figure()。
plt.subplot(2, 1, 1)。
plt.plot(t, x, 'b')。
plt.title('Sinewave')。
plt.subplot(2, 1, 2)。
plt.plot(t, pwm, 'r')。
plt.title('PWM Signal')。
plt.show()。
这段代码首先使用NumPy库生成了一个5Hz频率的正弦波信号,然后通过脉宽调制技术将正弦波转换为PWM信号。
在这个示例中,占空比设为50%,即正半周为高电平,负半周为低电平。
最后,使用Matplotlib库将原始正弦波和PWM信号绘制在同一张图上进行对比。
需要注意的是,这只是一个简单的示例代码,实际的PWM调制可能涉及到更复杂的信号处理和控制逻辑,具体实现会根据具体的应用场景和要求而有所不同。
●No-load power consumption < 50mW at 230VAC alongwith fast dynamic load response and short turn-on delay in typical 20W and above adapter applications●Primary-side feedback eliminates opto-isolators andsimplifies design●Adaptively controlled soft-start enables fast and smoothstart-up for a wide range of capacitive loads (from 330μF to 6,000μF) with output voltage up to 12V●Tight constant-voltage regulation across line and loadrange●Proprietary optimized 79kHz maximum PWM switchingfrequency with quasi-resonant operation achieves best size, efficiency and common mode noise●User-configurable 5-level cable drop compensationprovides design flexibility●EZ-EMI® design enhances manufacturability●Adaptive multi-mode PWM/PFM control improvesefficiency●No external loop compensation components required●Built-in single-point fault protections against outputshort-circuit, output over-voltage, output over-current, and current-sense-resistor-short fault●Dedicated pins for external over-temperature protectionand over-voltage protection, with latch function available ●Tight constant current control enables output currentlimit and over-load protection●No audible noise over entire operating range The iW1760 is a high performance AC/DC power supply controller which uses digital control technology to build peak current mode PWM flyback power supplies. The device operates in quasi-resonant mode to provide high efficiency along with a number of key built-in protection features while minimizing the external component count, simplifying EMI design and lowering the total bill of material cost. The iW1760 removes the need for secondary feedback circuit while achieving excellent line and load regulation. It also eliminates the need for loop compensation components while maintaining stability over all operating conditions. Pulse-by-pulse waveform analysis allows for a loop response that is much faster than traditional solutions, resulting in improved dynamic load response. The built-in power limit function enables optimized transformer design in universal off-line applications and allows for a wide input voltage range.iWatt’s innovative proprietary technology ensures that power supplies built with the iW1760 can achieve both highest average active efficiency and less than 50mW no-load power consumption in 20W output power range, and have fast yet smooth start-up with a wide range of capacitive loads with output voltage up to 12V, and are ideal for network and monitor adapter applications.●Power adapters for network devices and monitors●AC/DC power supplies in home appliances●Universal input AC/DC adapters (15W - 40W)LNV OUTRTNL NV OUT RTNFigure 3.2: iW1760 Typical Application Circuit (Alternative Circuit without Using Active Start-up Device)Note: Pin 4 (ASU) can be left unconnected if an active start-up device is not needed in the application circuit.Figure 4.1: 8 Lead SOIC-8 PackageiW1760Absolute maximum ratings are the parameter values or ranges which can cause permanent damage if exceeded. For maximum safe operating conditions, refer to Electrical Characteristics in Section 6.0.6.0 Electrical CharacteristicsV = 12V, -40°C ≤ T ≤ +85°C, unless otherwise specified.V = 12V, -40°C ≤ T ≤ +85°C, unless otherwise specified.Notes:Note 1: The V-based output OVP threshold depends on the CDC setup, see Section 9.12 for more details.SENSENote 2: These parameters are not 100% tested and guaranteed by design and characterization.Figure 7.1 : V CC UVLO vs. TemperatureFigure 7.2 : Start-Up Threshold vs. TemperatureFigure 7.3 : Switching Frequency vs. Temperature 1Figure 7.4 : Internal Reference vs. Temperature12.1012.0812.0612.0412.0212.0011.9811.9611.9411.9211.9075-50-252550100125150V C C S t a r t -u p T h r e s h o l d (V )Ambient Temperature (ºC)677175798387f s w @ L o a d > 50% (k H z )Ambient Temperature (ºC)1.9901.9941.9982.0022.0062.010I n t e r n a l R e f e r e n c e V o l t a g e (V )Ambient Temperature (ºC)6.906.826.746.666.586.506.426.346.266.186.10-50-25255075100125150V C C U V L O (V )Ambient Temperature (ºC)V CC (V)V C C S u p p l y S t a r t -u p C u r r e n t (µA )Figure 7.5 : V CC vs. V CC Supply Start-up CurrentNotes:1051041031021011009998979695-50-250255075100125150I S D (µA )Ambient Temperature (ºC)Figure 7.6 : I SD vs. TemperatureV CCV I SENSEASUSD Figure 8.1: iW1760 Functional Block DiagramThe iW1760 is a digital controller which uses a new, proprietary primary-side control technology to eliminate the opto-isolated feedback and secondary regulation circuits required in traditional designs. This results in a low-cost solution for low power AC/DC adapters. The core PWM processor uses fixed-frequency Discontinuous Conduction Mode (DCM) operation at higher power levels and switches to variable frequency operation at light loads to maximize efficiency. Furthermore, iWatt’s digital control technology enables fast dynamic response, tight output regulation, and full-featured circuit protection with primary-side control. The block diagram in Figure 8.1 illustrates the iW1760 operating in peak current mode control. The digital logic control block generates the switching on-time and off-time information based on the output voltage and current feedback signal and provides commands to dynamically control the external MOSFET gate voltage. The I SENSE is an analog input configured to sense the primary current in a voltage form. In order to achieve the peak current mode control and cycle-by-cycle current limit, the V IPK sets the threshold for the I SENSE to compare with, and it varies in the range of 0.23V (typical) to 1.00V (typical) under different line and load conditions. The system loop is automatically compensated internally by a digital error amplifier. Adequate system phase margin and gain margin are guaranteed by loop compensation. The iW1760 uses an advanced digital control algorithm to reduce system design time and increase reliability.Furthermore, accurate secondary constant current operation is achieved without the need for any secondary-side sense and control circuits.The iW1760 uses adaptive multi-mode PWM/PFM control to dynamically change the MOSFET switching frequency for efficiency, EMI, and power consumption optimization. In addition, it achieves unique MOSFET quasi-resonant switching to further improve efficiency and reduce EMI. Built-in single-point fault protection features include over-voltage protection (OVP), output short-circuit protection (SCP), over-current protection (OCP), and I SENSE fault detection. In particular, it ensures that power supplies built with the iW1760 are best suited for power adapter applications such as wireless routers that have large input capacitances.iWatt’s digital control scheme is specifically designed to address the challenges and trade-offs of power conversion design. This innovative technology is ideal for balancing new regulatory requirements for green mode operation with more practical design considerations such as minimum cost,9.1 Pin DetailPin 1 – VSENSESense signal input from auxiliary winding. This provides the secondary voltage feedback used for output regulation.Pin 2 – SDExternal shutdown control. If the voltage at this pin is lower than 1.2V (typical) at the beginning of start-up or lower than 1.0V(typical) during normal operation, then the IC shuts down. Leave this pin unconnected if the shutdown control is not used (Refer to Section 9.14).Pin 3 – CFGUsed to configure external cable drop compensation (CDC) at the beginning of start-up and provide over-voltage protection during normal operation by sensing output voltage via auxiliary winding.Pin 4 – ASUControl signal for active start-up device. This signal is pulled low after start-up is finished to cut off the active device.Pin 5 – ISENSEPrimary current sense. Used for cycle-by-cycle peak current control and limit.Pin 6 – OUTPUTGate drive for the external power MOSFET switch.Pin 7 – GNDGround.Pin 8 – VCCPower supply for the controller during normal operation. Thecontroller starts up when VCC reaches 12.0V (typical), andshuts down when the VCC voltage drops below 6.5V (typical).A decoupling capacitor of 0.1 μF or so should be connectedbetween the VCC pin and GND.9.2 Active Start-up and AdaptivelyControlled Soft-StartThe iW1760 features an innovative proprietary soft-startscheme to achieve fast yet smooth build-up of output voltagewith a wide range of output loads, including capacitive loadstypically from 330μF to 6,000μF, and for output voltagecovering typically from 5V to 12V. In addition, the activestart-up schemes enable the shortest possible turn-on delaywithout sacrificing no-load power loss.Refer to Figure 3.1 for active start-up circuits using externaldepletion mode N-FET. Prior to start-up, the ENABLE signalis low, and the ASU pin voltage closely follows the VCCpinvoltage, as shown in Figure 9.1. Consequently, the depletionmode N-FET is turned on, allowing the start-up current tocharge the VCCbypass capacitor. When the VCCbypasscapacitor is charged to a voltage higher than the start-upthreshold VCC(ST), the ENABLE signal becomes active andthe iW1760 begins to perform initial OTP check (See Section9.14), followed by CDC configuration (See Section 9.12).Afterwards, the iW1760 commences soft-start function.During the soft-start process, the primary-side peak currentis limited cycle-by-cycle by the IPEAKcomparator. The wholesoft-start process can break down into several stages basedon the output voltage levels, which is indirectly sensed byVSENSEsignal at the primary side. At different stages, theiW1760 adaptively controls the switching frequency andprimary-side peak current so that the output voltage canalways build up very fast at the early stages and smoothlytransition into the desired regulation voltage at the finalstage, regardless of any capacitive and resistive loads thatthe applications may incur. With a minimum system cost, thisadaptively controlled soft-start feature makes the iW1760ideal in network power adapter applications such as wirelessrouters in which the adapter needs to drive large capacitiveloads with 12V output voltage.Start-up SequencingASUAs the ENABLE signal initiates the soft-start process, it also pulls down the ASU pin voltage at the same time, which turns off the depletion mode N-FET, thus minimizing theno-load standby power consumption. If at any time the V CC voltage drops below the under-voltagelockout (UVLO) threshold V CC(UVL), then the iW1760 goes to shut-down. At this time the ENABLE signal becomes low, the depletion mode N-FET turns on, and the V CC capacitor begins to charge up again towards the start-up threshold to initiate a new soft-start process.In applications where the active start-up is not needed, the start-up resistor can be directly connected to the V CC pin without using the active start-up device, and the ASU pin can be left unconnected. Refer to Figure 3.2 for the application circuit.9.3 Understanding Primary Feedback Figure 9.2 illustrates a simplified flyback converter. When the switch Q1 conducts during t ON (t), the current i g (t) is directly drawn from rectified sinusoid v g (t). The energy E g (t) is stored in the magnetizing inductance L M . The rectifying diode D1 is reversely-biased and the load current I O is supplied by the secondary capacitor C O . When Q1 turns off, D1 conductsand the stored energy E g (t) is delivered to the output.v OFigure 9.2: Simplified Flyback ConverterIn order to tightly regulate the output voltage, the information about the output voltage and load current needs to be accurately sensed. In the DCM flyback converter, this information can be read via the auxiliary winding or the primary magnetizing inductance (L M ). During the Q1 on-time, the load current is supplied from the output filter capacitor C O . The voltage across L M is v g (t), assuming the voltage dropped across Q1 is zero. The current in Q1 ramps up linearly at a rate of:()()g g di t v t =(9.1)At the end of on-time, the current has ramped up to:()()_g ONg peak Mv t t i t L ×=(9.2)This current represents a stored energy of:()2_2M g g peak L E i t =×(9.3)When Q1 turns off att O , i g (t) in L M forces a reversal of polarities on all windings. Ignoring the communication-time caused by the leakage inductance L K at the instant of turn-off t O , the primary current transfers to the secondary at a peak amplitude of:()()_Pd g peak SN i t i t N =×(9.4)Assuming the secondary winding is master, and the auxiliary winding is slave,V AUXAUX IN x AUXN PFigure 9.3: Auxiliary Voltage WaveformsThe auxiliary voltage is given by:()V AUXAUX O SN V V N =+∆ (9.5)and reflects the output voltage as shown in Figure 9.3.The voltage at the load differs from the secondary voltage by a diode drop and IR losses. Thus, if the secondary voltage is always read at a constant secondary current, the difference between the output voltage and the secondary voltage is a fixed ΔV. Furthermore, if the voltage can be read when the secondary current is small, ΔV is also small. With theThe real-time waveform analyzer in the iW1760 reads this information cycle by cycle. The device then generates a feedback voltage V FB . The V FB signal precisely represents the output voltage under most conditions and is used to regulate the output voltage.9.4 Constant Voltage Operation After soft-start has been completed, the digital control block measures the output conditions. It determines output power levels and adjusts the control system according to a light load or heavy load. If this is in the normal range, the device operates in the Constant Voltage (CV) mode, and changes the pulse width (t ON ) and off time (t OFF ) in order to meet the output voltage regulation requirements.If no voltage is detected on V SENSE it is assumed that the auxiliary winding of the transformer is either open or shorted and the iW1760 shuts down. 9.5 Current Limit and Constant CurrentOperationIn overload condition, the iW1760 enters constant current (CC) mode to limit the output current on a cycle-by-cycle basis. In this mode of operation the output current is limited to a constant level regardless of the output voltage, while avoiding continuous conduction mode operation. In case of very heavy loading when the output voltage is low enough, the iW1760 shuts down.The iW1760 senses the load current indirectly through the primary current, which is detected by the pin I SENSE through a resistor from the MOSFET source to ground.O u t p u t V o l t a g eOutput CurrentOUT(CC)V Figure 9.4: Power Envelope9.6 Multi-Mode PWM/PFM Control and Quasi-Resonant Switching The iW1760 uses a proprietary adaptive multi-mode PWM /PFM control to dramatically improve the light-load efficiencyand the overall average efficiency.During the constant voltage (CV) operation, the iW1760 normally operates in a pulse-width-modulation (PWM) mode in heavy load conditions. In the PWM mode, the switching frequency keeps around constant. As the output load I OUT is reduced, the on-time t ON is decreased, and the controller adaptively transitions to a pulse-frequency-modulation (PFM) mode. In the PFM mode, the MOSFET is turned on for a set duration under a given instantly-rectified AC inputvoltage, but its off-time is modulated by the load current. With a decreasing load current, the off-time increases and thus the switching frequency decreases.When the switching frequency approaches to human ear audio band, the iW1760 transitions to a second level of PWM mode, namely the Deep PWM mode (DPWM). In the DPWM mode, the switching frequency keeps around 22kHz in order to avoid audible noise. As the load current is further reduced, the iW1760 transitions to a second level of PFM mode, namely the Deep PFM mode (DPFM), which can reduce the switching frequency to a very low level. Although the switching frequency drops across the audible frequency range during the DPFM mode, the output current in the power converter has reduced to an insignificant level in the DPWM mode before transitioning to the DPFM mode. Therefore, the power converter practically produces no audible noise, while achieving high efficiency across various load conditions.As the load current reduces to very low or no-load condition, the iW1760 transitions from the DPFM to the third level of PWM mode, namely the Deep-Deep PWM mode (DDPWM), in which the switching frequency is fixed at around 1.9kHz.The iW1760 also incorporates a unique proprietary quasi-resonant switching scheme that achieves valley-mode turn-on for every PWM/PFM switching cycle, in all PFM and PWM modes and in both CV and CC operations. This unique feature greatly reduces the switching loss and dv/dt across the entire operating range of the power supply. Due to the nature of quasi-resonant switching, the actual switching frequency can vary slightly cycle by cycle, providing the additional benefit of reducing EMI. These innovative digital control architecture and algorithms enable the iW1760 to achieve the highest overall efficiency and lowest EMI,9.7 Less Than 50mW No-Load Power with Fast Load Transient ResponseThe iW1760 features a distinctive DDPWM control inno-load conditions to help achieve ultra-low no-loadpower consumption (< 50mW for typical 20W and aboveapplications) and meanwhile to ensure fast dynamic load response. The power supply system designs including thepre-load resistor selection should ensure the power supply can operate in the DDPWM mode under the steady-stateno-load condition. If the pre-load resistor is too small, theno-load power consumption increases; on the other hand,if it is too large, the output voltage may increase and evencause over-voltage since the switching frequency is fixed at around 1.9kHz. For typical designs, the pre-load resistor isin the range of 8k W to 10k W .In addition to using pre-load resistor, the iW1760 employsa few other features to bring down no-load power consumption. First, the iW1760 implements an intelligent low-power management technique that achieves ultra-low chip operating current at no-load, typically less than 350µA. Second, a low UVLO threshold of 6.5V (typical) enables the power supply system design to have a low V CC voltage at the no-load operation in order to minimize the no-load power. In addition, the active start-up scheme with depletion mode N-FET eliminates the start-up resistor power consumption after the ENABLE signal becomes active.These features combined ensure the lowest system cost power suppliesbuilt with the iW1760 can achieve less than 50 mW no-load power consumption at 230V AC input, and very tight constant voltage and constant current regulation over the entire operating range in typical 20W and above compact adapter/charger applications.While achieving ultra-low no-load power consumption, the iW1760 implements innovative proprietary digital control technology to intelligently detect any load transient events,and achieve fast dynamic load response for both one-time and repetitive load transients. In particular, for load transients that are demanded in some applications from no-load to full-load, the iW1760 can still maintain a fast enough response to meet the most stringent requirements, with the no-load operating frequency designed at around 1.9kHz.9.8 Variable Frequency Operation Mode In each of the switching cycles, the falling edge of V SENSE is checked. If the falling edge of V SENSE is not detected, the off-time is extended until the falling edge of V SENSE is detected. The maximum allowed transformer reset time is 125μs. When the transformer reset time reaches 125μs, the 9.9 Internal Loop CompensationThe iW1760 incorporates an internal Digital Error Amplifier with no requirement for external loop compensation. For atypical power supply design, the loop stability is guaranteedto provide at least 45 degrees of phase margin and -20dB ofgain margin.9.10 Voltage Protection FeaturesThe secondary maximum output DC voltage is limited by theiW1760. When the V SENSE signal exceeds the output OVPthreshold at point 1 indicated in Figure 9.3, the iW1760 shutsdown.For this V SENSE -based OVP , latch function is available byproduct options given in Section 11.0.The iW1760 protects against input line under-voltageby setting a maximum t ON time. Since output power is proportional to the squared V IN t ON product, then for a given output power, as V IN decreases the t ON increases. Thus by knowing when the maximum t ON time occurs the iW1760detects that the minimum V IN is reached, and shuts down.The maximum t ON limit is set to 15.5μs. Also, the iW1760 monitors the voltage on the V CC pin and when the voltage on this pin is below UVLO threshold the IC shuts down immediately. When any of these faults are met the IC remains biased to discharge the V CC supply. Once V CC drops below UVLO threshold, the controller resets itself and then initiates anew soft-start cycle. The controller continues attemptingstart-up until the fault condition is removed. For the latched OVP version, the controller can only start up when the faultis removed and input is unplugged to allow V CC to drop 2.0V below UVLO threshold. 9.11 PCL, OCP and SRS Protection Peak-current limit (PCL), over-current protection (OCP) and sense-resistor-short protection (SRSP) are features built into the iW1760. With the I SENSE pin the iW1760 is able to monitor the peak primary current. This allows forcycle-by-cycle peak current control and limit. When the peakprimary current multiplied by the I SENSE resistor is greaterthan 1.15V, over-current is detected and the IC immediatelyturns off the gate driver until the next cycle. The output driver sends out a switching pulse in the following cycle, and the switching pulse continues if the OCP threshold is not reached; or, the switching pulse turns off again if the OCP threshold is reached. If the OCP occurs for severalIf the I SENSE resistor is shorted, there is a potential danger that over-current condition may not be detected. Thus, the IC is designed to detect this sense-resistor-short fault after start-up and shut down immediately. The V CC is discharged since the IC remains biased. Once V CC drops below the UVLO threshold, the controller resets itself and then initiates a new soft-start cycle. The controller continues attempting to start up, but does not fully start up until the fault condition is removed.9.12 CDC ConfigurationThe iW1760 incorporates an innovative approach to allow users to configure cable drop compensation (CDC) externally. This configuration is only performed once at the beginning of start-up. It is completed after the initial OTP check but before the soft-start commences. During the CDC configuration, the internal digital control block senses the external resistance value between the CFG pin and ground, and then sets a corresponding CDC level to allow the device to compensate for IR drop in the secondary circuitry during normal operation.Figure 3.1 shows a simple circuit to set CDC level by connecting a resistor, R CDC , from the CFG pin to ground. The iW1760 provides five levels of CDC configurations: 0, 75mV, 150mV, 300mV, and 450mV, which refer to 5V nominal output voltage. T able 9.1 below shows the resistance range for each of the five CDC levels. In practice, it is recommended to select resistance in the middle of the range wherever possible.The “Cable Comp” specified in Table 9.1 refers to the voltage increment at PCB end from no-load to full-load conditions in the CV mode, with the assumption that the secondary diode voltage drop can be ignored at the point when the secondary voltage is sensed. Also, the “Cable Comp” is specified based on the nominal output voltage of 5V. For different output voltage, the actual voltage increment needs to be scaled accordingly. For example, for 12V, the correspondingfive levels of CDC configurations would be: 0, 180mV, 360 mV, 720mV, and 1080mV.To calculate the amount of cable compensation needed, take the resistance of the cable and connector and multiply it by the maximum output current.For each of the CDC levels, the internal V SENSE -based OVP thresholds are different. Table 9.1 also lists the typical OVP thresholds for each CDC level.9.13 External CFG-Based OVPIn the iW1760, the CFG pin can also be used to provide the external over-voltage protection (OVP) besides fulfilling the CDC configuration. This external CFG-based OVP serves as a supplemental or extra protection in addition to the V SENSE -based OVP . The circuit implementation can be found in Figure 9.5, where two resistors R1 and R2 form a voltage divider to sense output voltage via auxiliary winding, with the tapping point connected to the CFG pin. During the CDC configuration the iW1760 does not send out any drive signal at OUTPUT pin, and the switch Q1 remains in the off state. The resistors R1 and R2 are essentially connected in parallel since the bias winding is virtually shorted. Consequently, the paralleled resistance of R1 and R2 sets the CDC level. Meanwhile, during normal operation, the CFG pin reflects output voltage in real-time, in the similar fashion as the V SENSE does at point 1 in Figure 9.3. The ratio of R1 to R2 sets the external OVP threshold.The resistance values for the resistor divider, R1 and R2, can be derived as follows.First, for the given CDC level, the paralleled resistance of R1 and R2 should be within the range listed in Table 9.1:1CDC R R =×2R 1R +2R CDC Level 12345R CDC Range (kΩ)0 ~ 2.202.37 ~3.213.40 ~4.644.87 ~ 6.656.98 ~ X*Cable Comp (mV)0751********V SENSE -based OVP Threshold (V)1.8381.8611.8841.9301.976* The resistance can be as high as 100kΩ, provided CFG pin does not float, which causes device to shut down.Table 9.1: Recommended resistance range and corresponding CDC levels for 5 V output(9.6)Second, during normal operation the voltage divider, R1 and R2, sets the desired OVP threshold:AUXN >= ×OVP V SECN +()×()2R 2R 1R SD-TH(R)V where N AUX is the number of turns for the bias winding, N SEC is the number of turns for the secondary winding, V OVP is the desired OVP tripping point, and V SD-TH(R) is the internal comparator threshold (1.015V typically) for OVP detection.The combination of Equations (9.6) and (9.7) leads to 1R = CDC R ×OVP V AUX N ×SEC N ()2R = CDCR 1R ×()−1R CDCR SD-TH(R)V ()It is recommended the R CDC value is taken as the median value of the resistance range as given in Table 9.1, and R1 and R2 can then be readily derived from Equation (9.8).It should be noted when the CFG pin is used to provide external OVP , an additional constraint is applied to the resistance range given in Table 9.1. This is because for the OVP configuration in Figure 9.5, a large negative voltage may occur to the auxiliary winding (V X in Figure 9.5) during the switch on-time, which can cause a negative current flowing out of the CFG pin. Care needs to be taken to ensureR1 and R2 are large enough, so that the resulting negative current is less than the maximum allowed current, specified in Section 5.0.9.14 External OTPThe iW1760 can be configured to provide externalover-temperature protection (OTP) by connecting a Negative-Temperature-Coefficient (NTC) resistor from SD pin to GND. Internally, a 100μA current source is injected to the SD pin, which generates a voltage proportionalto the NTC resistance. At high ambient temperatures,the NTC resistance becomes low, which results in a lowvoltage at the SD pin. If the SD pin voltage drops below an internally-set threshold, then the OTP is triggered, and theiW1760 shuts down. In the iW1760, the external OTP has a built-in hysteresisby having two thresholds. Before start-up, the OTP is triggered if the SD pin voltage is less than 1.2V; otherwise the device begins the CDC configuration (See Section 9.12), then followed by a normal soft-start process. During normaloperation, the OTP threshold is switched to 1.0V, and the device only shuts down when the SD pin voltage is less than 1.0V.During normal operation, the external OVP and OTP detections alternate every eight cycles. In the eight-cycle duration of OVP detection, the voltage at the CFG pin is fed into the internal comparator’s non-inverting input. If the voltage of this pin is above 1.015V at the instant corresponding to point 1 (as indicated in Figure 9.3) for several consecutive cycles, then OVP is triggered. Contrarily, in the external OTPL NV OUT RTNFigure 9.5: Typical Application Circuit with CDC, OVP and OTP Implemented(9.7)(9.8)。
buck pwm ton原理Buck PWM (Pulse Width Modulation) ton principle refers to the operation of a buck converter, which is a type of DC-DC converter widely used for voltage step-down purposes.In a buck converter, the input voltage is applied to a switch (usually a transistor) that is capable of turning on and off rapidly. The output voltage is derived from the input voltage by controlling the switch's on and off time, achieved through PWM.The principle of operation can be understood as follows:1. When the switch is turned on:- The input voltage is connected directly to the load through the switch, allowing current to flow.- As a result, energy is stored in the inductor connected in series with the load.2. When the switch is turned off:- The inductor releases the stored energy to the load, causing the output voltage to be maintained.- The amount of energy released is determined by the switch's off time.By adjusting the switch's on time (Ton) and off time (Toff) using PWM control, the average voltage across the load can be controlled. This is done by varying the duty cycle, which is the ratio of Ton to the total time duration of switching cycle (Ton + Toff).A higher duty cycle (Ton/(Ton+Toff)) will result in a higher average voltage across the load, while a lower duty cycle will result in a lower average voltage.Overall, the buck PWM ton principle enables precise control of the output voltage by regulating the switch's on and off time through PWM, allowing for efficient voltage step-down conversion.。
双向dshot原理双向DShot(Bidirectional DShot)是一种高级的无人机电机控制协议,用于对无刷直流电机(BLDC)进行精确、实时且具有反馈能力的控制。
相较于传统的单向PWM信号控制方式,DShot协议提供了更高的通信速率和更精确的数据传输,从而实现更好的电机响应性能。
基本原理:1.单向DShot:最初版本的DShot是一种数字脉冲宽度调制(Digital Pulse Width Modulation, DPWM)技术,通过快速串行数据流的方式发送给电调(ESC),包含电机所需的转速信息,其优点在于提高了速度和精度,降低了噪声干扰。
2.双向DShot:o双向DShot在此基础上增加了从电调到飞控的反馈通道,允许电调将自身的状态信息如温度、电压、电流以及实际转速等数据实时传回给飞行控制器。
o它使用同一根信号线进行双向通信,通常采用时分复用技术,即在特定的时间窗口内进行数据传输和接收,以避免冲突。
o在硬件层面上,双向DShot可能利用了某种形式的握手协议或编码方案来确保数据完整性并避免错误。
优势与应用:•实现精准的闭环控制,比如PID调节更加准确,因为可以实时获取电机的实际工作状态。
•提高系统的安全性和可靠性,例如,当检测到过热或其他异常情况时,可以立即通知飞行控制器采取措施。
•有助于调试和优化飞行器性能,通过对电机运行数据的实时监控和分析,可进一步提升飞行效率和操控体验。
双向DShot协议在实际应用中,其具体工作流程如下:1.发送阶段:o飞控(Flight Controller, FC)将电机速度指令以及其他可能的控制信息编码为数字信号,并按照DShot协议的格式通过信号线发送给电子调速器(ESC)。
o由于是双向通信,数据帧通常包含地址、命令和校验码等部分,以确保正确无误地识别接收方并保证数据完整性。
2.接收与执行阶段:o ESC接收到指令后,解析数据包并根据指令调整电机PWM输出,实现对电机转速的精确控制。
ADC模块学习资料1、ADC模块的结构采用逐次逼近法计算,从最高有效位开始转换。
包含两个独立的内核:ADC0和ADC1,这两个内核可以独自或同步运行。
模块特点:--模拟供电电源V DDM:3.3V—5V--输入转换电压范围:0V--V DDM--最多16路模拟输入通道--一个标准的参考输入V AREF和一个可替代的参考输入CH0每一个ADC内核包含如下模块:模数转换器、转换控制单元、请求控制单元、结果处理单元和中断产生单元。
转换请求单元:包含5个独立的请求源,用来触发AD转换的开始。
可以通过不同的事件触发这5个请求源。
所以,同一时间内,可能会有两个或多个请求源挂起。
这就需要仲裁模块来裁决。
请求源0(1阶连续源):请求源1和3(16通道扫描源):请求源2和4(4阶连续源):2、ADC模块的工作原理时钟原理:模拟时钟f ADCI 用作内部时钟,定义转换精度和采样事件,通过GLOBCTR.DIVA来设定。
数字时钟f ADCD用作仲裁时钟,定义仲裁循环的持续时间。
通过GLOBCTR.DIVD来设定。
2.1、扫描请求源的处理一个扫描请求源能够为多达16个输入通道的序列产生转换请求。
每次都从序号最高的通道开始转换。
一个扫描请求源执行以下操作:转换请求控制:定义那个模拟输入通道参加扫描转换,通过CRCR1, CRCR3设定。
转换请求挂起、转换请求处理、请求源仲裁和Trigger and gating信号处理。
2.2、顺序请求源的处理已经编程好的序列存储在一个队列缓冲器中(FIFO)2.3、转换结果的处理包含转换结果的存储、Wait-for-read模式、结果事件中断、结果FIFO缓冲器和数据精简滤波器。
转换结果的存储:根据不同的转换结果处理机理,转换结果可以用不同的方式表示:禁止数据精简滤波器时:转换结果最多12位宽度,最高位一直处于11的位置,其他没有用的的低位用0填补。
使能数据精简滤波器时:转换结果最多12位宽度,最高位一直处于11的位置,其他没有用的的低位用0填补。
影响adc高低温性能1.ENOB是ADC的转换有效位数,由于ADC做不到完全线性转化,总是会有一些精度损失,从而影响ADC的分辨率,降低ADC的转换位。
需要注意区分ENOB和有效分辨率。
在我测试数据中,发现频率的高低和温度都会影响ENOB 。
频率越高,ENOB会下降:频率越高,拥有的底噪就有越高,从而影响性能。
低温也会影响:在做-40低温测试时,ENOB整体比常温下有低零点几个bit。
2.SFDR:无杂散动态范围。
说的通俗点就是,输入信号经过傅里叶变换,可以得到基波和谐波信号,而SFDR就是基波信号和第二谐波信号之间的功率差,如图1中所示,其中F就是基波信号功率,S是第二基波信号。
蓝色区域就是SFDR,可以看的出来,SFDR=F-S。
当然谐波有很多,但是第二谐波的影响比较大。
SFDR不仅受谐波的影响,还会受底噪的影响,低噪的比较杂乱,但是一般都会在一个动态范围类,比图中的低噪平均在-100db左右,如果低噪整体功率比较大,就会造成第二谐波的提高,从而导致SFDR降低。
当SFDR数值不满意时,可以先先看看低噪和S的是否异常,最大功率是否太低,归一化幅度是否满幅度。
然后分析是算法问题,还是输入信号的质量不够,是否要适当的提高输入信号的功率。
在查看ADC数据手册时,SFDR会受到温度的影响,当温度过低时,会导致ADC的供电端口电压降低,导致整体性能减低。
这点不知道是芯片本身问题还是外搭电路在低温下受到影响导致的。
3.下部分就是信号经过傅里叶变换后的时域频率,正常的信号是有规律,连续性,无杂乱点的。
如果发现点比较杂乱,需要检测下输入信号的质量。
4.归一化的幅度以及最大功率在同一个频率点时应该是差不多不大的,如果发现相差比较大时,说明整体系统某部分出现问题,需要排查。
目前这问题还没发现出现在什么原因,等分析完数据,再补充。
IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries(TI)reserve the right to make corrections,modifications,enhancements, improvements,and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty.Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty.Except where mandated by government requirements,testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design.Customers are responsible for their products and applications using TI components.To minimize the risks associated with customer products and applications,customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license,either express or implied,is granted under any TI patent right,copyright,mask work right,or other TI intellectual property right relating to any combination,machine,or process in which TI products or services are rmation published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement e of such information may require a license from a third party under the patents or other intellectual property of the third party,or a license from TI under the patents or other intellectual property of TI. Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties,conditions,limitations,and notices.Reproduction of this information with alteration is an unfair and deceptive business practice.TI is not responsible or liable for such altered documentation.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.TI products are not authorized for use in safety-critical applications(such as life support)where a failure of the TI product would reasonably be expected to cause severe personal injury or death,unless officers of the parties have executed an agreement specifically governing such use.Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications,and acknowledge and agree that they are solely responsible for all legal,regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications,notwithstanding any applications-related information or support that may be provided by TI.Further,Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or"enhanced plastic."Only products designated by TI as military-grade meet military specifications.Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer's risk,and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS16949requirements.Buyers acknowledge and agree that,if they use anynon-designated products in automotive applications,TI will not be responsible for any failure to meet such requirements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions:Products ApplicationsAmplifiers AudioData Converters AutomotiveDSP BroadbandInterface Digital ControlLogic MilitaryPower Mgmt Optical NetworkingMicrocontrollers SecurityLow Power TelephonyWirelessVideo&ImagingWirelessMailing Address:Texas Instruments,Post Office Box655303,Dallas,Texas75265Copyright©2007,Texas Instruments IncorporatedPACKAGING INFORMATIONOrderable Device Status(1)PackageType PackageDrawingPins PackageQtyEco Plan(2)Lead/Ball Finish MSL Peak Temp(3)SN65ALS176D ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN65ALS176DE4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN65ALS176DG4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN65ALS176DR ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN65ALS176DRE4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN65ALS176DRG4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIM SN65ALS176P OBSOLETE PDIP P8TBD Call TI Call TISN75ALS176AD ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176ADE4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176ADG4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176ADR ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176ADRE4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176ADRG4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176AP ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg TypeSN75ALS176APE4ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg TypeSN75ALS176BD ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BDE4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BDG4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BDR ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BDRE4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BDRG4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176BP ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg TypeSN75ALS176BPE4ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg TypeSN75ALS176D ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176DE4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMOrderable Device Status(1)PackageType PackageDrawingPins PackageQtyEco Plan(2)Lead/Ball Finish MSL Peak Temp(3)SN75ALS176DG4ACTIVE SOIC D875Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176DR ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176DRE4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176DRG4ACTIVE SOIC D82500Green(RoHS&no Sb/Br)CU NIPDAU Level-1-260C-UNLIMSN75ALS176P ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg TypeSN75ALS176PE4ACTIVE PDIP P850Pb-Free(RoHS)CU NIPDAU N/A for Pkg Type(1)The marketing status values are defined as follows:ACTIVE:Product device recommended for new designs.LIFEBUY:TI has announced that the device will be discontinued,and a lifetime-buy period is in effect.NRND:Not recommended for new designs.Device is in production to support existing customers,but TI does not recommend using this part in a new design.PREVIEW:Device has been announced but is not in production.Samples may or may not be available.OBSOLETE:TI has discontinued the production of the device.(2)Eco Plan-The planned eco-friendly classification:Pb-Free(RoHS),Pb-Free(RoHS Exempt),or Green(RoHS&no Sb/Br)-please check /productcontent for the latest availability information and additional product content details.TBD:The Pb-Free/Green conversion plan has not been defined.Pb-Free(RoHS):TI's terms"Lead-Free"or"Pb-Free"mean semiconductor products that are compatible with the current RoHS requirements for all6substances,including the requirement that lead not exceed0.1%by weight in homogeneous materials.Where designed to be soldered at high temperatures,TI Pb-Free products are suitable for use in specified lead-free processes.Pb-Free(RoHS Exempt):This component has a RoHS exemption for either1)lead-based flip-chip solder bumps used between the die and package,or2)lead-based die adhesive used between the die and leadframe.The component is otherwise considered Pb-Free(RoHS compatible)as defined above.Green(RoHS&no Sb/Br):TI defines"Green"to mean Pb-Free(RoHS compatible),and free of Bromine(Br)and Antimony(Sb)based flame retardants(Br or Sb do not exceed0.1%by weight in homogeneous material)(3)MSL,Peak Temp.--The Moisture Sensitivity Level rating according to the JEDEC industry standard classifications,and peak solder temperature.Important Information and Disclaimer:The information provided on this page represents TI's knowledge and belief as of the date that it is provided.TI bases its knowledge and belief on information provided by third parties,and makes no representation or warranty as to the accuracy of such information.Efforts are underway to better integrate information from third parties.TI has taken and continues to take reasonable steps to provide representative and accurate information but may not have conducted destructive testing or chemical analysis on incoming materials and chemicals.TI and TI suppliers consider certain information to be proprietary,and thus CAS numbers and other limited information may not be available for release.In no event shall TI's liability arising out of such information exceed the total purchase price of the TI part(s)at issue in this document sold by TI to Customer on an annual basis.TAPE AND REEL BOX INFORMATIONDevice Package Pins SiteReel Diameter (mm)Reel Width (mm)A0(mm)B0(mm)K0(mm)P1(mm)W (mm)Pin1Quadrant SN65ALS176DR D 8SITE 2733012 6.4 5.2 2.1812Q1SN75ALS176ADR D 8SITE 2733012 6.4 5.2 2.1812Q1SN75ALS176BDR D 8SITE 2733012 6.4 5.2 2.1812Q1SN75ALS176DRD8SITE 27330126.45.22.1812Q1Device Package Pins Site Length(mm)Width(mm)Height(mm) SN65ALS176DR D8SITE27342.9336.620.64 SN75ALS176ADR D8SITE27342.9336.620.64 SN75ALS176BDR D8SITE27342.9336.620.64 SN75ALS176DR D8SITE27342.9336.620.64IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries(TI)reserve the right to make corrections,modifications,enhancements, improvements,and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty.Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty.Except where mandated by government requirements,testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design.Customers are responsible for their products and applications using TI components.To minimize the risks associated with customer products and applications,customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license,either express or implied,is granted under any TI patent right,copyright,mask work right,or other TI intellectual property right relating to any combination,machine,or process in which TI products or services are rmation published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement e of such information may require a license from a third party under the patents or other intellectual property of the third party,or a license from TI under the patents or other intellectual property of TI. Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties,conditions,limitations,and notices.Reproduction of this information with alteration is an unfair and deceptive business practice.TI is not responsible or liable for such altered rmation of third parties may be subject to additional restrictions.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice.TI is not responsible or liable for any such statements.TI products are not authorized for use in safety-critical applications(such as life support)where a failure of the TI product would reasonably be expected to cause severe personal injury or death,unless officers of the parties have executed an agreement specifically governing such use.Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications,and acknowledge and agree that they are solely responsible for all legal,regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications,notwithstanding any applications-related information or support that may be provided by TI.Further,Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications.TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or"enhanced plastic."Only products designated by TI as military-grade meet military specifications.Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer's risk,and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use.TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS16949requirements.Buyers acknowledge and agree that,if they use anynon-designated products in automotive applications,TI will not be responsible for any failure to meet such requirements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions:Products ApplicationsAmplifiers AudioData Converters AutomotiveDSP BroadbandInterface Digital ControlLogic MilitaryPower Mgmt Optical NetworkingMicrocontrollers SecurityRFID TelephonyLow Power Video&ImagingWirelessWirelessMailing Address:Texas Instruments,Post Office Box655303,Dallas,Texas75265Copyright©2007,Texas Instruments Incorporated。
HT68FB571 LED PWM Function Application DescriptionD/N: AN0503EIntroductionThe Holtek HT68FB571 USB Flash LED MCU, which is specially designed for singlecolour LED Gaming Keyboard applications, can simultaneously interface up to 128 singlecolour LEDs by using a matrix scanning method. The integrated 8-bit PWM functions canbe used for finely tuning LED brightness. The I/Os, which are equipped with directlydriving LED capacity, save the added cost of additional external transistors. In addition,the device also offers a high scanning frame update rate of 1.5kHz. The key pins of theauto key scan function are pin-shared with the LED PWM function pins thus greatlyreducing the MCU package pin number which leads to reduced product development timeand cost. This document gives a description of the related registers and operationprocedures for the HT68FB571 LED PWM function to assist users in developing theirproducts.Functional DescriptionThe Holtek HT68FB571 USB Flash LED MCU provides users with a set of LED PWMrelated registers including four LED PWM function enable control registers LMnCE(x=0~3), four LED PWM control registers and twenty auto key scan data registersKEYDATAx (x=0~19). Additionally, an LED PWM dedicated data memory is provided forLED auto scan data storage. In the functional description section, a description of theLED PWM architecture is provided along with descriptions for the control registers, LEDPWM auto mode operation, manual mode operation, LED PWM waveforms andhardware circuits.LED PWM Architecture DescriptionThe HT68FB571 LED PWM functional architecture is composed of four LED PWMmodules, an LED PWM dedicated RAM, a register transfer unit and an LED COM outputunit. The LED PWM function block diagram is shown in the following figure. Here n=0~3,m=0~15, x=0~19.For each LED PWM module, there are two PWM control circuits, namely PWM A and PWM B. The PWM A outputs correspond to LEDSEG2n while the PWM B outputs correspond to LEDSEG(2n+1), where n is the selected module number. The device provides up to 8 groups of 8-bit PWM outputs. The PWM operating frequency, which can be 6MHz, 12MHz, 16MHz or other values is selected using the PWMCK[2:0] bits that is bit 4 ~ bit 2 of the PWMCTL0 register.The LEDCOM output unit is used to generate the external LEDCOMm enable control signals. By using a matrix scanning method combined with LEDSEG outputs, the device can implement up to (m+1)×(n+1)×2 LED applications.The LED PWM dedicated data memory, which is known as the LED RAM, has a capacity of 128 bytes and is located at 80H~FFH in RAM Sector 4. During the LED PWM auto scan period, the device can read out the PWM data from the LED RAM and then output the corresponding PWM duty cycle.To implement the auto key scan function, firstly the rows to be automatically scanned should be selected using the KEYSR4~0 (PWMCTL1 bit 7~3) bits. The columns that will be automatically scanned are KEYC7~KEYC0 and their corresponding pin-shared function should be setup correctly using the PDS0[7:0] and PDS1[7:0] bits. Then the scan result data can be read out from the KEYDATA x~0 registers. The corresponding waveforms for the automatic LED scan and Key scan will be explained in detail in the following chapters.The LED PWM function also provides two interrupts, LEDINT and SCANINT, which are helpful during program design. When completing a frame of data, i.e. (m+1)×2(n+1) LEDSEG signals have been scanned, an LEDINT interrupt signal will be generated. When a key scan frame is completed, the SCANINT interrupt signal will be generated.KSCE & LDCOM[3:0]f f f f (f (f (f f KEYC0LED PWM ArchitectureLED PWM Function Control Register DescriptionThe HT68FB571 LED PWM function includes an LED PWM control function and an auto scan function.The LED PWM function can operate in two modes, manual mode and automatic mode, which are selected and configured by the PWMCTL0, PWMCTL1, PWMCTL2, PWMCTL3 and PWMCTL4 control registers.In the manual mode, the value in the LMnCAR and LMnCBR registers are used to control the PWM duty outputs.In the automatic mode, using the pre-stored data in the LED PWM dedicated data memory in Sector 4, the required duty PWM outputs will be generated by the hardware. The LMnCE register is used to disable the corresponding LED PWM output to turn the LED off.The HT68FB571 LED PWM control and auto key scan related registers are listed in the following table. Refer to the HT68FB571 datasheet for more details.Register NameBit7 6 5 4 3 2 1 0LMnCE — — — — — — MnCBE MnCAE LMnCAR MnCAD7 MnCAD6 MnCAD5 MnCAD4 MnCAD3 MnCAD2 MnCAD1 MnCAD0 LMnCBR MnCBD7 MnCBD6 MnCBD5 MnCBD4 MnCBD3 MnCBD2 MnCBD1 MnCBD0 PWMCTL0 PWMN2 PWMN1 PWMN0 PWMCK2 PWMCK1 PWMCK0 — LDCOME PWMCTL1 KEYSR4 KEYSR3 KEYSR2 KEYSR1 KEYSR0 PWMGE PHRC KSCE PWMCTL2 TDELAY3 TDELAY2 TDELAY1 TDELAY0 TPHRE1 TPHRE0 COMDIR SEGDIR PWMCTL3 COMRD3 COMRD2 COMRD1 COMRD0 LDCOM3 LDCOM2 LDCOM1 LDCOM0 PWMCTL4 — — — — — RAMCK2 RAMCK1 RAMCK0 KEYDATAx D7 D6 D5 D4 D3 D2 D1 D0 LED PWM Control and Auto Key Scan Register List - n=0~3, x=0~19LED PWM Auto Mode and Auto Key Scan OperationOperating in the LED PWM Auto Mode, the registers which include LMnCE, PWMCTL0, PWMCTL1, PWMCTL2, PWMCTL3, PWMCTL4 and KEYDATAx and an LED PWM dedicated data memory of 128 bytes will be used to control the PWM signal output. The control flowcharts are shown below.The number of used LED COM outputs is determined by the LDCOM[3:0] (PWMCTL3 bit 3~0) bits. The selected COM ports must use continuous numbers starting from COM0. For example, if five COM outputs are needed, then they must be output from the COM0 ~ COM4 ports. Additionally the corresponding pin-shared pins should be selected as LEDCOM functions. For example, if the LEDCOM0 pin function is to be used, the PAS1[1:0] bits should be set to 11 to select the PA4 pin function as the LEDCOM0 first. Then setup the LED COM output polarity to be active low or active high using the COMDIR (PWMCTL2 bit 1) bit according to the actual circuit.If using the LEDSEG function, the corresponding pin function should be selected as LEDSEG. For example, if the LEDSEG4 pin function is to be used, the PFS1[1:0] bits should be set to 11 to select the PF4 pin function as the LEDSEG4 first. Then set the LED SEG output polarity to be active high or active low using the SEGDIR (PWMCTL2 bit 0).Users can write their required duty data into the LED RAM. The hardware will generate the LEDINT interrupt signal when the data in the last address has been processed and then restart the data process from the first address of the LED RAM.The following content will illustrate the data format in the LED PWM dedicated data memory along with the PWM duty cycle.LED PWM Output & Auto Key Scan Control Flow ChartFlowchart DescriptionSTEP1: (1) Configure the PWM clock source frequency by setting the PWMCK[2:0] bits(2) Configure the pin-shared control registers to select the LEDCOM/KEYR &LEDSEG function.STEP2: (1) Configure how many LED COM outputs are used using the LDCOM[3:0] bits(2)Setup the LEDCOM and LEDSEG polarity to be active high or active low(3) Configure the PWM cycle output number of each LEDCOM using thePWMN[2:0] bits - a recommended value is 111, i.e. one PWM output per LEDCOM to obtain the maximum frame update rate.STEP3: If the auto key scan function is to be used(1) Set the KSCE bit to 1(2) Select how many key scan outputs are used by setting the KEYSR[4:0] bits(3) Setup the hardware key scan delay time using the TDELAY [3:0] bits(4) Configure the key scan input port pull-high resistor using the PHRC bitSTEP4: Set both the LDCOME and PWMGE bits high to enable the hardware units for the LED PWM automatic calculation and auto key scan functions.In the automatic mode, the LED PWMs can control the LEDs in a matrix scanning method and generate 2×(n+1) LED PWM SEG and (m+1) COM outputs in total. The LED PWM timing diagram is shown below.An LED frame is a period of time when the hardware outputs are low (if the COMDIR bit is 0) from COM0 to COMm. When COMm is low, the CCO outputs the corresponding PWM duty cycle according to the related register settings and the data in the LED PWM dedicated data memory.LED COM Time SlotLED frame Interrupt request flagEnable the corresponding PWM register and output PWM cycle.About 10us between COM m-1 and COM m for Non-overlap.TLED PWM Timing Diagram - m=15LED PWM Dedicated Memory Data Format DescriptionFor the LED PWM auto mode operation, the device provides a 128-byte LED PWM dedicated data memory, known as the LED RAM, to store the PWM duty data. The LED RAM is located at 80H~FFH in Sector 4 of the Data Memory. The LED RAM is subdivided into 16 columns, namely Column0~Column15. The LED RAM data can be allocated as follows.Start address : RAM Sector 4 [80H]LED RAMBit7~0 : PWM_Cm(A/B)n PWM valueColumn 1Column 0Column 3Column 2Column mLED RAM Allocation - n=0~3, m=0~15In each column, there are 2×(n+1) bytes of data which is arranged using the following rule.PWM Column m: Store LED PWM A and PWM B duty data of the COM m and Module n PWM_CmA0: The PWM A duty value for COMm and Module 0 PWM_CmB0: The PWM B duty value for COMm and Module 0 ::PWM_CmAF: The PWM A duty value for COMm and Module F PWM_CmBF: The PWM B duty value for COMm and Module FLED PWM Manual Mode Operation DescriptionIf the LDCOME (PWMCTL0 bit 3) bit is set to 0, the LED PWM Manual Mode will be enabled and the related registers including LMnCAR / LMnCBR (n=0~3), PWMCTL0, PWMCTL1 and PWMCTL2 should be setup correctly. In the manual mode, users should setup the LED PWM duty value and disable/enable the PWM outputs using the application program. The LEDCOMm and LEDSEGn pin function should also be selected using the corresponding pin-shared function control registers.In the manual mode, the LED PWM dedicated data memory is not used. Some registers only related to the auto mode are unavailable. LED PWM Waveform DescriptionThe PWMN[2:0] (PWMCTL0 bit 7~5) bits are used to configure the number of the LED PWM outputs for each LEDCOM active time. The following example, which is an LED PWM output waveform, shows the relationship between the LEDCOM and LEDSEG outputs. In the following figure, two LED PWM (LEDSEG) cycles are output during each LED COM active output and the LED PWM duty is 5.Ex: Duty Value=5(LED-SEG High active)LEDCOM Output Waveform (each COM=2 PWM perod) (LED-COM Low active)LED PWM Module Output WaveformAuto Key Scan DescriptionThe HT68FB571 provides an auto key scan function, which can be enabled by setting the KSCE bit high. This function is implemented using key scan output ports KEYRm which are shared with the LEDCOMm ports or independent key scan output ports KEYR19 ~ KEYR16. The scanning data can be input through the key scan input ports KEYC0~KEYC7 and then stored in the KEYDATAx register. The auto key scan function related register control bits include KSCE, PHRC, TDELAY[3:0] and KEYSR[4:0] as well as the KEYDATAx register used for scanning input data storage.The auto key scan function which is shared with the LED PWM function is controlled using the KSCE, PHRC, KEYSR[4:0], LDCOM[3:0], TDELAY[3:0] and TPHRE[1:0] bits. The waveforms in different configuration conditions are shown below. Condition (1)KSCE=1; Enable hardware Key Scan functionPHRC=0; Disable hardware Key Scan input port pull high resistor T1=TDELAY3~0KEYSR4~0 (x)=LDCOM3~0(m)LED COMTime Slotrequest flagEnable the corresponding PWM (A/B) register and output PWM (A/B) cycle LED SEGLED SEG offCOMm-1 and COMm for Non-overlap● Condition (2)KSCE=1; Enable hardware Key Scan functionPHRC=0; Disable hardware Key Scan input port pull high resistor KEYSR4~0 (x) < LDCOM3~0(m) T1=TDELAY3~0 Ex. x=m-1LED COM Time SlotLED frame Interrupt request flagEnable the corresponding PWM (A/B) register and output PWM (A/B) cycleLED SEGLED SEG offCOMm-1 and COMm for Non-overlap●Condition (3)KSCE=1; Enable hardware Key Scan functionPHRC=0; Disable hardware Key scan input port pull high resistor KEYSR4~0 (x) > LDCOM3~0(m) T1=TDELAY3~0 Ex. x=m+1LED COM Time SlotLED frame Interrupt request flagEnable the corresponding PWM (A/B) register and output PWM (A/B) cycle LED SEGLED SEG offCOMm-1 and COMm for Non-overlap● Condition (4)KSCE=1; Enable hardware Key Scan functionPHRC=1; Enable hardware Key Scan input port pull high resistor T1=TDELAY3~0; T2=TPHRE1~0 KEYSR4~0 (x)=LDCOM3~0 (m)Enable the corresponding PWM (A/B) register and output PWM (A/B) cycle LED SEG offCOMm-1 and COMm for Non-overlap● Condition (5)KSCE=1; Enable hardware Key Scan functionPHRC=1; Enable hardware Key Scan input port pull high resistor KEYSR4~0 (x) < LDCOM3~0 (m) T1=TDELAY3~0; T2=TPHRE1~0Ex. x=m-1;Enable the corresponding PWM (A/B) register and output PWM (A/B) cycle LED SEG offCOMm-1 and COMm for Non-overlapCondition (6)KSCE=1; Enable hardware Key Scan function;PHRC=1; Enable hardware Key Scan input port pull high resistor control T1=TDELAY3~0; T2=TPHRE1~0 KEYSR4~0 (x) > LDCOM3~0 (m) Ex. x=m+1Enable the corresponding PWM (A/B) register and output PWM (A/B) cycle LED SEG offCOMm-1 and COMm for Non-overlapHardware Circuit DescriptionThe circuits related to implementing the LED PWM and Auto Key Scan include the LEDSEG7~0, LEDCOM15~0, KEYR19~0 and KEYC7~0 pins. As the I/Os can be used to directly drive external LEDs, the circuit can be easily designed without requiring external circuits to drive up to 128 single colour LEDs. The recommended circuit is shown below.Key: 20×8(COMDIR=1, SEGDIR=1)Single Colour LED PWM with Auto Key Scan Application CircuitAlthough the HT68FB571 is mainly for single colour LED applications, it can also be usedfor driving RGB LEDs. The following matrix circuit is recommended for common anodeRGB LED applications. In the dashed box, there is a common anode RGB LED. The devicecan drive up to 40 common anode RGB LEDs.The following matrix circuit is recommended for common cathode RGB LED applications.In the dashed box, there is a common cathode RGB LED. The device can drive up to 32common cathode RGB LEDs.Program Example DescriptionThe HT68FB571 LED PWMs are generated using automatic scanning by the hardware.Users only need to setup the related registers correctly and write the required data intothe LED RAM when using the function. The following gives a simple program example toillustrate how to use the function.#include "HT68FB571.h"__attribute__ ((at(0x480))) //set LED RAM locationstatic volatile unsigned char LEDRAM[128];unsigned char j,k;__attribute__ ((interrupt (0x10))) //enable LED PWM frame interrupt vectorvoid led_int() // update LED RAM{k++ ;for (j=0; j≤128;j++)LEDRAM[j]=k;_edf=0;}void main(){GCC_CLRWDT();i=0 ;j=0 ;k=0;_wdtc=0b01010111; //enable wdt_sledc =0b00001111; //set SEG source max_pac =0b00000000; //set pa for output mode_pbc =0b00000000; //set pb for output mode_pec =0b00000000; //set pe for output mode_pfc =0b00000000; //set pf for output mode_pas1 =0b11111111 ; //set PA7~4 for LEDCOM 3~0_pbs0 =0b11111111 ; //set PA3~0 for LEDCOM 7~4_pes0 =0b11111111 ; //set PE3~0 for LEDCOM 11~8_pes1 =0b11111111 ; //set PE7~4 for LEDCOM 15~12_pfs0 =0b11111111; //set pf3~0 for LEDSEG 3~0_pfs1 =0b11111111; //set pf7~4 for LEDSEG 7~4_pwmctl0 =0b00001001; //LED PWM number, PWM freq, LDCOME_pwmctl1 =0b01111000; //KB scan_out number, PWMGE, PHRC, KSCE_pwmctl2 =0b01100000; //set T1 & T2 COM SEG Dir_pwmctl3 =0b00001111; //LED COM number_pwmctl4 =0b00000001; //RAM freq_ldcome=1; //enable LED hardware COM function_emi=1 ; //enable Global_lede=1; //enable LED hardware LED PWM frame interruptfor (j=0; j≤128;j++)//initial LED RAMLEDRAM[j]=0 ;_pwmge=1; //enable Global LED Hardware functionwhile(1)GCC_CLRWDT();}ConclusionThis application note content has summarised the HT68FB571 LED PWM function usageand provided some usage considerations. When combined with the provided programexample, users can use the LED PWM function more flexibly and develop their productsas rapidly as possible.Reference FilesHT68FB571 Data sheetFor more information, refer to the Holtek official website .Version and Modify InformationDate Author Issue and Revision2018.10.18 Jones Wang First VersionDisclaimerAll information, trademarks, logos, graphics, videos, audio clips, links and other itemsappearing on this website ('Information') are for reference only and is subject to change atany time without prior notice and at the discretion of Holtek Semiconductor Inc.(hereinafter 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensurethe accuracy of the Information on this website, no express or implied warranty is givenby Holtek to the accuracy of the Information. Holtek shall bear no responsibility for anyincorrectness or leakage.Holtek shall not be liable for any damages (including but not limited to computer virus,system problems or data loss) whatsoever arising in using or in connection with the use ofthis website by any party. There may be links in this area, which allow you to visit thewebsites of other companies. These websites are not controlled by Holtek. Holtek willbear no responsibility and no guarantee to whatsoever Information displayed at such sites.Hyperlinks to other websites are at your own risk.Limitation of LiabilityIn no event shall Holtek Limited be liable to any other party for any loss or damagewhatsoever or howsoever caused directly or indirectly in connection with your access toor use of this website, the content thereon or any goods, materials or services.Governing LawThe Disclaimer contained in the website shall be governed by and interpreted inaccordance with the laws of the Republic of China. Users will submit to the non-exclusivejurisdiction of the Republic of China courts.Update of DisclaimerHoltek reserves the right to update the Disclaimer at any time with or without prior notice,all changes are effective immediately upon posting to the website.。