| Electronic Components Datasheet Search |
|
SN8P2743KB Datasheet(PDF) 82 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8P2743KB Datasheet(HTML) 82 Page - SONiX Technology Company |
|
82 / 136 page ![]() SN8P2740 Series ADC, OP-amp, Comparator 8-Bit Micro-Controller SONiX TECHNOLOGY CO., LTD Page 82 Version 2.0 8.3.3 PULSE WIDTH MODULATION (PWM) TC0 timer builds in PWM function controlled by PWM0OUT bit. PWM output pin is shared with GPIO. When PWM0OUT=1, the PWM function is enabled and GPIO pin is switched from GPIO to PWM output status. When PWM0OUT=0, PWM output pin returns to GPIO last status. PWM signal is generated from the result of TC0C, TC0R and TC0D comparison. When PWM0OUT=1 or TC0C counts from 0xFF to 0x00 (overflow), the PWM outputs high status which is the PWM initial status. TC0C is loaded new data from TC0R register to decide PWM cycle and resolution. TC0C keeps counting, and the system compares TC0C and TC0D. When TC0C=TC0D, the PWM output status exchanges to low. TC0C keeps counting. When TC0 timer overflow occurs, and one cycle of PWM signal finishes. TC0C is reloaded from TC0R automatically, and PWM output status exchanges to high for next cycle. TC0D decides the high duty duration, and TC0R decides the resolution and cycle of PWM. TC0R can‟t be larger than TC0D, or the PWM signal is error. The PWM output phase can be selected through TC0DIR bit . When TC0DIR = 0, PWM‟s phase is high pulse and low idle status. When TC0DIR = 1, PWM‟s phase is low pulse and high idle status. TC0R TC0R +1 TC0R +2 TC0C ... TC0D -2 TC0D -1 TC0D PWM Output TC0DIR=0 ... 0xFD 0xFE 0xFF TC0R TC0R +1 TC0R +2 ... Enable TC0 and PWM. TC0C is loaded from TC0R. PWM outputs high status. TC0C = TC0D. PWM exchanges to low status. TC0C overflows from 0xFF to 0x00. TC0C is loaded from TC0R. PWM exchanges to high status. One complete cycle of PWM. Next cycle. PWM Output TC0DIR=1 One complete cycle of PWM. Next cycle. The resolution of PWM is decided by TC0R. TC0R range is from 0x00~0xFF. If TC0R = 0x00, PWM ‟s resolution is 1/256. If TC0R = 0x80, PWM ‟s resolution is 1/128. TC0D controls the high pulse width of PWM for PWM‟s duty. When TC0C = TC0D, PWM output exchanges to low status. TC0D must be greater than TC0R, or the PWM signal keeps low status. When PWM outputs, TC0IRQ still actives as TC0 overflows, and TC0 interrupt function actives as TC0IEN = 1. But strongly recommend be careful to use PWM and TC0 timer together, and make sure both functions work well. The PWM output pin is shared with GPIO and switch to output PWM signal as PWM0OUT=1 automatically. If PWM0OUT bit is cleared to disable PWM, the output pin exchanges to last GPIO mode automatically. It easily to implement carry signal on/off operation, not to control TC0ENB bit. PWM Output TC0DIR=0 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (output low). PWM0OUT=1. PWM0OUT=0. PWM Output TC0DIR=0 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (output high). PWM0OUT=1. PWM0OUT=0. PWM Output TC0DIR=0 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (input). PWM0OUT=1. PWM0OUT=0. High impendence (floating) PWM Output TC0DIR=1 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (output low). PWM0OUT=1. PWM0OUT=0. PWM Output TC0DIR=1 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (output high). PWM0OUT=1. PWM0OUT=0. PWM Output TC0DIR=1 PWM0OUT=1. The pin exchanges to output mode and outputs PWM signal automatically. PWM0OUT=0. The pin exchanges to last GPIO mode (input). PWM0OUT=1. PWM0OUT=0. High impendence (floating) |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |