可程式計數陣列 (PCA) 功能使用方法 1 適用產品 :SM59D04G2,SM59D03G2 2 應用說明 : PCA 共有五組, 每組皆可工作於以下七種模式 : 捕獲模式 - 正緣捕獲模式 (Positive edge capture mode) 捕獲模式 - 負緣捕獲模式 (Negative edge capture mode) 捕獲模式 - 正緣及負緣捕獲模式 (Both positive and negative edge capture mode) 計時模式 (Timer mode) 高速時脈輸出模式 (High Speed Output mode) 8 位元脈寬調變模式 (8-bit PWM mode) 16 位元脈寬調變模式 (16-bit PWM mode) 3 PCA Compare/Capture mode 應用說明 3.1 捕獲模式 - 正緣捕獲模式 (Positive edge capture mode): Capture mode 致能時,PCA 16-bit counter 計數暫存器 (CCCH, CCCL) 會不斷的上數, 當 CC0~CC4 pin 輸入外部訊號, 低電位轉換成高電位的訊號將做為捕獲條件, 捕獲時產生中斷, 並且由硬體將 PCA counter 存至捕獲資料暫存器 CCnD[15:0](CCnDH, CCnDL) 圖 : PCA capture mode with positive edge IRFWX-A123 1 Ver. A 2009/03
3.2 捕獲模式 - 負緣捕獲模式 (Negative edge capture mode): 可程式計數陣列功能使用方法 Capture mode 致能時,PCA 16-bit counter 計數暫存器 (CCCH, CCCL) 會不斷的上數, 當 CC0~CC4 pin 輸入外部訊號, 高電位轉換成低電位的訊號將做為捕獲條件, 捕獲時產生中斷, 並且由硬體將 PCA counter 存至捕獲資料暫存器 CCnD[15:0](CCnDH, CCnDL) 圖 : PCA capture mode with negative edge 3.3 捕獲模式 - 正緣及負緣捕獲模式 (Both positive and negative edge capture mode) Capture mode 致能時,PCA 16-bit counter 計數暫存器 (CCCH, CCCL) 會不斷的上數, 當 CC0~CC4 pin 輸入外部訊號, 高電位轉換成低電位, 或由低電位轉換成高電位的訊號將做為捕獲條件, 捕獲時產生中斷, 並且由硬體將 PCA counter 存至捕獲資料暫存器 CCnD[15:0](CCnDH, CCnDL) 圖 : PCA capture mode with both negative and positive edge IRFWX-A123 2 Ver. A 2009/03
3.4 計時模式 (Timer mode) 當該模式致能,PCA 16-bit counter 計數暫存器 (CCCH, CCCL) 會上數, 直到 PCA counter 溢位時, 則會產生中斷. 圖 : PCA Timer mode 3.5 高速時脈輸出模式 (High Speed Output mode) 當高速時脈輸出模式 ( 比較模式 ) 致能, 每當 PCA 16-bit counter 計數暫存器 (CCCH, CCCL) 和資料暫存器 CCnD[15:0] 相同時,CCn pin 則會做反相訊號輸出 圖 : PCA high speed output IRFWX-A123 3 Ver. A 2009/03
3.6 8-bit 脈寬調變模式 (8-bit PWM mode) 3.6.1 8 位元 PWM 僅使用資料暫存器 CCnDL[7:0], 未使用 CCnDH[15:8] 3.6.2 8 位元 PWM 訊號輸出頻率由 bit PCAC2^CCCLK 設定 : CCCLK 6T 12T 00 Fosc/256 (Fosc/2)/256 01 (Fosc/4)/256 (Fosc/8)/256 10 (Fosc/12)/256 (Fosc/24)/256 11 (CCCI pin frequency )/256 (CCCI pin frequency )/256 3.6.3 當使用 8 位元 PCA 之 PWM 功能時需注意如下 : 當 CCnDL=0x00 或 0xFF 時 CCn pin 輸出皆為 low; 當 CCnDL=0x01 時 CCn pin 輸出 low pulse 為 2 個 PWM Input clock; 當 CCnDL=0x02 時 CCn pin 輸出 low pulse 為 3 個 PWM Input clock; 當 CCnDL=0xFE 時 CCn pin 輸出 high pulse 為 1 個 PWM Input clock IRFWX-A123 4 Ver. A 2009/03
3.7 16-bit 脈寬調變模式 (16-bit PWM mode) 3.7.1 16 位元 PWM 使用資料暫存器 CCnDL[7:0] 和 CCnDH[15:8] 3.7.2 16 位元 PWM 訊號輸出頻率由 bit PCAC2^CCCLK 設定 : CCCLK 6T 12T 00 Fosc/65536 (Fosc/2)/65536 01 (Fosc/4)/65536 (Fosc/8)/65536 10 (Fosc/12)/65536 (Fosc/24)/65536 11 (CCCI pin frequency )/65536 (CCCI pin frequency )/65536 3.7.3 當使用 PCA 之 PWM 功能時需注意如下 : 當 CCnD = 0x0000 或 0xFFFF 時 CCn pin 輸出皆為 low; 當 CCnD = 0x0001 時 CCn pin 輸出 low pulse 為 2 個 PWM Input clock; 當 CCnD = 0x0002 時 CCn pin 輸出 low pulse 為 3 個 PWM Input clock; 當 CCnD =0xFFFE 時 CCn pin 輸出 high pulse 為 1 個 PWM Input clock 4 Pin Description 40L PDI P Pin # 44L QFP Pin # 44L PLC C Pin # Symbol I/O Names 3 42 4 P12/CCCI/EEI2 Bit 2 of port 1 & PCA External clock input & EEI i/o /ICP_DATA interrupt 2 & ICP data/command IO 4 43 5 P13/CC0/EEI3 i/o Bit 3 of port 1 & PCA Channel 0 & EEI interrupt 3 5 44 6 P14/CC1/EEI4 i/o Bit 4 of port 1 & PCA Channel 1 & EEI interrupt 4 6 1 7 P15/CC2/EEI5 i/o Bit 5 of port 1 & PCA Channel 2 & EEI interrupt 5 7 2 8 P16/CC3/EEI6 i/o Bit 6 of port 1 & PCA Channel 3 & EEI interrupt 6 8 3 9 P17/CC4/EEI7 i/o Bit 7 of port 1 & PCA Channel 4 & EEI interrupt 7 IRFWX-A123 5 Ver. A 2009/03
5 特殊功能暫存器說明 : Mnemonic Description Direct Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 RESET PCA PCAC1 PCA control register 1 A1h CCR CIDL - CC4IE CC3IE CC2IE CC1IE CC0IE PCAC2 PCA control register 2 A2h CCCLK[1:0] - CC4IF CC3IF CC2IF CC1IF CC0IF PCAH PCA counter high 9Ah PCA[15:8] PCAL PCA counter low 9Bh PCA[7:0] CC0CON CC0 control register A3h - - - TOG0 - CC0MOD[2:0] CC0DH CC0 data high 9Ch CC0D[15:8] CC0DL CC0 data low 9Dh CC0D[7:0] CC1CON CC1 control register A4h - - - TOG1 - CC1MOD[2:0] CC1DH CC1 data high 9Eh CC1D[15:8] CC1DL CC1 data low 9Fh CC1D[7:0] CC2CON CC2 control register A5h - - - TOG2 - CC2MOD[2:0] CC2DH CC2 data high 91h CC2D[15:8] CC2DL CC2 data low 92h CC2D[7:0] CC3CON CC3 control register A6h - - - TOG3 - CC3MOD[2:0] CC3DH CC3 data high 93h CC3D[15:8] CC3DL CC3 data low 94h CC3D[7:0] CC4CON CC4 control register A7h - - - TOG4 - CC4MOD[2:0] CC4DH CC4 data high 95h CC4D[15:8] CC4DL CC4 data low 96h CC4D[7:0] IRFWX-A123 6 Ver. A 2009/03
5.1 PCA 控制暫存器 1(Control register 1) Bit 7 Bit 0 CCR CIDL - CC4IE CC3IE CC2IE CC1IE CC0IE Read/Write - Reset Value 0 0 0 0 0 0 0 0 CCR: PCA Counter Run control bit: CCR =1, 啓動 PCA 計數, 由軟體設定 CCR =0, 停止 PCA 計數, 由軟體設定 CIDL: Counter Idle control: CIDL =1, 進入閒置模式, 但必須要 PCON[0] 同時也被致能為 1 CIDL =0, 離開閒置模式 CCnIE: CC0 ~ CC4 interrupt enable. CCnIE = 1, 中斷致能 CCnIE = 0, 中斷禁能 5.2 PCA 控制暫存器 2(Control register 2) Mnemonic: PCAC2 Address: A2h CCCLK[1:0] - CC4IF CC3IF CC2IF CC1IF CC0IF - CCCLK[1:0] 比較捕獲時脈來源選擇 (Compare/Capture clock source select) CC0CLK[1:0] Clock source 00 Fosc 01 Fosc/4 10 Fosc/12 11 External clock input (CCCI pin) CCCLK 會和 6T 或 12T 有關, 詳細請參考表一 圖一及圖二說明. 相關名詞定義如下 : System clock frequency(f SYS ) = crystal(f CRY ) or oscillator(f OSC ) frequency in 6T, and System clock frequency(f SYS )= crystal(f CRY ) or oscillator(f OSC ) frequency divided by 2 in 12T CCnIF CC0 ~ CC4 中斷旗標 (CC0 ~ CC4 interrupt flag) 當發生中斷時由硬體設置為 1, 必須由軟體清除. IRFWX-A123 7 Ver. A 2009/03
表一 : 計算取樣週期, 以使用 Crystal 16MHz 為範例 Machine Fcry CCCLK[1:0] PCA counter increment Div Sample period(us) cycle (MHz) 6T 16 00 1 system clocks 1 0.0625 6T 16 01 2 system clocks 4 0.25 6T 16 10 12 system clocks 12 0.75 12T 16 00 1 system clocks 2 0.125 12T 16 01 2 system clocks 8 0.5 12T 16 10 12 system clocks 24 1.5 External clock input External clock input 6T/12T 16 11 / (CCCI pin) (CCCI pin) 註 :CCCLK[1:0]=11 時, 取樣週期會依照外部的訊號輸入而定 ; 其它模式取樣週期 (Sample period) = 1 / (Fcry / Div) 圖. PCA clock selection at 6T mode 圖二. PCA clock selection at 12T mode IRFWX-A123 8 Ver. A 2009/03
5.3 PCA 計數暫存器 1(Counter register 1) Mnemonic: PCAH Address: 9Ah PCA[15:8] Mnemonic: PCAL Address: 9Bh PCA[7:0] 5.4 CC0CON (Compare/Capture channel 0 control register) Mnemonic: CC0CON Address: A3h - - - TOG0 - CC0MOD[2:0] - - - - CC0MOD[2:0] 比較 / 捕獲通道 0 模式選擇 (Compare/Capture channel 0 modes select) CC0MOD[2:0] Function 000 Disable PCA channel 0 001 Positive edge capture mode 010 Negative edge capture mode 011 Both positive and negative edge capture mode 100 Timer mode 101 High Speed Output mode 110 8-bit PWM 111 16-bit PWM TOG0: CC0 toggle register. 5.5 CC0 Data register Mnemonic: CC0DH Address: 9Ch CC0D[15:8] Mnemonic: CC0DL Address: 9Dh CC0D[7:0] IRFWX-A123 9 Ver. A 2009/03
5.6 CC1CON (Compare/Capture channel 1 control register) Mnemonic: CC1CON Address: A4h - - - TOG1 - CC1MOD[2:0] - - - - CC1MOD[2:0] 比較 / 捕獲通道 1 模式選擇 (Compare/Capture channel 1 modes select) CC1MOD[2:0] Function 000 Disable PCA channel 1 001 Positive edge capture mode 010 Negative edge capture mode 011 Both positive and negative edge capture mode 100 Timer mode 101 High Speed Output mode 110 8-bit PWM 111 16-bit PWM TOG1: CC1 toggle register. 5.7 CC1 Data register Mnemonic: CC1DH Address: 9Eh CC1D[15:8] Mnemonic: CC1DL Address: 9Fh CC1D[7:0] 5.8 CC2CON (Compare/Capture channel 2 control register) Mnemonic: CC2CON Address: A5h - - - TOG2 - CC2MOD[2:0] - - - - CC2MOD[2:0] 比較 / 捕獲通道 2 模式選擇 (Compare/Capture channel 2 modes select) IRFWX-A123 10 Ver. A 2009/03
CC2MOD[2:0] Function 000 Disable PCA channel 2 001 Positive edge capture mode 010 Negative edge capture mode 011 Both positive and negative edge capture mode 100 Timer mode 101 High Speed Output mode 110 8-bit PWM 111 16-bit PWM TOG2: CC2 toggle register. 5.9 CC2 Data register Mnemonic: CC2DH Address: 91h CC2D[15:8] Mnemonic: CC2DL Address: 92h CC2D[7:0] 5.10 CC3CON (Compare/Capture channel 3 control register) Mnemonic: CC3CON Address: A6h 7 6 5 4 3 2 1 0 Res et - - - TOG3 - CC3MOD[2:0] - - - - CC3MOD[2:0] 比較 / 捕獲通道 3 模式選擇 (Compare/Capture channel 3 modes select) CC3MOD[2:0] Function 000 Disable PCA channel 3 001 Positive edge capture mode 010 Negative edge capture mode 011 Both positive and negative edge capture mode 100 Timer mode 101 High Speed Output mode 110 8-bit PWM IRFWX-A123 11 Ver. A 2009/03
111 16-bit PWM TOG3: CC3 toggle register. 5.11 CC3 Data register Mnemonic: CC3DH Address: 93h CC3D[15:8] Mnemonic: CC3DL Address: 94h CC3D[7:0] 5.12 CC4CON (Compare/Capture channel 4 control register) Mnemonic: CC4CON Address: A7h - - - TOG4 - CC4MOD[2:0] - - - - CC4MOD[2:0] 比較 / 捕獲通道 4 模式選擇 (Compare/Capture channel 4 modes select) CC4MOD[2:0] Function 000 Disable PCA channel 4 001 Positive edge capture mode 010 Negative edge capture mode 011 Both positive and negative edge capture mode 100 Timer mode 101 High Speed Output mode 110 8-bit PWM 111 16-bit PWM TOG4: CC4 toggle register. IRFWX-A123 12 Ver. A 2009/03
5.13 CC4 Data register Mnemonic: CC4DH Address: 95h CC4D[15:8] Mnemonic: CC4DL Address: 96h CC4D[7:0] IRFWX-A123 13 Ver. A 2009/03
6 中斷 (Interrupt) 6.1 中斷向量表 (Interrupt Vector Table): Interrupt Source Interrupt Vector Polling sequence External interrupt 0 0003h Timer 0 000Bh External interrupt 1 0013h Timer 1 001Bh Serial Port 0023h Timer 2 002Bh EEI 0033h PCA interrupt 003Bh 6.2 使用 Keil C 的中斷設定範例程序 : Polling sequence unsigned char CPH,CPL; void init(void) IE = 0x80; IE1= 0x02; // PCAC1[7]=>PCA counter run bit // PCAC1[4]~PCAC1[0] =enable all of CC4 ~ CC0 interrupt PCAC1 = 0x9f; // Clock source = Fosc (note:12t=fosc/2,6t=fosc) PCAC2 = 0x00; void PCA_Capture(void) interrupt 7 //vector 003Bh //user code=================== PCAL = 0x00; PCAH = 0x00; CPH=CC0DH; CPL=CC0DL; //============================ PCAC2 = PCAC2&0xC0; //clear all flag IRFWX-A123 14 Ver. A 2009/03
7 PCA 範例程式及說明 : 7.1 PCA Capture mode 應用的範例程式 : Device:SM59D04G2C25 function generator: f=2khz,t=500us Description Example: P1.3 Negative edge capture mode Crystal: 24MHz/12T, Clock source = Fosc/2, t= 0.0833333us, CC0D= 1743h T*CC0D = 496.25us Crystal: 24MHz/12T, Clock source = Fosc/8, t= 0.3333333us, CC0D= 05DFh T*CC0D = 500.9us Crystal: 24MHz/12T, Clock source = Fosc/24, t= 1us, CC0D= 01EEh T*CC0D = 496us Main program //==================================================================== // // S Y N C M O S T E C H N O L O G Y // //==================================================================== #include "sfr.h" //#include <reg51.h> unsigned int j = 0; unsigned char CPH,CPL; void init(void) P0 = 0xff; P1 = 0xff; P2 = 0xff; P3 = 0xff; //EA = 1; IE = 0x80; IE1= 0x02; // PCAC1[7]=>PCA counter run bit // PCAC1[4]~PCAC1[0] =enable all of CC4 ~ CC0 interrupt PCAC1 = 0x9f; //Clock source = Fosc (note:12t=fosc/2,6t=fosc) //PCAC2 = 0x00; //Clock source = Fosc/4 (note:12t=fosc/8,6t=fosc/4) //PCAC2 = 0x40; //Clock source = Fosc/12 (note:12t=fosc/24,6t=fosc/12) PCAC2 = 0x80; //Clock source = External clockc (note:ccci pin) //PCAC2 = 0xc0; PCAL = 0x00; PCAH = 0x00; IRFWX-A123 15 Ver. A 2009/03
// Select_channel_mode Set // CCnCON.2 CCnCON.1 CCnC0N.0 Capture mode // 0 0 1 postive edge // 0 1 0 Negative edge // 0 1 1 postive&negative edge // 1 0 0 Timer mode void Select_channel_mode(void) CC0CON = 0x02; //P1.3 Negative edge capture mode CC1CON = 0x02; //P1.4 Negative edge capture mode CC2CON = 0x01; //P1.5 Postive edge capture mode CC3CON = 0x03; //P1.6 Postive & Negative capture mode CC4CON = 0x03; //P1.7 Postive & Negative capture mode void PCA_Capture(void) interrupt 7 //vector 003Bh // PCA Capture interrupt PCAL = 0x00; PCAH = 0x00; CPH=CC0DH; CPL=CC0DL; PCAC2 = PCAC2&0xC0; void main(void) unsigned int i=0, ii=0; init(); Select_channel_mode(); P3 = 0xFF; while(1) for(i=0;i<1000; i++) for(ii=0;ii<200; ii++) P0 =CPH; P2 =CPL; IRFWX-A123 16 Ver. A 2009/03
7.2 PCA Timer mode 應用的範例程式 : Description Device:SM59D04G2C25 Crystal:24MHz/12T Clock source= Fosc/4 6T:T =1 / Clock source = 4/24MHz =0.1666666us 12T:T =2(1 / Clock source) =2*4/24MHz = 0.33333us PCA = 65536-300(decimal) =10000-12C = 0xFED4 300T = 100us, will detect P3 toggles about 100us Main program //==================================================================== // // S Y N C M O S T E C H N O L O G Y // //==================================================================== #include "sfr.h" // enable interrupt and select clock source void Initial() IE=0x80; //enable all interrupt IE1=0x02; //enable PCA interrupt //PCAC1: CCR CIDL - CC4IE CC3IE CC2IE CC1IE CC0IE //PCAC1=0x9f; PCAC1=0x81; //PCAC2.7,PCAC2.6 Clock source // 0 0 Fosc // 0 1 Fosc/4 // 1 0 Fosc/12 // 1 1 External clock input(ccci pin,p1.2) PCAC2=0x40; //clock source from Fosc/4 PCAL =0xD4; //software reload value PCAH =0xFE; //software reload value // select_channel 0 ~ 4 void select_channel(void) CC0CON=0x04; //channel"0" timer mode CC1CON=0; //channel"1" timer mode disable CC2CON=0; //channel"2" timer mode disable CC3CON=0; //channel"3" timer mode disable CC4CON=0; //channel"4" timer mode disable void PCA_Timer(void) interrupt 7 using 0//vector 003Bh //if (PCAC2&0x01) // //65536-300(decimal) =10000-12C = 0xFED4 IRFWX-A123 17 Ver. A 2009/03
// PCAL =0xD4; PCAH =0xFE; //software reload value //software reload value P3 = ~P3; //12T@24MHz P3 toggle per 100us PCAC2 &= 0x40; //software clear all flag 可程式計數陣列功能使用方法 void main(void) select_channel(); Initial(); while(1) 7.3 PCA High speed output mode 應用的範例程式 : Description High speed pulse width Device:SM59D04G2C25 Crystal:24MHz/12T Clock source = Fosc/12 6T: T =1 /source clock = 1/(Fosc/12) = 12/24MHz =0.5us 12T: T =2(1 /source clock) = 2/(Fosc/12) =2*12/24MHz =1us 100T =100us, detect pin CC0(P1.3) toggles about 100us. Main program //==================================================================== // // S Y N C M O S T E C H N O L O G Y // //==================================================================== //******************************************************************** // high speed pulse width // Device:SM59D04G2C25 Crystal:24MHz/12T // 6T: 1 source clock = 1/(Fosc/12) = 12/24MHz =0.5us // 12T: 1 source clock = 2/(Fosc/12) =2*12/24MHz =1us // detect P1.3 toggle per 100us //******************************************************************** #include"sfr.h" void Initial() IE=0x80; IE1=0x02; //enable all interrupt //enable PCA interrupt PCAC1=0x81; //PCAC1.7=>PCA counter run bit //PCAC1 enable CC0 interrupt //PCAC2.7,PCAC2.6 Clock source // 0 0 Fosc // 0 1 Fosc/4 // 1 0 Fosc/12 IRFWX-A123 18 Ver. A 2009/03
// 1 1 External clock input(ccci pin) PCAC2=0x80; //clock source from Fosc/12 可程式計數陣列功能使用方法 PCAH =0x00; PCAL =0x00; CC0DH=0x00; CC0DL=0x64;; // //software reload value //software reload value //detect P1.3 toggle per 100us // only for select channel at CCnCON. void Select_channel_mode() CC0CON=0x05; //high speed mode =>P1.3 enable CC1CON=0x00; //high speed mode =>P1.4 disable CC2CON=0x00; //high speed mode =>P1.5 disable CC3CON=0x00; //high speed mode =>P1.6 disable CC4CON=0x00; //high speed mode =>P1.7 disable // PCA High Speed interrupt void PCA_High_Speed(void) interrupt 7//vector 3B PCAL =0x00; //software reload value PCAH =0x00; //software reload value PCAC2=PCAC2&0xC0; // PCAC2.7:6 (CCCLK is "11" representative external clock input "p1.2") void main() Initial(); Select_channel_mode(); while(1) IRFWX-A123 19 Ver. A 2009/03
7.4 PCA PWM mode 應用的範例程式 : Description Device:SM59D04G2C25 Crystal:24MHz/12T Main program //==================================================================== // // S Y N C M O S T E C H N O L O G Y // //==================================================================== #include"sfr.h" void Select_channel(); void Initial(); void main() Initial(); Select_channel(); while(1) p3=~p3; //***************************************************************** // initial set and select clock source mode0 ~ mode3 //***************************************************************** void Initial() p0=0xff; p1=0xff; p2=0xff; p3=0xff; PCAC1=0x9f; //PCAC1.7=>PCA counter run bit enable //PCAC1.4 ~ PCAC1.0 enable CC4 ~ CC0 interrupt //source clock = Fosc/12 PCAC2=0x80; //***************************************************************** // select 8 bit or 16 bit PWM and select PWM output p1.3 ~ p1.7 //***************************************************************** void Select_channel(void) CC0CON=0x06; //8bit PWM CC0DL= 0x3F; //pulse width,low:high =64us:192us =1:3 /* CC1CON=0x07; //16bit PWM CC1DH= 0x3F; //pulse width,low:high =16.386ms:49.159ms =1:3 CC1DL= 0xFF; CC1CON=0x06; //8bit PWM CC1DL= 0x00; //pulse width,always low CC0CON=0x06; //8bit PWM CC0DL= 0x01; //pulse width,low:high =2:254 IRFWX-A123 20 Ver. A 2009/03
*/ /* CC2CON=0x06; //8bit PWM CC2DL= 0xfd; //pulse width,low:high =254:2 CC3CON=0x06; //8bit PWM CC3DL= 0xfe; //pulse width,low:high =255:1 CC4CON=0x06; //8bit PWM CC4DL= 0xff; //pulse width,always low CC0CON=0x07; //16bit PWM CC0DH= 0x00; //pulse width,low:high =3:65533 CC0DL= 0x02; CC1CON=0x07; //16bit PWM CC1DH= 0x00; //pulse width,low:high =2:65534 CC1DL= 0x01; CC2CON=0x07; //16bit PWM CC2DH= 0x00; //pulse width,always low CC2DL= 0x00; CC3CON=0x07; //16bit PWM CC3DH= 0xFF; //pulse width,low:high =65535:1 CC3DL= 0xFE; CC4CON=0x07; //16bit PWM CC4DH= 0xFF; //pulse width,always low CC4DL= 0xFF;*/ IRFWX-A123 21 Ver. A 2009/03