mida 14 ;------------------------------------------------------------- ;Aplicación -> ;Fecha -> ;los registros ;vmax=registro 400 eeprom imax=registro 401 eeprom entra a mano ; emca7 enteros pasan a reg. del 150 arriba(error) ; emca7 los puntos Y de tem. y hume. pasan de enteros a flotantes con 1 decimal ;emca8 en limi se lee multi y se envia al 100 ;emca9 subrutina puer envia datos t y h al com232 habilitado por teclado ;emca10 entrada y salida del multi con tecla izq ;emca11 entrada de registros eeprom de t y h por teclado ;------------------------------------------------------------- scan equ 99 ;programa principal--------------------------------------- &ini ld scan jz &lea jmp ini0 &lea call &leavar ini0 nop call calc call disp call limi call puer ld arr and izq jnz ini2 jmp ini4 ini2 call cali ini4 call onoff inif end ;--------------------------- ;onoff prende apaga el multi onoff ld izq jz onofff ld auxon xor multi out multi onoff1 ld izq jnz onoff1 onofff ret ;---------------------------- limi ;movrf v1otap ;movcf 40 ;cpgf limi1 ;jmp limi3 limi1 ld multi out 100 ld 100 out 126 movrf v1otap movcf 140 cpgf limi2 jmp limif limi2 reset multi ld multi out 100 jmp limif limi3 reset 100 ld 100 out 126 limif ret ;--------------------------- puer movci 1 movri pueron cpei puer1 jmp puerf puer1 flanc 37 1 jz puerf clear disch 64 ;@ ;com 3 disrf to 41 disch 95 ;_ disrf ho 41 com 3 puerf ret ;------------------------- calc movif v1i movrf v1k mulf stof v1ot movrf v1ot movrf v1b addf stof v1o movrf vtap ;se calcula el voltaje fase R con tap movrf vmax ;para que pueda iniciar el multitransformador divf movcf 2 divf movrf v1o mulf stof v1otap movif v2i movrf v2k mulf stof v2ot movrf v2ot movrf v2b addf stof v2o movif v3i movrf v3k mulf stof v3ot movrf v3ot movrf v3b addf stof v3o movif i1i movrf i1k mulf stof i1ot movrf i1ot movrf i1b addf stof i1o movif i2i movrf i2k mulf stof i2ot movrf i2ot movrf i2b addf stof i2o movif i3i movrf i3k mulf stof i3ot movrf i3ot movrf i3b addf stof i3o movif tei movrf tk mulf stof tot movrf tot movrf tb addf stof to movif hui movrf hk mulf stof hot movrf hot movrf hb addf stof ho calcf ret ;---------------------- ;-------------------------------------- ;disp. disp ink ent ;scroll de variables segun jnz disp1 ;valor de scro jmp disp2 disp1 inc scro 1 movri scro movci 4 cpgi disp11 jmp disp2 disp11 movci 0 stoi scro ;--------------------- disp2 movri scro ;scro=0 muestra voltajes movci 0 cpei disp21 jmp disp3 disp21 set 118 reset 119 reset 120 reset 121 reset 122 clear disrf v1o 41 com 0 clear disrf v2o 41 com 1 clear disrf v3o 41 com 2 disp3 movri scro ;scro=1 muestra corrientes movci 1 cpei disp31 jmp disp4 disp31 reset 118 set 119 reset 120 reset 121 reset 122 clear disrf i1o 43 com 0 clear disrf i2o 43 com 1 clear disrf i3o 43 com 2 disp4 movri scro ;scro=2 muestra t y h y p movci 2 cpei disp41 jmp disp5 disp41 reset 118 reset 119 set 120 reset 121 reset 122 clear disrf to 41 com 0 clear disrf ho 41 com 1 movrf v1o ;potencia 1 movrf i1o mulf stof p1o movrf v2o ;potencia2 movrf i2o mulf stof p2o movrf v3o ;potencia3 movrf i3o mulf stof p3o movrf p1o ;potencia total movrf p2o addf movrf p3o addf stof pt clear disrf pt 4 com 2 disp5 movri scro ;scro=0 muestra voltajesxtap movci 3 cpei disp51 jmp disp6 disp51 reset 118 reset 119 reset 120 set 121 reset 122 movrf vtap movrf vmax divf movcf 2 divf movrf v1o mulf stof v1otap clear disrf v1otap 41 ;v1 con tap com 0 movrf vtap movrf vmax divf movcf 2 divf movrf v2o mulf stof v2otap clear disrf v2otap 41 ;v2 con tap com 1 movrf vtap movrf vmax divf movcf 2 divf movrf v3o mulf stof v3otap clear disrf v3otap 41 ;v3 con tap com 2 disp6 movri scro ;scro=1 muestra corrientes movci 4 cpei disp61 jmp dispf disp61 reset 118 reset 119 reset 120 reset 121 set 122 movrf itap movrf imax divf movcf 2 divf movrf i1o mulf stof i1otap clear disrf i1otap 43 ;i1 con tap com 0 movrf itap movrf imax divf movcf 2 divf movrf i2o mulf stof i2otap clear disrf i2otap 43 ;i2 con tap com 1 movrf itap movrf imax divf movcf 2 divf movrf i3o mulf stof i3otap clear disrf i3otap 43 ;i3 con tap com 2 dispf ret ;-------------------------------------- ;cali. cali clear disl calib com 0 clear disl e-c com 1 ink ent jnz cali1 ink cle jnz cali6 jmp cali cali1 clear ;calibra V-I disl cien ;100% com 0 clear disl e-c com 1 clear com 2 ink ent jnz cali11 ink cle jnz calif jmp cali1 cali11 movri v1i ;si es 0 el valor fuera.... movci 0 cpei calif movri v2i ;si es 0 el valor fuera.... movci 0 cpei calif movri v3i ;si es 0 el valor fuera.... movci 0 cpei calif movri i1i ;si es 0 el valor fuera.... movci 0 cpei calif movri i2i ;si es 0 el valor fuera.... movci 0 cpei calif movri i3i ;si es 0 el valor fuera.... movci 0 cpei calif cali2 movif v1i ;X1 de v1 stof v1xh movif v2i stof v2xh movif v3i stof v3xh movif i1i ;X1 de I1 stof i1xh movif i2i stof i2xh movif i3i stof i3xh cali3 clear disl cincu ;50% com 0 clear disl e-c com 1 clear com 2 ink ent jnz cali31 ink cle jnz calif jmp cali3 cali31 movri v1i ;si es 0 el valor fuera.... movci 0 cpei calif movri v2i ;si es 0 el valor fuera.... movci 0 cpei calif movri v3i ;si es 0 el valor fuera.... movci 0 cpei calif movri i1i ;si es 0 el valor fuera.... movci 0 cpei calif movri i2i ;si es 0 el valor fuera.... movci 0 cpei calif movri i3i ;si es 0 el valor fuera.... movci 0 cpei calif cali4 movif v1i stof v1xl movif v2i stof v2xl movif v3i stof v3xl movif i1i stof i1xl movif i2i stof i2xl movif i3i stof i3xl cali5 movrf v1xh movrf v1xl subf stof v1x ;X1-XO movrf vmax ;es el 50% del valor final movrf v1x divf stof v1k ;Y1-Y0 / X1-XO movrf v1k movrf v1xl mulf stof v1mx ; K * XO movrf vmax movrf v1mx subf stof v1b ;B = YO - K*XO movrf v2xh movrf v2xl subf stof v2x movrf vmax movrf v2x divf stof v2k movrf v2k movrf v2xl mulf stof v2mx movrf vmax movrf v2mx subf stof v2b movrf v3xh movrf v3xl subf stof v3x movrf vmax movrf v3x divf stof v3k movrf v3k movrf v3xl mulf stof v3mx movrf vmax movrf v3mx subf stof v3b movrf i1xh movrf i1xl subf stof i1x movrf imax movrf i1x divf stof i1k movrf i1k movrf i1xl mulf stof i1mx movrf imax movrf i1mx subf stof i1b movrf i2xh movrf i2xl subf stof i2x movrf imax movrf i2x divf stof i2k movrf i2k movrf i2xl mulf stof i2mx movrf imax movrf i2mx subf stof i2b movrf i3xh movrf i3xl subf stof i3x movrf imax movrf i3x divf stof i3k movrf i3k movrf i3xl mulf stof i3mx movrf imax movrf i3mx subf stof i3b cali6 clear ;calibracion temp disl calit com 0 clear disl e-c com 1 ink ent jnz cali61 ink cle jnz cali7 jmp cali6 cali61 clear ;pregunta por un password 1234 disl passw com 0 clear com 1 ini 2 stoi pass movri pass ;si es igual entra a calibrar movci 1234 cpei cali62 jmp cali7 ;si no va a humedad cali62 clear ;dato Y1 temp high disl te-h com 0 clear com 1 inf 2 2 stof yth movif tei ;dato X1 stof xth clear ;dato YO temp low disl te-l com 0 clear com 1 inf 2 2 stof ytl movif tei ;dato XO stof xtl movrf xth ;X1-XO movrf xtl subf stof tx movrf yth ;Y1-YO movrf ytl subf stof ty movrf ty ;Y1-Y0 / X1-XO movrf tx divf stof tk movrf tk ; K * XO movrf xtl mulf stof tmx movrf ytl ;B = YO - K*XO movrf tmx subf stof tb cali7 clear ;calibracion humedad disl calih com 0 clear disl e-c com 1 ink ent jnz cali70 ink cle jnz cali8 jmp cali7 cali70 clear ;pregunta por un password 1234, humedad disl passw com 0 clear com 1 ini 2 stoi pass movri pass ;si es igual entra a calibrar movci 1234 cpei cali71 jmp cali8 ;si no va a rs232 cali71 clear ;dato Y1 humedad high disl hu-h com 0 clear com 1 inf 2 2 stof yhh movif hui ;dato X1 stof xhh clear ;dato YO humedad low disl hu-l com 0 clear com 1 inf 2 2 stof yhl movif hui ;dato XO stof xhl movrf xhh ;X1-XO movrf xhl subf stof hx movrf yhh ;Y1-YO movrf yhl subf stof hy movrf hy ;Y1-Y0 / X1-XO movrf hx divf stof hk movrf hk ; K * XO movrf xhl mulf stof hmx movrf yhl ;B = YO - K*XO movrf hmx subf stof hb cali8 clear disl r232 com 0 clear disl e-c com 1 ink ent jnz cali80 ink cle jnz cali9 jmp cali8 cali80 clear ;pregunta por un password 1234 disl passw com 0 clear com 1 ini 2 stoi pass movri pass ;si es igual entra a calibrar movci 1234 cpei cali81 jmp cali9 ;si no va a 9 cali81 ini 2 stoi pueron cali9 clear disl eepr com 0 clear disl e-c com 1 ink ent jnz cali91 ink cle jnz calif jmp cali9 cali91 clear ;pregunta por un password 1234 disl passw com 0 clear com 1 ini 2 stoi pass movri pass ;si es igual entra a calibrar movci 1234 cpei cali92 jmp calif ;si no va a fin cali92 clear disl tkd com 0 clear com 1 inf 2 3 stof 408 clear disl hkd com 0 clear com 1 inf 2 3 stof 409 clear disl hbd com 0 clear com 1 inf 2 1 stof 416 clear disl tbd com 0 clear com 1 inf 2 1 stof 417 calif ret ;------------------------------------------- &leavar ;[REG_RELAYS] ent equ 30 cle equ 31 arr equ 32 izq equ 33 multi equ 400 ;registro aux para cierre multi envia lv auxon equ 900 ;[REG_INTEGERS] v1i equ 110 v2i equ 111 v3i equ 112 i1i equ 113 i2i equ 114 i3i equ 115 tei equ 116 hui equ 117 scro equ 150 ;scroll para display pass equ 151 ;password para comparar con 1234 pueron equ 1100 ;envia datos de t y h al com3 ;[REG_FLOATS] i1o equ 120 ;corriente 1 entregada i2o equ 121 i3o equ 122 v1o equ 123 v2o equ 124 v3o equ 125 to equ 126 ho equ 127 i1ot equ 130 ;corriente 1 entregada temporales i2ot equ 131 i3ot equ 132 v1ot equ 133 v2ot equ 134 v3ot equ 135 tot equ 136 hot equ 137 v1xl equ 140 v2xl equ 141 v3xl equ 142 i1xl equ 143 i2xl equ 144 i3xl equ 145 v1xh equ 150 v2xh equ 151 v3xh equ 152 i1xh equ 153 i2xh equ 154 i3xh equ 155 v1x equ 160 v2x equ 161 v3x equ 162 i1x equ 163 i2x equ 164 i3x equ 165 v1mx equ 180 v2mx equ 181 v3mx equ 182 i1mx equ 183 i2mx equ 184 i3mx equ 185 p1o equ 190 p2o equ 191 p3o equ 192 pt equ 193 vtap equ 200 ;envia lv itap equ 201 ;envia lv v1otap equ 210 v2otap equ 211 v3otap equ 212 i1otap equ 213 i2otap equ 214 i3otap equ 215 yth equ 220 ytl equ 221 xth equ 222 xtl equ 223 tx equ 224 ty equ 225 tmx equ 226 yhh equ 230 yhl equ 231 xhh equ 232 xhl equ 233 hx equ 234 hy equ 235 hmx equ 236 vmax equ 400 ;vmax patron imax equ 401 ;imax patron v1k equ 402 ;factor de v1 v2k equ 403 v3k equ 404 i1k equ 405 i2k equ 406 i3k equ 407 tk equ 408 hk equ 409 v1b equ 410 v2b equ 411 v3b equ 412 i1b equ 413 i2b equ 414 i3b equ 415 hb equ 416 tb equ 417 ;[TIM] ;[CNT] ;[NOP] calib lite "V-I" e-c lite "E-C?" cien lite "100" cincu lite "50" calit lite "TEM" calih lite "HUM" te-h lite "T-H" te-l lite "T-L" hu-h lite "H-H" hu-l lite "H-L" r232 lite "R232" tempe lite "T" hume lite "H" arrob lite "@" passw lite "pass" eepr lite "eepr" tkd lite "tk2" hkd lite "hk" tbd lite "tb" hbd lite "hb" ;inicio variables reset multi set auxon ;Landis ; movcf 120 stof vmax ; movcf 0.5 stof imax ;Zera ; ; movcf 60 ; stof vmax ; ; movcf 2.5 ; stof imax &leavarf ret ;----------------------------------------------- INICIO nop FIN end