亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? phase84.c

?? PIC_Hi-Tech_C_Mike_Pearces_phase_controller_TRIAC_or_IGBT_50-60Hz源碼
?? C
字號:
#define _VERSION_ "V0.0.1"
/************************************************************************
*                            phase84.c
*
* Simple Phase control using  PIC16F84 - 100% C Program.
* Using even time slicing method for both Triac and IGBT Drive methods.
* Just change specific #define to choose which method is in use.
*
* Output pin for phase ctrl is RA0
* Zero Cross input is RB0
* Remainder of PORTB is used for level setting 0 to 255 in incs of 2
*
* Output is Active LOW - i.e. it is desigend to pull an LEDs Cathode in an 
* opto-coupler low to turn the output ON.
*
* Output Driver Types:
* Either TRIAC or IGBT control can be used with this software by selecting
* the appropiate #define command.
*
* IGBT Driver:
* An IGBT driver turns the output ON at the zero cross point and turns 
* the output OFF part way through the cycle - this has really low 
* EMI properties and is one of the few methods allowed for phase control
* in European countrys (i.e complies with EN55015 EMI standard).
* Other countries are following suit for example New Zealand and Austrailia
* are almost there (See AS/NZS 4051 and CISPR15 EMI Standards )
* This method of dimming is audibly quiet, does not require extra filter
* componets (If designed properly).It also has a better lamp life and can 
* control a wider range of lamps than the TRIAC method of dimming.
*
* TRIAC Driver:
* A TRIAC driver turns the output OFF at the zero-cross and turns the
* output ON part way through the cycle - this has high EMI output and needs
* filter inducors etc. This has been the most popular method of phase 
* control since it was first demonstraited in London in 1962. To make 
* the TRIAC dimmer complient with modern EMI standards it requires
* carefully designed filter circuits using large Toroid Inductors
* and mains voltage AC rated capacitors.
* This is still the simplest method to do, and quite cheap, but not
* recommended for comercial designs any more.
* It also has a tendancy to reduce Lamp life, and creates alot of audiable
* noise in both the inductors and lamps.
*
* 
*
* Processor: PIC16F84 @ 10Mhz
*
* Author: Michael Pearce
*
* Copyright 2001 Michael Pearce
* All Rights Reserved
*
* Free to use for non-comercial, non-profit personal use only.
* For Commercial use please contact author (He doesnt Bite) at
*
* mimemike@paradise.net.nz  or   mike@lightneasy.com
*
* Started: 10 July 2001  (My 20 something Birthday)
*
*************************************************************************
*                          Version Information
*************************************************************************
* Version 0.0.1 - 10 July 2001
* Change User Input to an up and DOWN Key on 10ms Interrupt
* Test as Functional
* 98 Words ROM
*************************************************************************
* Version 0.0.0 - 10 July 2001
* First Draft of the Project
* Tested as functional
* 79 words of ROM
*************************************************************************/

#include <pic.h>

#define ON  0        /* To set Output to ON state  */
#define OFF 1        /* To Set Output to OFF state */

/*** Select output settings - Choose only one from each  ***/

/** Output Control Method **/
//#define TRIAC    /* TRIAC Control Turns ON part way through cycle */
#define IGBT       /* IGBT Control turnd OFF part way through cycle */


/** Mains Frequency **/
//#define HZ60     /* For 60Hz Mains system */
#define HZ50       /* For 50Hz Maind system */


/*********** Reload value for Phase Control ************************
* ((1/(MainsFreq*2)) / 256) / (1/(Crystal Freq/4)) = TimerCount
* For 50Hz Mains @ 10Mhz Clock         For 60Hz @ 10MHz Clock
* 1/(50Hz*2)  = 10ms                   1/(60Hz*2)  = 8.3ms
* 10ms/256    = 39us                   8.3ms/256   = 32us 
* 1/(10MHz/4) = 0.4us                  1/(10MHz/4) = 0.4us
* 39us/0.4us  = 97                     32us/0.4us  = 80
*
* Subtract Interrupt time and other delays (Guessing at around 5)
* For 50Hz: 97 - 5 = 93                For 60Hz: 80 - 5 = 75
*
* Reload @ 50Hz  = -93 or 163          Reload @ 60Hz = -75 or 181
* (Counter counts up and resets at Zero)
* NOTE: These allow a MAXIMUM num of intstruction cycles between
* interrupts of 93 for 50Hz System, or 75 for 60Hz System.
*******************************************************************/

