Hola soy Nachele y estudio mecanica y estoy haciendo el ciclo convertidor y tengo problemas para generar las ondas en el proteus nose bien cual es mi problema o el programa o el circuito en proteus alguien me puede explicar 
Aqui esta mi programacion en asembler
Aqui esta mi programacion en asembler
Código:
;RB5 :disparo de tiristor T4
;RB6 :led menor significativo
;RB7 :led mas significativo
; ENTRADAS DE uC
;RA0: prendido el progragrama
;RA1: selector Generarl
;RA2: cruce por cero
;RA4: swicht seleccion de diplay
list p=16f84A
#include <p16f84A.inc>
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT & _LVP_OFF & _MCLRE_ON
;**** Definicion de variables ****
;********Entrada*******************
swicht equ 0 ;swicht selecionador
swicht2 equ 3 ;swicht selecionador
swichtON equ 1
crucexcero equ 2 ; cruce por cero RA2
sincro equ 4
PC equ 02h ;contador de programa
CBLOCK h\'20\' ;Definimos variables desde la direccion 20(hex)
timen
mm
nn
ENDC
; ////////////////////////ZONA DE ASIGNACIONES////////////////////////
org 00000h ; el programa comenzara a partir de la Dirección 0x00
goto Inicio ; vamos a la etiqueta inicio
org 0005h ; a partir de aquí escribiremos nuestro programa
Inicio bsf STATUS,RP0 ;Acceso al banco 1
movlw b\'00000000\'
movwf TRISB ;Puerto B como salidas
movlw b\'11111111\' ;
movwf TRISA ;Puerto A como entradas
bcf STATUS,RP0 ;Acceso al banco 0
; ////////////////////////RUTINA/////////////////////////
clrf PORTB ;ponemos a cero el puerto A y B
clrf PORTA
;====================== SELECTOR ====================================
selec1
btfsc PORTA,swichtON
goto selec1
goto cond1
cond1
btfsc PORTA,swicht ;
goto cond3;x 1
goto cond2
cond2
btfsc PORTA,swicht2
goto sincronizar20hz ;1 0
goto sincronizar60hz ;0 0
cond3
btfsc PORTA,swicht2
goto sincronizar15hz ;1 1
goto sincronizar30hz ;0 1
;=====================60 HZ===========================================
sincronizar60hz
;====================== PROGRAMA 60 HZ================================
bcf PORTB,7
bcf PORTB,6
retorno1
cruce_cero
btfss PORTA,crucexcero ;Salta cuando detecta 1
goto cruce_cero
;sincronismo
; btfsc PORTA,sincro
; goto sincronismo
;==========================disparot1=============================
bsf PORTB,1 ; diparamos el triac
call disp
bcf PORTB,1
call retardo833ms
;==========================disparot2===============================
bsf PORTB,2 ; diparamos el triac
call disp
bcf PORTB,2
call retardo433ms2
btfsc PORTA,swichtON ;si es cero saltar
call selec1
goto retorno1
;=====================30 HZ=======================================
sincronizar30hz
;====================PROGRAMA 30 HZ=============================
bcf PORTB,7
bsf PORTB,6
retorno2
cruce_cero3
btfss PORTA,crucexcero ;Salta cuando detecta 1
goto cruce_cero3
;sincronismo3
; btfsc PORTA,sincro
; goto sincronismo3
;=======================diparot1=============================
bsf PORTB,1 ; diparamos el triac
call disp
bcf PORTB,1
call retardo833ms
;=============================diparot2==========================
bsf PORTB,2 ; diparamos el triac
call disp
bcf PORTB,2
call retardo833ms
;===============================diparot3===========================
bsf PORTB,4 ; diparamos el triac
call disp
bcf PORTB,4
call retardo833ms
;=============================diparot4===========================
bsf PORTB,5 ; diparamos el triac
call disp
bcf PORTB,5
call retardo433ms
btfsc PORTA,swichtON ;si es cero saltar
call selec1
goto retorno2
;================================20 HZ===================================
sincronizar20hz
;==============================PROGRAMA 20HZ============================
bsf PORTB,7
bcf PORTB,6
retorno3
cruce_cero7
btfss PORTA,crucexcero ;Salta cuando detecta 1
goto cruce_cero7
;sincronismo7
; btfsc PORTA,sincro
; goto sincronismo7
;===============================diparot1==========================
bsf PORTB,1 ; diparamos el triac
call disp
bcf PORTB,1
call retardo833ms
;=============================diparot2===========================
bsf PORTB,2 ; diparamos el triac
call disp
bcf PORTB,2
call retardo833ms
;=============================diparot1=============================
bsf PORTB,1 ; diparamos el triac
call disp
bcf PORTB,1
call retardo833ms
;==========================diparot4=================================
bsf PORTB,5 ; diparamos el triac
call disp
bcf PORTB,5
call retardo833ms
;=============================diparot3============================
bsf PORTB,4 ; diparamos el triac
call disp
bcf PORTB,4
call retardo833ms
;=============================diparot4=========================
bsf PORTB,5 ; diparamos el triac
call disp
bcf PORTB,5
call retardo433ms2
btfsc PORTA,swichtON ;si es cero saltar
call selec1
goto retorno3
;================================15 HZ===================================
sincronizar15hz
;==============================PROGRAMA 20HZ============================
bsf PORTB,7
bsf PORTB,6
retorno4
cruce_cero13
btfss PORTA,crucexcero ;Salta cuando detecta 1
goto cruce_cero13
;sincronismo13
; btfsc PORTA,sincro
; goto sincronismo13
;===============================diparot1==========================
bsf PORTB,1 ; diparamos el triac
call disp
nop
bcf PORTB,1
call retardo833ms
;=============================diparot2===========================
bsf PORTB,2 ; diparamos el triac
call disp
bcf PORTB,2
call retardo833ms
;=============================diparot1=============================
bsf PORTB,1 ; diparamos el triac
call disp
bcf PORTB,1
call retardo833ms
;=============================diparot2===========================
bsf PORTB,2 ; diparamos el triac
call disp
bcf PORTB,2
call retardo833ms
;=============================diparot3============================
bsf PORTB,4 ; diparamos el triac
call disp
bcf PORTB,4
call retardo833ms
;==========================diparot4=================================
bsf PORTB,5 ; diparamos el triac
call disp
bcf PORTB,5
call retardo833ms
;=============================diparot3============================
bsf PORTB,4 ; diparamos el triac
call disp
bcf PORTB,4
call retardo833ms
;=============================diparot4=========================
bsf PORTB,5 ; diparamos el triac
call disp
bcf PORTB,5
call retardo433ms2
btfsc PORTA,swichtON ;si es cero saltar
call selec1
goto retorno4
;*******************RETARDO DE 8.33ms*******************
retardo833ms
movlw .220
movwf timen
movf timen,0 ; M es igual a 15 ests valor calculados tiempo de 4.15 ms (37 en decimal)
movwf mm
movf timen,0 ; N es igual a 15 ests valor calculados tiempo de 4.15 ms (37 en decimal)
movwf nn
reta1
decfsz nn,1
goto reta1
reta2
decfsz mm,1
goto reta2
return
;******************disparo****************************
disp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
return
;******************************FIN***********************
end ...
Última edición por un moderador: