EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 10

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
- ix -
17.5.3 Format ADC Conversion Result ................................................................................................493
17.5.4 ADC converts multiple times to take average automatically .....................................................495
17.5.5 Detect External Voltage or Battery Voltage using ADC 15th Channel ......................................498
17.5.6 Using ADC as Capacitive Sensing Touch Keys ........................................................................501
17.5.7 Key-scan Application Circuit Diagram using ADC ...................................................................514
17.5.8 Reference circuit diagram for detecting negative voltage .........................................................515
17.5.9 The application of common addition circuit in ADC .................................................................516
18 Application of PCA/CCP/PWM ................................................................................................................517
18.1 PCA function pin switch .....................................................................................................................517
18.2 Registers Related to PCA ....................................................................................................................517
18.2.1 PCA control register (CCON) ....................................................................................................518
18.2.2 PCA mode register (CMOD) .....................................................................................................518
18.2.3 PCA counter registers (CL, CH) ................................................................................................518
18.2.4 PCA mode control registers (CCAPMn) ...................................................................................518
18.2.5 PCA capture value/compare value registers (CCAPnL, CCAPnH) ...........................................519
18.2.6 PCA PWM mode control registers (PCA_PWMn)....................................................................519
18.3 PCA Operation Mode ..........................................................................................................................519
18.3.1 Capture Mode ............................................................................................................................520
18.3.2 Software Timer Mode ................................................................................................................520
18.3.3 High Speed Pulse Output Mode ................................................................................................521
18.3.4 Pulse Width Modulation Mode (PWM mode) ...........................................................................521
18.4 Reference Circuit for Implementing 8 ~ 16-bit DAC using CCP / PCA module ................................525
18.5 Example Routines ...............................................................................................................................526
18.5.1 PCA Output PWM (6/7/8/10 bit) ...............................................................................................526
18.5.2 PCA Capture and Measure Pulse Width ....................................................................................529
18.5.3 PCA Implements 16-bit Software Timing .................................................................................533
18.5.4 PCA Output High-speed Pulse ..................................................................................................536
18.5.5 PCA Extends External Interrupt ................................................................................................539
19 Enhanced PWM with 15-bit Accuracy .....................................................................................................543
19.1 Enhanced PWM output function pin switching ..................................................................................543
19.2 Registers Related to PWM ..................................................................................................................544
19.2.1 Enhanced PWM global configuration register (PWMSET) ......................................................545
19.2.2 Enhanced PWM configuration registers (PWMCFG) ...............................................................545
19.2.3 PWM Interrupt Flag Register (PWMIF) ....................................................................................546
19.2.4 PWM Fault Detection Control Register (PWMFDCR) .............................................................546
19.2.5 PWM Counter Registers (PWMCH, PWMCL) .........................................................................547
19.2.6 PWM Clock Selection Register (PWMCKS) ............................................................................547
19.2.7 PWM Trigger ADC counter Registers (PWMTADC) ...............................................................547
19.2.8 PWM Level output setting count value Registers (PWMnT1PWMnT2) ..............................548
19.2.9 PWM Channel Control Registers (PWMnCR) ..........................................................................549
19.2.10 PWM Channel Level Holding Control Registers (PWMnHLD) .............................................549
19.3 Example Routines ...............................................................................................................................550
19.3.1 Output waveforms with arbitrary period and arbitrary duty ......................................................550
19.3.2 Two-channel PWMs realize complementary symmetrical waveform with dead-time control ..553

Table of Contents

Related product manuals