#ifdef  HZ50
 #define TIMER_RELOAD 163
#endif
#ifdef  HZ60
 #define TIMER_RELOAD 181
#endif


/**** I/O Ports ****/
#ifndef BITNUM
 #define BITNUM(adr, bit) ((unsigned)(&adr)*8+(bit))  /* used for port defs*/
#endif

static bit CH_OUT     @ BITNUM(PORTA,0);        /* Phase Ctrl Output PIN */
static bit T_CH_OUT   @ BITNUM(TRISA,0);        /* Tris for above */

static bit ZERO_INT   @ BITNUM(PORTB,0);        /* Zero Cross Interrupt PIN*/
static bit T_ZERO_INT @ BITNUM(TRISB,0);        /* Tris for above */

static bit SW_UP      @ BITNUM(PORTB,1);        /* Increase Power Switch */
static bit T_SW_UP    @ BITNUM(TRISB,1);        /* Tris for above */

static bit SW_DWN     @ BITNUM(PORTB,2);        /* Decrease Power Switch */
static bit T_SW_DWN   @ BITNUM(TRISB,2);        /* Tris for above */



/**** Global Variables ****/
unsigned char CH_COUNT;        /* Interrupt Counter */
unsigned char CH_LEVEL;        /* Target Level      */

bit INT_10MS;                  /* 10ms interrupt flag */


/*********************************************************************
*                          main
*********************************************************************/
void main(void)
{
 /***** Set Up OPTION ******
 * RB Pullup = Enabled = 0
 * IntEdge   = Rise    = 1
 * T0 Src    = Internal= 0
 * T0 Edge   = L to H  = 0
 * Prescale  = WDT     = 1
 * Prescale  = 1:1     = 000
 ***************************/
 OPTION=0b01001000;

 
 /**** Set up Ports ****/
 TRISA=0xFF;      /* Port A as Inputs */
 TRISB=0xFF;      /* Port B as Inputs */

 
 T_CH_OUT=1;      /* Output Pin to High Impedance State */
 CH_OUT=0;        /* When Tris set to Output, pull LOW  */

 T_ZERO_INT=1;    /* Zero Cross Interrupt Pin as INPUT  */
 ZERO_INT=1;

 SW_UP=1;         /* Switch as INPUT */
 T_SW_UP=1;

 SW_DWN=1;        /* Switch as INPUT */
 T_SW_DWN=1;

 

 /**** Initialise Variables ****/
 CH_COUNT=0;      /* Set Inital output to 0%            */
 CH_LEVEL=0;
 INT_10MS=0;      /* Dont check keys till interrupt */

 /**** Set Up Interrupts ****/
 INTCON=0x00;     /* Disable All Interrupts and clear flags */

 INTE=1;          /* Enable ZeroCross Interrupt */
                  /* Note: T0IE enable from Zero Cross Routine */
 GIE=1;           /* Enable Global interrupts   */
 

 /**** Main Program Loop ****/
 /* Loop FOREVER */
 while(1)
 {
  /* Check for 10ms interrupt */
  if(INT_10MS)
  {
   INT_10MS=0;                  /* Clear Flag */
   if(SW_UP==0)CH_LEVEL++;      /* Check for INCREASE Switch */
   if(SW_DWN==0)CH_LEVEL--;     /* Check for DECREASE Switch */
  }
 }
}
/************** END OF main *******************/


