| Electronic Components Datasheet Search |
|
SN8F5708 Datasheet(PDF) 109 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8F5708 Datasheet(HTML) 109 Page - SONiX Technology Company |
|
109 / 204 page ![]() www.sonix.com.tw SN8F5708 Series Copyright © 2019, SONiX Technology Co., Ltd. PWM Datasheet Rev. 2.4 109 16.5 Sample Code The following sample code demonstrates how to perform PW1/PW2/PW3 with interrupt. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 #define PW1Inv0 (1 << 3) //PWM10 output inverse #define PW1Inv1 (1 << 4) //PWM11 output inverse #define PW1CMP0Tri (1 << 2) //PW1 output Control by Comparator 0 trigger #define PW1CMP1Tri (1 << 3) //PW1 output Control by Comparator 1 trigger #define PW1OnePu (1 << 0) //Enable PW1 pulse output function #define PWM10En (1 << 1) //Enable PWM10 output function #define PWM11En (1 << 2) //Enable PWM11 output function #define PW1En (1 << 5) //Enable PWM1 function #define PW2Inv0 (1 << 3) //PWM20 output inverse #define PW2Inv1 (1 << 4) //PWM21 output inverse #define PW2CMP0Tri (1 << 4) //PW2 output Control by Comparator 0 trigger #define PW2CMP1Tri (1 << 5) //PW2 output Control by Comparator 1 trigger #define PW2OnePu (1 << 0) //Enable PW2 pulse output function #define PWM20En (1 << 1) //Enable PWM20 output function #define PWM21En (1 << 2) //Enable PWM21 output function #define PW2En (1 << 6) //Enable PWM2 function #define PW3Inv0 (1 << 3) //PWM30 output inverse #define PW3Inv1 (1 << 4) //PWM31 output inverse #define PW3CMP0Tri (1 << 6) //PW3 output Control by Comparator 0 trigger #define PW3CMP1Tri (1 << 7) //PW3 output Control by Comparator 1 trigger #define PW3OnePu (1 << 0) //Enable PW3 pulse output function #define PWM30En (1 << 1) //Enable PWM30 output function #define PWM31En (1 << 2) //Enable PWM31 output function #define PW3En (1 << 7) //Enable PWM3 function void InitPWM(void) { // PWM1_Initial PW1YH = 0x80; PW1YL = 0x00; PW1DH = 0x40; PW1DL = 0x00; PW1BH = 0x60; PW1BL = 0x00; PW1A = 0x80; // PWM1 clock = Fosc/32, PW10/11 channel enable PW1M = 0x40 | PWM10En | PWM11En; // PWM2_Initial PW2YH = 0x00; PW2YL = 0x80; PW2DH = 0x00; PW2DL = 0x40; PW2BH = 0x00; PW2BL = 0x60; PW2A = 0x20; // PWM2 clock = Fosc/128, PW20/21 channel enable with inverse PW2M = 0x00 | PW2Inv0 | PW2Inv1 | PWM20En | PWM21En; |
|
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 |