;******* b o y a c a ****** mida 14 ;teclas tenter equ 30 tclear equ 31 tarrib equ 32 tizq equ 33 ;reles rseg equ 35 led124 equ 124 led125 equ 125 flag equ 150 cambio equ 151 treg equ 48 ;enteros ch0 equ 110 ch1 equ 111 cte161 equ 150 cte162 equ 151 mensaje equ 152 dato equ 153 fmt equ 154 cte163 equ 155 cte164 equ 156 hora equ 97 min equ 98 seg equ 96 mes equ 102 dia equ 101 ;temporizadores tempo equ 49 ;32bit temp equ 0 hr equ 1 mx1 equ 2 maxtemp equ 3 mintemp equ 4 maxhum equ 5 minhum equ 6 mv equ 7 cte321 equ 8 cte322 equ 9 cte323 equ 10 ajustemp equ 11 ajusthum equ 12 ;texto tempe equ 4 hume equ 5 ; ***** inicio **** movcf 0 ;inicializacion de variables stof maxtemp movcf 0 stof maxhum movcf 100 stof mintemp movcf 100 stof minhum setri mensaje 0 setri dato 3 setri fmt 51 clear com 2 inicio setri cte161 16000 ;inicio del programa setri cte162 1324 ;constantes de conversion del canal analogo setri cte163 288 setri cte164 1000 movif cte162 ;calculo pendiente de recta movif cte164 mulf stof cte323 movrf cte323 movif cte163 addf stof cte323 next ld tenter ld tclear andld jnz calibra ;carga rutina de calibracion movif ch0 ;lectura canal analogo temperatura movrf cte323 divf stof mv movif cte164 movrf mv mulf stof mv movrf mv ;convierte de mv a grados centig movcf 4 subf stof cte321 movcf 95 ;conversion de mv a grados centigrados movcf 16 divf movrf cte321 mulf movrf ajustemp subf stof temp ;calculo final de temperatura clear disrf temp 51 ;visualizacion de la temperatura calculada com 0 movif ch1 ;lectura del canal analogo para humedad movrf cte323 divf stof mv movif cte164 movrf mv mulf stof mv movrf mv movcf 4 subf stof cte322 ;calcula de la humedad relativa de mv a h% movrf cte322 movcf 0.16 divf movrf ajusthum addf stof hr ;almacenamiento del calculo final de humedad clear disrf hr 51 ;visualizacion de la humedad obtenida com 1 estadist movrf maxtemp ;deteccion de maxima temperatura movrf temp cpgf mint movrf temp stof maxtemp ;deteccion de minima temperatura mint movrf temp movrf mintemp cpgf maxh movrf temp stof mintemp maxh movrf maxhum ;deteccion de maxima humedad movrf hr cpgf minh movrf hr stof maxhum minh movrf hr movrf minhum ;deteccion de minima humedad cpgf reset movrf hr stof minhum reset ld tclear ;rutina para limpiar com 2 e reiniciar variables jz visual clear com 2 end visual ld tarrib ;**** rutina de visualizacion de valores max y min en anillo**** tim tempo 5 ;temporizador para deteccion de pulsacion tecla arriba out flag ld flag jz inicio reset flag set led124 otro clear ;limpia display com 2 com 2 loc 1 dislx mensaje ;visualiza texto "t,t,h,h" loc 2 disfx dato fmt ;muestra registros de max y min en temp y hr com 2 reset led124 movri mensaje ;control del loop de visualizacion movci 1 addi stoi mensaje movri dato movci 1 addi stoi dato ld flag tim tempo 5 out flag movri dato ;maximo numero de mensajes =6 movci 7 cplei inicio setri dato 3 setri mensaje 0 jmp otro calibra clear disl temp com 0 clear disrf ajustemp 51 com 1 clear inf 2 1 stof ajustemp clear disl hume com 0 clear disrf ajusthum 51 com 1 clear inf 2 1 stof ajusthum jmp inicio