99久久全国免费观看_国产一区二区三区四区五区VM_久久www人成免费看片中文_国产高清在线a视频大全_深夜福利www_日韩一级成人av

  • 回復(fù)
  • 收藏
  • 點贊
  • 分享
  • 發(fā)新帖

用PIC16C84的修正正弦波2kva逆變器(國外)技術(shù)資料

有興趣的做做看
全部回復(fù)(3)
正序查看
倒序查看
qianyibo
LV.4
2
2004-07-10 23:14
*******************主程序*******************
;*******************************************************************
;* INVERT7.ASM   PIC PWM DC->AC Inverter Controller
;*         Generates 60Hz PWM waveform for primary of inverter Xfrm
;*         Begins at 0.5 max. width and uses ADC to sample average
;*         AC output voltage.  Also controls main power relays and
;*         corrects load power factor
;*
;* M. Csele  original version: 96/12/04  version 7: 98/12  
;*
;* Hardware: Adapted for PIC Applications PCB with on-board ADC0831
;*
;*           RA0 = ADC DATA Line
;*           RA1 = ADC CLK Line
;*           RA2 = ADC CS Line
;*           RA3 = Alarm Beeper Output
;*                 (Used to announce startup and shutdown)  
;*           RA4 = [FUTURE OPTION] Shutdown Input (Active Low)  
;*
;*           RB0 = [FUTURE OPTION] Serial Receive/Transmit
;*           RB1 = Power Factor Correction capacitor relay
;*                 (Switches in PF capacitor above 500VA load)
;*           RB2 = Error LED Output
;*                 (Error code when shutdown due to fault)
;*           RB3 = OverLoad LED Output
;*                 (Fast Blink = permissive overload)
;*                 (Constant   = Vout < 115V at max pulse width)
;*                 (Slow Blink = shutdown after 6 secs of overload)
;*           RB4 = PWM Change Status LED Output
;*                 (Lights when PW changing due to voltage error > 2)
;*           RB5 = Main driver bank Relay ON Output
;*                 (Controls main power relays for xfmrs)    
;*           RB6 = Phase 2 Output to driver transistors (ACTIVE LOW)
;*           RB7 = Phase 1 Output to driver transistors (ACTIVE LOW)
;*******************************************************************

        LIST    p=16C84       ;PIC16C84 is the target processor
        INCLUDE "P16C84.INC"  ;Include file with register defines

;Register Defines
Temp       equ    2F       ;temp storage during misc functions
ADCresult  equ    2E       ;stores ADC reading
ADCCtr     equ    2D       ;stores count for reading 8 bits from serial ADC
PulseWidth equ    2C       ;Width of var. part of pulse in 10uS increments
Timer      equ    2B       ;Used as a count-down timer
ErrorValue    equ   2A
ErrorTimerLo  equ   29
ErrorTimerHi  equ   28
LedBlinkTimer equ   27     ;Used for blinking LED during max. load    

;PORT A Defines
ADCCLK    equ    1
ADCDAT    equ    0
ADCCS     equ    2
BEEP      equ    3

;PORT B Defines
PHASE1    equ    7
PHASE2    equ    6
PWRRELAY  equ    5
LEDPWM    equ    4
LEDOVERLD equ    3
LEDERROR  equ    2
PFCRELAY  equ    1

Main
        movlw   b'00000001'   ;Port B all outputs except unused RB0
        tris    PORTB
        movlw   b'11000000'   ;All Outputs LOW except drivers OFF (high)
        movwf   PORTB

        movlw   b'00010001'   ;Port A all inputs except RA4 and RA0 (DATA)
        tris    PORTA
        movlw   b'00000000'   ;All Outputs LOW
        movwf   PORTA

        movlw   .0          ;Initialize Pulse Width to 0.5 Max. (Min)
        movwf   PulseWidth

        movlw   b'10000110'   ;Set timer 0 to overflow at 240Hz.  7200Hz in =
                              ;Internal clock, Divide by 128 prescaler
        bsf     STATUS,RP0    ;select Page 1
        movwf   OPTION_REG
        bcf     STATUS,RP0    ;select Page 0
        clrwdt

        movlw   .226          ;Initialize timer for 240Hz overflow
        movwf   TMR0

        bsf     PORTA,BEEP    ;Beep for 1 second
        movlw   .240          ;1 second delay using timer
        movwf   Timer
NextDly
        call    WaitForTmr
        decfsz  Timer,f
        goto    NextDly
        bcf     PORTA,BEEP

        bsf     PORTB,PHASE1   ;Turn Phases OFF
        bsf     PORTB,PHASE2
        bsf     PORTB,PWRRELAY ;Main Power Relay ON
        bcf     PORTB,PFCRELAY ;Power Factor Correction OFF
        
        ;Starting Value: Minimum pulse width
        movlw   .1
        movwf   PulseWidth