/***********************************************************************
*                        PhaseControl
*
* This is the Interrupt routine.
* On Zero Cross it resets the output and reloads the count
* On Timer it counts down till time to toggle output.
***********************************************************************/
void interrupt PhaseControl(void)
{
 /**** Timer OverFlow Interrupt ****/
 if(T0IF)
 {
  TMR0=TIMER_RELOAD;    /* Reload the Timer ASAP */
  T0IF=0;               /* Clear the Timer Flag  */

  if(CH_COUNT==0)
  {
   #ifdef TRIAC         /* TRIAC MODE      */
    CH_OUT=ON;          /* Turn Output ON  */
    T_CH_OUT=ON;    
   #endif
   
   #ifdef IGBT          /* IGBT MODE       */
    T_CH_OUT=OFF;       /* Turn Output OFF */
   #endif
  }
  else
  {
   CH_COUNT--;          /* Keep Decreasing Till Zero */
  }
 }

 /**** Zero Cross Interrupt ****/	
 if(INTF)
 {
  INTF=0;               /* Clear Interrupt Flag */
  CH_COUNT=CH_LEVEL;    /* Load Level Setting   */

  #ifdef TRIAC          /* TRIAC MODE */
   T_CH_OUT=OFF;        /* Turn Output Off */
  #endif

  #ifdef IGBT           /* IGBT MODE */
   if(CH_COUNT !=0)     
   {
    CH_OUT=ON;          /* Turn Output ON if > 0% setting */
    T_CH_OUT=ON;
   }
   else
   {
    T_CH_OUT=OFF;       /* else Ensure it is OFF */
   }
  #endif
  T0IF=1;               /* Force Instant entry to Timer 0 Interrupt */
  T0IE=1;               /* Ensure that TMR0 Interrupt is enabled    */
  INT_10MS=1;           /* Indicate 10ms Interrupt Occured */
 }

}
/*************** END OF PhaseControl ****************************/





