Control De Fase

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Control De Fase as PDF for free.

More details

  • Words: 254
  • Pages: 5
Universidad Politécnica Salesiana Facultad de ingenierías Ingeniería Electrónica Integrantes:

Esteban Arrieta Carlos Malla Alejandro Valencia Santiago Yánez

CONTROL DE FASE Mediante la siguiente práctica se puede observar como se comporta la señal de control de fase en ac, realizado con el pic 16f877a. CÓDIGO program control_fase const tiempo as byte[19]=(93,102,111,120,129,138,147,157,166,175,184,193,202,211,220,22 9,238,247,255) DIM FASE as byte DIM FLAG AS BYTE sub procedure interrupt if TESTBIT(INTCON,INTF)=1 then PORTC.0=0 TMR0=TIEMPO [FASE] if tmr0 = 93 then flag=1 ELSE flag=0 end if CLEARBIT(INTCON,INTF) SETBIT(INTCON,T0IE) END IF IF TESTBIT(INTCON,T0IF)=1 THEN PORTA=255 IF FLAG = 1 THEN PORTC.0=0 ELSE PORTC.0=1 END IF CLEARBIT(INTCON,T0IF) SETBIT(INTCON,INTE) end if end sub sub procedure init trisb=%00000001 trisc=0 trisa=0

portc=0 option_reg=%00000111 intcon=%11100000 TMR0=0 LCD_CMD(Lcd_cursor_off) Lcd_config(portb,7,6,5,4,portb,1,2,3) Lcd_cmd(Lcd_Clear) FASE=0 LCD_CMD(Lcd_cursor_off) Lcd_out(1,1,"****U.P.S******") delay_ms(2000) lcd_cmd(Lcd_Clear) Lcd_out(1,1,"dimmer foquito") delay_ms(2000) Lcd_out(1,1,"6to ELECTRONICA") delay_ms(2000) lcd_cmd(Lcd_Clear) LCD_CMD(Lcd_cursor_off) Lcd_out(1,1," Angulo") Lcd_out(1,14,"grd") delay_ms(500) TRISD=255 end sub main: init LAZO: if PORTD.0=0 then delay_ms(500) FASE=FASE + 1 if FASE> 18 then fase=18 ELSE end if ELSE end if if PORTD.1=0 then delay_ms(500) FASE=fase-1 if FASE<0 then FASE=0 ELSE

end if ELSE end if select case FASE case 0 Lcd_out(1,10,"180") case 1 Lcd_out(1,10,"170") case 2 Lcd_out(1,10,"160") case 3 Lcd_out(1,10,"150") case 4 Lcd_out(1,10,"140") case 5 Lcd_out(1,10,"130") case 6 Lcd_out(1,10,"120") case 7 Lcd_out(1,10,"110") case 8 Lcd_out(1,10,"100") case 9 Lcd_out(1,10," 90") case 10 Lcd_out(1,10," 80") case 11 Lcd_out(1,10," 70") case 12 Lcd_out(1,10," 60") case 13 Lcd_out(1,10," 50") case 14 Lcd_out(1,10," 40") case 15 Lcd_out(1,10," 30") case 16 Lcd_out(1,10," 20") case 17 Lcd_out(1,10," 10") case 18 Lcd_out(1,10," 0") end select goto LAZO end. DIAGRAMA

SEÑALES VISTAS EN EL OSCILOSCOPIO

CIRCUITO IMPLEMENTADO

Related Documents