;** Inverter main loop: Generate 60Hz PWMed Sine Wave and check system
MainLoop
        ;Phase A half-cycle output
        ;Generate fixed width pulse of 1/240th sec.
        bcf     PORTB,PHASE1  ;Phase A ON (active low)

        ;During Phase A fixed delay, check output voltage and adjust
        ;Pulse Width Accordingly for the next cycle
        call    ReadADC
        call    AdjustPulseWidth

        call    WaitForTmr    ;Wait for 1/240th second to elapse

        ;Generate variable width pulse of 0 to 1/240th sec
        movfw   PulseWidth
        movwf   Timer
NextPhaseADly
        call    Delay10uS     ;Generate from 1 to 255 10uS delays
        decfsz  Timer,f
        goto    NextPhaseADly    

        bsf     PORTB,PHASE1  ;Phase A OFF
        call    WaitForTmr    ;Wait for rest of 1/240th sec period

        ;Phase B half-cycle output
        ;Generate fixed width pulse of 1/240th sec.
        bcf     PORTB,PHASE2  ;Phase B ON (active low)
        call    WaitForTmr    ;Wait for 1/240th second to elapse

        ;Generate variable width pulse of 0 to 1/240th sec
        movfw   PulseWidth
        movwf   Timer
NextPhaseBDly
        call    Delay10uS     ;Generate from 1 to 255 10uS delays
        decfsz  Timer,f
        goto    NextPhaseBDly    

        bsf     PORTB,PHASE2  ;Phase B OFF
        call    WaitForTmr    ;Wait for rest of 1/240th sec period

        goto    MainLoop