?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级片在线观看| 狠狠网亚洲精品| 成人sese在线| 国产精品久久夜| 91在线免费看| 亚洲午夜一区二区三区| 欧美无砖砖区免费| 男人的j进女人的j一区| 精品少妇一区二区三区免费观看| 国产综合久久久久影院| 国产欧美一区二区精品性色超碰| 96av麻豆蜜桃一区二区| 亚洲另类一区二区| 欧美三级视频在线观看| 经典三级一区二区| 国产精品久久久一本精品| 欧美综合天天夜夜久久| 日韩高清不卡一区二区| 久久这里只有精品首页| 99精品国产热久久91蜜凸| 亚洲成av人片在线观看无码| 日韩你懂的在线播放| 成人黄色综合网站| 亚洲综合激情小说| 久久久久久免费网| 色综合天天视频在线观看| 天天综合网天天综合色| 久久精品这里都是精品| 色呦呦日韩精品| 美女www一区二区| 亚洲欧洲精品成人久久奇米网| 欧美色窝79yyyycom| 国产一区二区调教| 午夜欧美一区二区三区在线播放| 国产亚洲女人久久久久毛片| 在线观看免费视频综合| 国产一区二区视频在线| 亚洲高清不卡在线| 国产精品污www在线观看| 欧美日本一区二区三区四区| 丰满放荡岳乱妇91ww| 日本网站在线观看一区二区三区| 国产精品每日更新在线播放网址| 日韩午夜激情免费电影| 91蜜桃免费观看视频| 久久精品国产色蜜蜜麻豆| 亚洲欧美韩国综合色| 久久综合狠狠综合久久综合88| 欧美视频中文字幕| youjizz久久| 精品一区二区影视| 午夜精品福利一区二区三区蜜桃| 日本一区二区三区电影| 日韩一区和二区| 欧美日韩午夜在线视频| 91网站在线播放| 国产精品一区二区免费不卡| 美女在线观看视频一区二区| 亚洲在线成人精品| 日韩一区在线播放| 中文字幕av一区二区三区| 久久嫩草精品久久久精品一| 日韩丝袜美女视频| 欧美美女一区二区| 一本到高清视频免费精品| 成人小视频在线| 成人一级片在线观看| 国产一区二区三区免费观看| 蜜臀av性久久久久蜜臀aⅴ流畅 | 日韩精品一区二区三区在线观看| 在线一区二区三区四区五区| 成人免费观看av| 成人一区二区三区| 成人av资源在线观看| 国产 日韩 欧美大片| 国产一区二区毛片| 国产一区二区三区久久悠悠色av| 日本成人在线电影网| 午夜日韩在线观看| 日本aⅴ免费视频一区二区三区| 午夜精品福利一区二区蜜股av | 偷拍亚洲欧洲综合| 亚洲影视在线播放| 亚洲超丰满肉感bbw| 亚洲v日本v欧美v久久精品| 亚洲午夜久久久久| 天天av天天翘天天综合网| 亚洲一区视频在线观看视频| 亚洲国产人成综合网站| 日韩黄色片在线观看| 免费看精品久久片| 国产一区二区三区在线看麻豆| 国产麻豆一精品一av一免费| 国产成人综合在线观看| 成人动漫精品一区二区| 91亚洲精品久久久蜜桃网站| 在线视频国产一区| 在线不卡a资源高清| 日韩精品在线一区| 国产午夜精品一区二区三区嫩草| 国产农村妇女毛片精品久久麻豆 | 亚洲国产成人porn| 蜜臀av性久久久久蜜臀aⅴ| 黄页网站大全一区二区| 成人黄色片在线观看| 色狠狠一区二区| 日韩午夜在线影院| 国产精品国产三级国产专播品爱网| 一区二区在线看| 开心九九激情九九欧美日韩精美视频电影 | 日韩理论片网站| 亚洲成a人v欧美综合天堂下载| 久久成人18免费观看| 99麻豆久久久国产精品免费| 欧美三级午夜理伦三级中视频| 久久免费精品国产久精品久久久久| 亚洲视频在线观看一区| 日韩国产欧美视频| 粉嫩嫩av羞羞动漫久久久 | 美女国产一区二区三区| a在线播放不卡| 欧美一级免费观看| 中文字幕亚洲成人| 日本不卡在线视频| 色悠久久久久综合欧美99| 欧美xxxx老人做受| 亚洲精品免费在线| 国产成人综合亚洲91猫咪| 91电影在线观看| 26uuu成人网一区二区三区| 亚洲精品写真福利| 国产精品资源网站| 欧美男男青年gay1069videost | 91久久精品一区二区三区| 欧美电影免费观看高清完整版在线 | 精品三级av在线| 亚洲综合一二区| 成人午夜激情在线| 欧美成人国产一区二区| 亚洲chinese男男1069| av不卡在线播放| 久久综合九色综合97_久久久| 午夜精品成人在线| 色又黄又爽网站www久久| 国产视频在线观看一区二区三区| 日韩va欧美va亚洲va久久| 色天天综合色天天久久| 欧美国产日韩亚洲一区| 美女网站色91| 777a∨成人精品桃花网| 亚洲自拍都市欧美小说| 91视频.com| 欧美激情一区二区三区全黄| 激情五月婷婷综合| 日韩三级高清在线| 日本不卡高清视频| 欧美精品亚洲一区二区在线播放| 亚洲精品国产a| 91在线观看下载| 国产精品久久久久影视| 高清成人在线观看| 国产喷白浆一区二区三区| 国产精品一二一区| 久久精品在这里| 国产成人啪午夜精品网站男同| 亚洲精品一区二区三区蜜桃下载| 蜜桃av一区二区在线观看| 91精品国产入口| 免费高清在线一区| 日韩欧美aaaaaa| 国模娜娜一区二区三区| 久久欧美一区二区| 国产福利不卡视频| 国产欧美日韩激情| av不卡在线播放| 亚洲午夜成aⅴ人片| 欧美日韩三级视频| 日本一不卡视频| 日韩视频一区二区三区在线播放 | 激情综合色综合久久| xnxx国产精品| 国产成人免费在线| 国产精品乱码人人做人人爱| bt欧美亚洲午夜电影天堂| 一区二区三区四区精品在线视频| 91成人免费电影| 亚洲第一会所有码转帖| 91精品黄色片免费大全| 国产综合久久久久久鬼色| 欧美激情在线观看视频免费| aaa亚洲精品| 亚洲国产精品天堂| 日韩欧美激情四射| 国产成人免费高清| 亚洲视频资源在线| 欧美日韩高清一区| 国产精品综合视频| 亚洲一区二区三区不卡国产欧美| 91精品国产品国语在线不卡 | 成人av电影在线|