mida 14 ;------------------------------------------------------------- ;Aplicación -> ;Fecha -> ;los registros ;vmax=registro 400 eeprom imax=registro 401 eeprom entra a mano ;------------------------------------------------------------- scan equ 99 ;programa principal--------------------------------------- &ini ld scan jz &lea jmp ini0 &lea call &leavar ini0 nop call calc call disp call limi ld arr and izq jnz ini2 jmp ini4 ini2 call cali ini4 inif end ;--------------------------- calc 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 clear disrf to 41 com 0 clear disrf ho 41 com 1 dispf ret ;-------------------------------------- ;cali. cali clear disl calib com 0 clear disl e-c com 1 ink ent jnz cali ink cle jnz cali6 jmp cali 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 ;dato Y1 temp high disl te-h com 0 clear com 1 ini 2 stoi ythi movif ythi stof yth movif tei ;dato X1 stof xth clear ;dato YO temp low disl te-l com 0 clear com 1 ini 2 stoi ytli movif ytli 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 cali71 ink cle jnz cali8 jmp cali7 cali71 clear ;dato Y1 humedad high disl hu-h com 0 clear com 1 ini 2 stoi yhhi movif yhhi stof yhh movif hui ;dato X1 stof xhh clear ;dato YO humedad low disl hu-l com 0 clear com 1 ini 2 stoi yhli movif yhli 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 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 ;[REG_INTEGERS] tei equ 116 hui equ 117 scro equ 120 ;scroll para display ythi equ 121 ytli equ 122 yhhi equ 123 yhli equ 124 ;[REG_FLOATS] to equ 126 ho equ 127 tot equ 136 hot equ 137 p1o equ 190 p2o equ 191 p3o equ 192 pt equ 193 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 tk equ 408 hk equ 409 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" ;inicio variables &leavarf ret ;-----------------------------------------------