0
回復(fù)
2004-07-12 09:37
@qianyibo
*******************主程序*******************;*******************************************************************;*INVERT7.ASM  PICPWMDC->ACInverterController;*        Generates60HzPWMwaveformforprimaryofinverterXfrm;*        Beginsat0.5max.widthandusesADCtosampleaverage;*        ACoutputvoltage.  Alsocontrolsmainpowerrelaysand;*        correctsloadpowerfactor;*;*M.Csele  originalversion:96/12/04  version7:98/12  ;*;*Hardware:AdaptedforPICApplicationsPCBwithon-boardADC0831;*;*          RA0=ADCDATALine;*          RA1=ADCCLKLine;*          RA2=ADCCSLine;*          RA3=AlarmBeeperOutput;*                (Usedtoannouncestartupandshutdown)  ;*          RA4=[FUTUREOPTION]ShutdownInput(ActiveLow)  ;*;*          RB0=[FUTUREOPTION]SerialReceive/Transmit;*          RB1=PowerFactorCorrectioncapacitorrelay;*                (SwitchesinPFcapacitorabove500VAload);*          RB2=ErrorLEDOutput;*                (Errorcodewhenshutdownduetofault);*          RB3=OverLoadLEDOutput;*                (FastBlink=permissiveoverload);*                (Constant  =Vout<115Vatmaxpulsewidth);*                (SlowBlink=shutdownafter6secsofoverload);*          RB4=PWMChangeStatusLEDOutput;*                (LightswhenPWchangingduetovoltageerror>2);*          RB5=MaindriverbankRelayONOutput;*                (Controlsmainpowerrelaysforxfmrs)    ;*          RB6=Phase2Outputtodrivertransistors(ACTIVELOW);*          RB7=Phase1Outputtodrivertransistors(ACTIVELOW);*******************************************************************        LIST    p=16C84      ;PIC16C84isthetargetprocessor        INCLUDE"P16C84.INC"  ;Includefilewithregisterdefines;RegisterDefinesTemp      equ    2F      ;tempstorageduringmiscfunctionsADCresult  equ    2E      ;storesADCreadingADCCtr    equ    2D      ;storescountforreading8bitsfromserialADCPulseWidthequ    2C      ;Widthofvar.partofpulsein10uSincrementsTimer      equ    2B      ;Usedasacount-downtimerErrorValue    equ  2AErrorTimerLo  equ  29ErrorTimerHi  equ  28LedBlinkTimerequ  27    ;UsedforblinkingLEDduringmax.load    ;PORTADefinesADCCLK    equ    1ADCDAT    equ    0ADCCS    equ    2BEEP      equ    3;PORTBDefinesPHASE1    equ    7PHASE2    equ    6PWRRELAY  equ    5LEDPWM    equ    4LEDOVERLDequ    3LEDERROR  equ    2PFCRELAY  equ    1Main        movlw  b'00000001'  ;PortBalloutputsexceptunusedRB0        tris    PORTB        movlw  b'11000000'  ;AllOutputsLOWexceptdriversOFF(high)        movwf  PORTB        movlw  b'00010001'  ;PortAallinputsexceptRA4andRA0(DATA)        tris    PORTA        movlw  b'00000000'  ;AllOutputsLOW        movwf  PORTA        movlw  .0          ;InitializePulseWidthto0.5Max.(Min)        movwf  PulseWidth        movlw  b'10000110'  ;Settimer0tooverflowat240Hz.  7200Hzin=                              ;Internalclock,Divideby128prescaler        bsf    STATUS,RP0    ;selectPage1        movwf  OPTION_REG        bcf    STATUS,RP0    ;selectPage0        clrwdt        movlw  .226          ;Initializetimerfor240Hzoverflow        movwf  TMR0        bsf    PORTA,BEEP    ;Beepfor1second        movlw  .240          ;1seconddelayusingtimer        movwf  TimerNextDly        call    WaitForTmr        decfsz  Timer,f        goto    NextDly        bcf    PORTA,BEEP        bsf    PORTB,PHASE1  ;TurnPhasesOFF        bsf    PORTB,PHASE2        bsf    PORTB,PWRRELAY;MainPowerRelayON        bcf    PORTB,PFCRELAY;PowerFactorCorrectionOFF                ;StartingValue:Minimumpulsewidth        movlw  .1        movwf  PulseWidth;**Invertermainloop:Generate60HzPWMedSineWaveandchecksystemMainLoop        ;PhaseAhalf-cycleoutput        ;Generatefixedwidthpulseof1/240thsec.        bcf    PORTB,PHASE1  ;PhaseAON(activelow)        ;DuringPhaseAfixeddelay,checkoutputvoltageandadjust        ;PulseWidthAccordinglyforthenextcycle        call    ReadADC        call    AdjustPulseWidth        call    WaitForTmr    ;Waitfor1/240thsecondtoelapse        ;Generatevariablewidthpulseof0to1/240thsec        movfw  PulseWidth        movwf  TimerNextPhaseADly        call    Delay10uS    ;Generatefrom1to25510uSdelays        decfsz  Timer,f        goto    NextPhaseADly            bsf    PORTB,PHASE1  ;PhaseAOFF        call    WaitForTmr    ;Waitforrestof1/240thsecperiod        ;PhaseBhalf-cycleoutput        ;Generatefixedwidthpulseof1/240thsec.        bcf    PORTB,PHASE2  ;PhaseBON(activelow)        call    WaitForTmr    ;Waitfor1/240thsecondtoelapse        ;Generatevariablewidthpulseof0to1/240thsec        movfw  PulseWidth        movwf  TimerNextPhaseBDly        call    Delay10uS    ;Generatefrom1to25510uSdelays        decfsz  Timer,f        goto    NextPhaseBDly            bsf    PORTB,PHASE2  ;PhaseBOFF        call    WaitForTmr    ;Waitforrestof1/240thsecperiod        goto    MainLoop
太麻煩了,我覺得用帶AD的單片機來設(shè)計更簡單,更重要是可以節(jié)省銀子.
0
回復(fù)
qghqgh
LV.6
4
2006-10-04 20:46
@heromeethero
太麻煩了,我覺得用帶AD的單片機來設(shè)計更簡單,更重要是可以節(jié)省銀子.
dddddd
0
回復(fù)
發(fā)
主站蜘蛛池模板: 国产精品91在线观看 | 免费性片 | 99R在线精品视频在线播放 | 综合久久国产 | 久久性生活片 | 在线看av网址 | 4480国产在线观看 | 91精品国产综合久久男男 | 日本天堂视频在线观看 | 免费观看一级特黄欧美大片 | 51午夜精品视频 | 亚洲精品美女视频在线观看 | 欧美精品一区二区三区久久狼 | 日韩成人影院 | 日韩一卡2卡3卡4卡2021免费观看国色天香 | 毛片免费网站 | 三级免费久久无码 | 亚洲成人免费看 | 日本熟妇另类视频在线播放 | 亚洲精品无码一区二区三区污 | 国产午夜在线播放 | 啊灬啊灬啊灬快灬高潮了听书 | 精品国产乱码一区二区三区麻豆 | 精品在线免费看 | 国产毛片毛片毛片毛片毛片 | 欧美一二三四 | 日韩一级在线观看 | 少妇在宾馆高潮不断狂叫床 | 年轻的朋友4韩剧在线观看 亚洲乱码一二三四区 | 日韩一区免费视频 | 乱码一区二区三区四区 | 在线观看成人高清a | 性少妇VIDEOXXⅩ欧美69 | 国产精品无码午夜福利 | 边添小泬边狠狠躁视频 | 男人操女人逼免费视频 | 国产农村妇女一区二区三区 | 国产国语在线播放视频 | 中国xxxx做受gay | 在线a网 | av人摸人人人澡人人超碰小说 |