4698 lines
152 KiB
HTML
4698 lines
152 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>EL RINCON DEL MICRO...ST6...METEO</TITLE>
|
|
|
|
<META NAME="GENERATOR" CONTENT="Internet Assistant for Microsoft Word 2.0z">
|
|
</HEAD>
|
|
<BODY BACKGROUND="../fondo.jpg">
|
|
<HR>
|
|
<H3><CENTER>EL RINCON DEL MICRO…ST6…APLICACIÓN
|
|
METEO </CENTER></H3>
|
|
<HR>
|
|
<P>
|
|
<TT><FONT FACE="Courier">VI-a) DESCRIPCIÓN DE "METEO"<!--VI-a) DESCRIPCIÓN DE METEO--></FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">METEO es un sistema de estación
|
|
meteorológica controlada por PC y basada en el microcontrolador
|
|
ST62E15 de SGS-THONSOM. METEO es capaz de llevar un control de
|
|
temperaturas, presiones y dirección del viento además
|
|
de poder llevar un registro exhaustivo (mediante spoiler de datos
|
|
a un fichero ASCII) de todas las temperaturas.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Se puede dividir a METEO en dos partes,
|
|
el programa de control del PC y la placa de adquisición
|
|
de datos y registro de los mismos. </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">El PC por tener una mayor capacidad de
|
|
calculo se encarga de la visualización de datos en sus
|
|
escalas correctas y del registro en fichero, además de
|
|
ir ordenando a la placa de adquisición de datos el envió
|
|
de los mismos. La presentación de los datos la realiza
|
|
sobre una pantalla de presentación en la que además
|
|
se pueden elegir todas las opciones disponibles. La pantalla la
|
|
podemos observar en la FIG 6.1. Este programa ha sido realizado
|
|
en Qbasic de Microsoft<BR>
|
|
</FONT></TT>
|
|
<HR>
|
|
<P>
|
|
<CENTER><IMG SRC="IMG00012.GIF"></CENTER>
|
|
<HR>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Dentro de ella podemos distinguir varias
|
|
partes.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La parte central dedicada a la veleta,
|
|
en ella se muestra el estado actual de la veleta mediante un flecha.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La esquina superior izquierda esta dedicada
|
|
a la temperatura, en ella se muestra la temperatura actual, las
|
|
temperaturas máximas y mínimas registradas por el
|
|
microcontrolador, y la temperatura media determinada por la suma
|
|
de los valores de temperatura actual entre en nº de muestreos
|
|
realizados desde la ultima conexión del programa de visualización.
|
|
Los datos presentados están en grados centígrados.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La esquina inferior izquierda esta dedicada
|
|
a las presiones, funcionando de manera similar al termómetro
|
|
exceptuando que no presenta la presión media. Las unidades
|
|
utilizadas son los Bares.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">En la ultima línea del lado izquierdo
|
|
se visualiza el nombre del programa así como su versión.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La esquina superior derecha esta dedicada
|
|
a la gráfica de temperatura, esta gráfica se compone
|
|
mediante los datos leídos de temperatura actual.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La parte central de la columna derecha
|
|
muestra la hora y la fecha actual tomados directamente del reloj
|
|
del sistema del PC.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La parte inferior derecha muestra el
|
|
menú de opciones seleccionables mediante las teclas de
|
|
función del teclado, las opciones disponibles son las siguientes:
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">F1: ACERCA DE .. </FONT></B><FONT FACE="Courier">:
|
|
Muestra la versión del programa así como el nombre
|
|
de los programadores (FIG 6.2), se vuelve a la pantalla de control
|
|
mediante la pulsación de cualquier tecla.<BR>
|
|
</FONT></TT>
|
|
<HR>
|
|
<P>
|
|
<CENTER><IMG SRC="IMG00013.GIF"></CENTER>
|
|
<HR>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">F2: CONFIGURAR: </FONT></B><FONT FACE="Courier">Con
|
|
esta opción primero se seleccionara el puerto de trabajo,
|
|
una vez seleccionado se mostraran las direcciones del puerto,
|
|
a continuación se configurara el tipo de ordenador pudiendo
|
|
elegir entre un 8086, un 80386 y un 80486, después se elegirá
|
|
el intervalo con el cual se realizara el traspaso de datos de
|
|
temperatura entre 1 segundo a 24h introduciendo el tiempo en segundos,
|
|
después se reiniciará el programa.</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">F3: SALIR AL DOS: </FONT></B><FONT FACE="Courier">Con
|
|
esta opción se vuelve al símbolo del sistema.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Descripción de ficheros que deben
|
|
existir en el directorio de trabajo.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">METEO.EXE Es el fichero del
|
|
programa</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">METEO.CFG Es el fichero de configuración</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">METEO.DAT Es le fichero en el que
|
|
se guardan los datos del spoiler de temperaturas.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La placa de adquisición de datos
|
|
y por lo tanto el ST6, se encarga de tomar los datos de los sensores
|
|
de temperatura y presión que son valores analógicos
|
|
y de convertirlos en valores digitales, después de esta
|
|
conversión se encarga de determinar si estos datos son
|
|
mínimos o máximos y en caso de cumplir una de esas
|
|
dos condiciones los almacena en sus registros correspondientes,
|
|
así mismo adquiere la posición de la veleta. EL
|
|
ST6 a su vez se encarga de mandar los datos a medida que el PC
|
|
los requiere.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La placa del ST6 es capaz de trabajar
|
|
independientemente del PC llevando un control de la tempereraturas
|
|
y presiones máximas y mínimas además de las
|
|
actuales. El programa para el PC es incapaz de funcionar sin la
|
|
estación meterologica conectada.</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-b) Esquemas y explicación
|
|
del circuito</FONT></B><!----><FONT FACE="Courier">VI-b) Esquemas y explicación del circuito</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">El esquema de la estación metereologica
|
|
se puede dividir en varias partes diferentes:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">- Fuente de alimentación</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">- Adaptadores de tensión de los
|
|
sensores</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">- Zona de transferencia de datos</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">- Microcontrolador.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La fuente de alimentación tiene
|
|
como función el estabilizar y limitar la tensión
|
|
que puede recibir el ST6, esta etapa debe de alimentarse con tensión
|
|
continua de por lo menos 8 V por que es la tensión mínima
|
|
para que funcione correctamente el 7805.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Los adaptadores para los sensores tienen
|
|
como función la de dividir entre dos la tensión
|
|
entregada por estos, esto debe realizarse por que los sensores
|
|
entregan tensión entre 0 y 10V y el ST6 solo puede convertir
|
|
hasta 5V.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La zona de transferencia de datos esta
|
|
constituida por los buffers 74LS245, estos buffers tienen como
|
|
función la de proteger al ST6 y al puerto Paralelo del
|
|
ordenador frente de posibles averías, la conexión
|
|
al PC se realiza mediante un conector de 25 patillas.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">El microcontrolador se encarga de la
|
|
conversión y adquisición de datos así como
|
|
de llevar el control de temperaturas y presiones máximas
|
|
y mínimas, así como las comunicaciones con el PC.
|
|
El microcontrolador lleva un circuito de Reset que se activa la
|
|
aplicar la alimentación, así como su correspondiente
|
|
circuito oscilador a 8 Mhz.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Los faston nombrados como PA7 y PA6 tienen
|
|
como función adquirir los datos analógicos, los
|
|
PC4, PC5 y PC6 tienen como función la adquisición
|
|
de los datos de la veleta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">El esquema completo y los fotolitos de
|
|
circuito impreso se encuentran en las páginas siguientes.
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-c) SISTEMA DE COMUNICACIONES</FONT></B><!----><FONT FACE="Courier">VI-c) SISTEMA DE COMUNICACIONES</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-c,I) PROBLEMAS Y SOLUCIONES </FONT></B><!----><FONT FACE="Courier">VI-c,I) PROBLEMAS Y SOLUCIONES <B>:</B></FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La estación metereológica
|
|
se comunica a través del puerto paralelo CENTRONICS del
|
|
PC. Se plantea entonces el problema de que el puerto paralelo
|
|
es unidireccional (salida del PC). El puerto paralelo consta de
|
|
3 registros uno de datos, uno de control y otro de estado. El
|
|
registro de datos tiene asociadas 8 líneas que son las
|
|
de salida de datos. El de estado tiene asociadas 6 líneas
|
|
una de salida y 5 de entrada. El de control nosotros no lo utilizaremos.
|
|
Las 8 líneas de salida de datos son unidireccionales por
|
|
lo tanto se plantea el problema de hacer que el PC pueda recibir
|
|
datos. La única manera de conseguirlo sería enviarle
|
|
los datos a través de las líneas de estado, esto
|
|
nos lleva a un nuevo problema, que sólo existen 5 líneas
|
|
de estado, tendremos entonces que enviar los datos de 4 en 4 bits
|
|
y la línea que sobra la utilizaremos para indicar "dato
|
|
listo" al PC, los bits del registro de estado donde se encontraran
|
|
los datos enviados por la estación son los 4 de mayor peso,
|
|
y el que indica dato listo es el bit 3. Existe el problema también
|
|
de que el PC lee del registro el bit 6 invertido de su valor lógico
|
|
por lo tanto había que invertirlo, de esto se encarga el
|
|
programa ensamblador del ST6. El PC enviará datos a la
|
|
estación sólo con los 4 bits de menor peso de las
|
|
líneas de datos, no se utilizan las otras 4 ya que no son
|
|
necesarias debido al protocolo de comunicaciones establecido.
|
|
Para indicar el PC a la estación su requerimiento de datos
|
|
se utiliza la línea STROBE que se controla mediante un
|
|
bit del registro de estado del puerto paralelo. </FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-c,II) DESCRIPCION DEL SISTEMA DE
|
|
PROTOCOLO </FONT></B><!----><FONT FACE="Courier">VI-c,II) DESCRIPCION DEL SISTEMA DE PROTOCOLO <B>:</B></FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Nada mas conectarse la alimentación
|
|
a la estación metereológica el ST6 entra en un bucle
|
|
de 5 segundos para conseguir que las sondas de temperatura y presión
|
|
estén ya estabilizadas para cuando se vaya a iniciar la
|
|
conversión. Después de ese ciclo de 5 segundos el
|
|
MCU entra en un bucle cerrado de espera de interrupción,
|
|
mientras en ese bucle el MCU está realizando las conversiones
|
|
oportunas y llevándolas a posiciones de memoria, también
|
|
está determinando las temperaturas y presiones máximas
|
|
y mínimas. El PC entonces será capaz de interrumpir
|
|
al ST6 para pedir la información que necesite. El programa
|
|
del PC sólo interrumpirá al MCU si este le indica
|
|
que está permitido y para indicarlo lo que hace es enviar
|
|
un 5h a la entrada del PC. El programa del PC comprueba que ese
|
|
5h existe y si existe saca por su bus de datos el código
|
|
correspondiente a la información que quiere, Después
|
|
interrumpe al ST6 mediante la línea STROBE. Una vez que
|
|
el ST6 ha sido interrumpido saca un 0 a la salida para que el
|
|
PC sepa que no puede volver a interrumpirle. El PC espera entonces
|
|
a que la línea de "dato listo" se active para
|
|
saber que los 4 bits de mayor peso están en la entrada,
|
|
cuando esta línea es activada por el ST6 el PC recoge los
|
|
datos de la entrada y saca un 08h al bus de datos para indicar
|
|
que ha recogido el dato. Cuando el ST6 detecta ese 08h desactiva
|
|
la línea de "dato listo" y saca los 4 bits de
|
|
menor peso y vuelve a activar "dato listo", el PC estaba
|
|
esperando de nuevo esta señal y una vez detectada recoge
|
|
el dato. </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Una vez que se ha recogido el dato el
|
|
PC saca a la salida un 09h para indicar al ST6 que se ha recibido
|
|
el dato de parte baja. El ST6 cuando detecta el 09h retorna de
|
|
la interrupción al programa principal y saca de nuevo a
|
|
la salida un 05h para indicar que esta listo para ser interrumpido
|
|
nuevamente. En el caso de la veleta se manda el estado de la veleta
|
|
en un sólo nibble ya que ese dato es de tan sólo
|
|
3 bits.</FONT></TT>
|
|
<P>
|
|
<TT><I><FONT FACE="Courier">Tabla de códigos de comunicaciones</FONT></I><FONT FACE="Courier">
|
|
:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PC ----> ST6 </FONT></TT>
|
|
<TABLE BORDERCOLOR=#000000 BORDER=1>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> CÓdigo</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">DESCRIPCION DE CODIGO</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 01h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Temperatura Actual</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 02h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Presión Actual</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 03h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Veleta</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 04h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Temperatura mínima</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 05h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Temperatura máxima</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 06h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Presión mínima</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 07h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Presión máxima</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 08h</FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Dato recibido (parte alta)</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=105><BR>
|
|
<TT><FONT FACE="Courier"> 09h </FONT></TT>
|
|
</TD><TD WIDTH=460><BR>
|
|
<TT><FONT FACE="Courier">Dato recibido (parte baja)</FONT></TT>
|
|
</TD></TR>
|
|
</TABLE>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ST6 ----> PC</FONT></TT>
|
|
<TABLE BORDERCOLOR=#000000 BORDER=1>
|
|
<TR><TD WIDTH=109><BR>
|
|
<TT><FONT FACE="Courier"> Código </FONT></TT>
|
|
</TD><TD WIDTH=454><BR>
|
|
<TT><FONT FACE="Courier">DESCRIPCION DEL CODIGO</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=109><BR>
|
|
<TT><FONT FACE="Courier"> 05h</FONT></TT>
|
|
</TD><TD WIDTH=454><BR>
|
|
<TT><FONT FACE="Courier">ST6 puede ser interrumpido</FONT></TT>
|
|
</TD></TR>
|
|
<TR><TD WIDTH=109><BR>
|
|
<TT><FONT FACE="Courier"> 00h</FONT></TT>
|
|
</TD><TD WIDTH=454><BR>
|
|
<TT><FONT FACE="Courier">ST6 no puede se interrumpido</FONT></TT>
|
|
</TD></TR>
|
|
</TABLE>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-d,I) PROGRAMA BASIC PARA "METEO"
|
|
</FONT></B><!----><FONT FACE="Courier">VI-d,I) PROGRAMA BASIC PARA METEO <B>:
|
|
<BR>
|
|
</B></FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">LISTADO DEL PROGRAMA . . .<BR>
|
|
<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************
|
|
*************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************* PROYECTO DE PRACTICAS
|
|
PARA ST6 ­ 5.C. 1994 *************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************
|
|
*************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******
|
|
********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****** José Ignacio Díaz
|
|
Beamud & Jesús Antonio Alquezar Sierra ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******
|
|
********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****** Estación meteorológica
|
|
por ST6 controlada por PC ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******
|
|
********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************************
|
|
INICIO PROGRAMA ****************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ON ERROR GOTO er: REM **** Activa la
|
|
detección de error por si no hay conf.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">KEY(2) STOP: REM **** Desactiva momentaneamente
|
|
la F2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temmed = 0: REM **** Temperatura media
|
|
= 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">media = 1: REM **** Datos de temperatura
|
|
cogida = 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ero = 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **************** Borra fichero METEO.DAT
|
|
y lo crea nuevo ****************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">propri:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OPEN "METEO.DAT" FOR OUTPUT
|
|
AS #3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLOSE #3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************
|
|
Crea fichero temperaturas *************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OPEN "METEO.DAT" FOR OUTPUT
|
|
AS #3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, "Control de Datos de Temperatura
|
|
­ **** METEO.EXE V5.00 **** ­"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, "Temp. Actual
|
|
Hora Máxima Mínima Media"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, "­­­­­­­­­­­­­­­­­­­­­­­­­­
|
|
­­­­­­­­­­­­­­­­­­­­­­­­"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **********************************
|
|
Lee fichero de configuración *********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OPEN "METEO.CFG" FOR INPUT
|
|
AS #2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT #2, dato%: REM **** Lee dirección
|
|
de puerto de LPT (datos)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT #2, esta%: REM **** Lee dirección
|
|
de estado</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT #2, ctrl%: REM **** Lee dirección
|
|
de control</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT #2, equi: : REM **** Lee tipo de
|
|
equipo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT #2, tifi%: : REM **** Lee tiempo
|
|
de escritura en fichero</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLOSE #2: REM **** Cierra fichero<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OUT (dato%), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comin:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB pontem: REM **** Va a determinar
|
|
las variables de temporizador<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SCREEN 2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "METEO.EXE V5.00 23­MAYO­1994"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT " Estacion meteorologica
|
|
por ST6 controlada por PC"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT " por Jose Ignacio
|
|
Diaz Beamud & Jesus Antonio Alquezar Sierra"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Hace efecto pantalla inicial ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR x = 25 TO 620</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (25, 107)­(x, 107)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO linei: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT x</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR x = 620 TO 25 STEP ­1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (620, 109)­(x, 109)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO linei: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT x</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR t = 1 TO 10</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR r = 1 TO 15</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CIRCLE (620, 107), r</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO circi: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT r</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR r = 1 TO 15</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CIRCLE (620, 107), r, 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO circi: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT r</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT t<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Fin de efecto *******************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SCREEN 2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 25, 66: PRINT "PROYECTO ST6"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 25, 2: PRINT "METEO.EXE V5.00"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (150, 3)­(490, 195), , B: REM
|
|
** CREA EL RECUADRO DE VELETA ***<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************
|
|
DIBUJA LA N DE NORTE ***********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 50)­(300, 40)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 40)­(340, 50)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 50)­(340, 40)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA S DE SUR *************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 160)­(300, 160)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 160)­(340, 155)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 155)­(300, 155)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 155)­(300, 150)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 150)­(340, 150)<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA E DE ESTE ************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 95)­(440, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 95)­(480, 95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 105)­(480, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 100)­(480, 100)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA O DE OESTE ***********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (200, 95)­(200, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (200, 105)­(160, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (160, 105)­(160, 95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (160, 95)­(200, 95)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
RECUADRO DE TEMPERATURA ***<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (1, 3)­(140, 100), , B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 1, 4: PRINT " Termometro
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 4, 2: PRINT " Temp : 00.0C"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 6, 2: PRINT " Max : 00.0C"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 8, 2: PRINT " Min : 00.0C"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 2: PRINT " Med : 00.0C"
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
RECUADRO DE PRESION ******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (1, 108)­(140, 190), , B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 14, 4: PRINT " Manometro
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 17, 2: PRINT "Pres : 00 B."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 19, 2: PRINT "Max : 00 B."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 21, 2: PRINT "Min : 00 B."
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
RECUADRO GRAFICA TEMP. ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">xgraf = 516</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (500, 3)­(639, 50), , B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 1, 65: PRINT " Grafica Temp.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 2, 64: PRINT "C"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (515, 10)­(515, 45)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (515, 45)­(630, 45)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
RECUADRO DE RELOJ *********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (500, 60)­(639, 110), , B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 8, 68: PRINT " Reloj "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 65: PRINT "Hora : 00:00:00"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 12, 65: PRINT "Dia: 00­00­0000"
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******************************************
|
|
Menu ***************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (500, 123)­(639, 190), , B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 16, 69: PRINT " Menu "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 18, 65: PRINT "F1­ ACERCA
|
|
DE.."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 19, 65: PRINT "F2­ CONFIGURAR
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 20, 65: PRINT "F3­ SALIR
|
|
A DOS"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 22, 66: PRINT "por J.I.DIAZ"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 23, 65: PRINT "y J.A.ALQUEZAR"
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **************************** DIBUJA
|
|
EL CONTORNO DE LA VELETA **</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 1, 24: PRINT " Veleta de
|
|
Estacion Meteorologica "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR N = 1 TO 100</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CIRCLE (320, 100), N</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO circv: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT N</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR N = 1 TO 90</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CIRCLE (320, 100), N, 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO circv: NEXT temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT N<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************ Abilita
|
|
interrupciones de teclas de funcion ***<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">KEY(3) ON</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ON KEY(3) GOSUB f3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">KEY(1) ON</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ON KEY(1) GOSUB f1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">KEY(2) ON</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ON KEY(2) GOSUB f2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Pido a ST6 temperatura máxima *******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tam:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO tam</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO sitam</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO tam<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte alta de temperatura max. ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">sitam:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 5: REM **** Pido
|
|
código Temperatura Máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">esptam:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO esptam: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacalta = (dtac AND 240):
|
|
REM **** Parte alta de Temperatura Máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************************
|
|
Parte Baja de Temperatua Máxima ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pe3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO pe3: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacbaja = (dtac AND 240) /
|
|
16: REM **** Parte Baja de Temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmax = ((dtacalta + dtacbaja)
|
|
* .01953) * 20: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 6, 9: PRINT USING "###.##";
|
|
temmax: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 6, 16: PRINT "C
|
|
"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Pido a ST6 temperatura mínima *******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tam2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO tam2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO sitam2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO tam2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte alta de temperatura min. ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">sitam2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 4: REM **** Pido
|
|
código Temperatura Mínima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">esptam2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO esptam2: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacalta = (dtac AND 240):
|
|
REM **** Parte alta de Temperatura Mínima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************************
|
|
Parte Baja de Temperatua Mínima ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pe32:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO pe32: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacbaja = (dtac AND 240) /
|
|
16: REM **** Parte Baja de Temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmin = ((dtacalta + dtacbaja)
|
|
* .01953) * 20: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 8, 9: PRINT USING "###.##";
|
|
temmin: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 8, 16: PRINT "C
|
|
"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pide de Presión Máxima ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pa2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO pa2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta31</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO pa2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Parte alta de Presión Máxima ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta31:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 7: REM **** Pido
|
|
código Presión Máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe41:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe41: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacalta = (pac AND 240): REM
|
|
**** Parte alta de Presión Máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte Baja de Presión Máxima ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe51:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe51: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacbaja = (pac AND 240) / 16:
|
|
REM **** Parte Baja de Presión Máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> premax = (((pacalta + pacbaja)
|
|
* .019) * 2) / 5: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 19, 9: PRINT USING "#.###";
|
|
premax: REM *** Limita presenta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 19, 15: PRINT "B.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pide de Presión Mínima ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pa3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO pa3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta32</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO pa3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Parte alta de Presión Mínima ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta32:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 6: REM **** Pido
|
|
código Presión Mínima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe42:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe42: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacalta = (pac AND 240): REM
|
|
**** Parte alta de Presión Mínima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte Baja de Presión Mínima ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe52:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe52: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacbaja = (pac AND 240) / 16:
|
|
REM **** Parte Baja de Presión Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> premin = (((pacalta + pacbaja)
|
|
* .019) * 2) / 5: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 21, 9: PRINT USING "#.###";
|
|
premin: REM *** Limita presenta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 21, 15: PRINT "B.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************************************
|
|
Activa el timer para fichero *****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">TIMER ON</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ON TIMER(tifi%) GOSUB fiche<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************
|
|
********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **************** Programa de salida
|
|
de datos (HORA) ********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************
|
|
********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rep:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">t$ = TIME$</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">d$ = DATE$</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 72: PRINT t$</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 12, 70: PRINT d$<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB lisinter</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOTO rep<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************** Subrutina
|
|
de COMUNICACIONES **********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">lisinter:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
RETURN: REM **** Testea bit de listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> RETURN: REM **** Comprueba
|
|
que se puede interrumpir a ST6<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pido dato de veleta ******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 3: REM **** Pido
|
|
código veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe1:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe1: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dv = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> datovel = (dv AND 240) / 16</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB dibujavel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *****************************************
|
|
Pide de Temperatura Actual ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ta:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO ta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO ta<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte alta de temperatura Actual ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 1: REM **** Pido
|
|
código Temperatura Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe2: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacalta = (dtac AND 240):
|
|
REM **** Parte alta de Temperatura Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************************
|
|
Parte Baja de Temperatua Actual ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe3: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dtacbaja = (dtac AND 240) /
|
|
16: REM **** Parte Baja de Temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temact = ((dtacalta + dtacbaja)
|
|
* .01953) * 20: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 4, 9: PRINT USING "###.##";
|
|
temact: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 4, 16: PRINT "C
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmd = (temact + temmd)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmed = temmd / media: REM
|
|
*** Suma media para calcular</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> media = media + 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 10, 9: PRINT USING "###.##";
|
|
temmed: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 10, 16: PRINT "C
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF temact > temmax THEN
|
|
GOSUB temmax: REM *** Determina si es máx.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF temact < temmin THEN
|
|
GOSUB temmin: REM *** Determina si es mín.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************************************
|
|
Dibuja Gráfica *************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> xgraf = xgraf + 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF xgraf = 629 THEN GOSUB borra</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ygraf = ABS(INT(temact ­
|
|
45))</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF ygraf < 10 THEN GOTO
|
|
pa:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PSET (xgraf, ygraf)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************
|
|
PIDE DATO DE VELETA ****<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
RETURN: REM **** Testea bit de listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta4:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> RETURN: REM **** Comprueba
|
|
que se puede interrumpir a ST6<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pido dato de veleta ******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta4:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 3: REM **** Pido
|
|
código veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe14:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe14: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dv = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> datovel = (dv AND 240) / 16</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB dibujavel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pide de Presión Actual ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pa:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO pa</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO pa<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Parte alta de Presión Actual ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 2: REM **** Pido
|
|
código Presión Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe4:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe4: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacalta = (pac AND 240): REM
|
|
**** Parte alta de Presión Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8: REM **** Indico
|
|
que ya he recibido el dato</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Parte Baja de Presión Actual ********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe5:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe5: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pac = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> pacbaja = (pac AND 240) / 16:
|
|
REM **** Parte Baja de Presión Actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 9: REM **** Indico
|
|
que ya he recibido el dato<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> preact = (((pacalta + pacbaja)
|
|
* .019) * 2) / 5: REM **** Calcula</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 17, 9: PRINT USING "#.###";
|
|
preact: REM *** Limita presenta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 17, 15: PRINT "B.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF preact > premax THEN
|
|
GOSUB premaxi: REM **** Determina máxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF preact < premin THEN
|
|
GOSUB premini: REM **** Determina mínima<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************
|
|
PIDE DATO DE VELETA ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
RETURN: REM **** Testea bit de listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dst6 = l6 AND 240</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dst6 = 80 THEN GOTO siesta41:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> RETURN: REM **** Comprueba
|
|
que se puede interrumpir a ST6<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************************
|
|
Pido dato de veleta ******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">siesta41:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 3: REM **** Pido
|
|
código veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB STROBE: REM **** Interrumpo
|
|
a ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB datemp<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">espe141:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> l6 = INP(esta%): REM **** Entra
|
|
datos de ST6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> listost6 = l6 AND 8: REM ****
|
|
Determina si el dato de ST6 está listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF listost6 <> 8 THEN
|
|
GOTO espe141: REM **** Si no esta espera</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dv = INP(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> datovel = (dv AND 240) / 16</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOSUB dibujavel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **************************************
|
|
Subrutina de STROBE***************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">STROBE:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> FOR temporiza = 1 TO stb: NEXT
|
|
temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (ctrl%), 0: REM **** Pongo
|
|
a nivel alto a STROBE</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> FOR temporiza = 1 TO stb: NEXT
|
|
temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (ctrl%), 1: REM **** Pongo
|
|
a nivel bajo a STROBE<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******************************************
|
|
Datos de Veleta **************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">dibujavel:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 4 THEN GOTO aba</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 0 THEN GOTO arri</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 6 THEN GOTO der</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 2 THEN GOTO izda</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 1 THEN GOTO no</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 7 THEN GOTO ne</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 3 THEN GOTO so</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF datovel = 5 THEN GOTO se</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">arri:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">aba:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">der:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">izda:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 4</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">no:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 7</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ne:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 9</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">so:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">se:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vi = ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ac = 3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOSUB vel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vel:<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SELECT CASE vi</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO aca<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(320,
|
|
70), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(330,
|
|
120), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(310,
|
|
120), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(320,
|
|
70), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 70)­(330, 80),
|
|
0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 70)­(310, 80),
|
|
0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(390,
|
|
100), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (390, 100)­(375,
|
|
95), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (390, 100)­(375,
|
|
105), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 4<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(390,
|
|
100), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(265,
|
|
95), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(265,
|
|
105), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 9</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(360,
|
|
80), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 80)­(355, 90),
|
|
0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 80)­(338, 83),
|
|
0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(360,
|
|
80), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(285,
|
|
110), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(302,
|
|
117), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 7<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(360, 120),
|
|
0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(285, 90),
|
|
0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(302, 83),
|
|
0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(360, 120),
|
|
0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 120)­(355,
|
|
110), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 120)­(338,
|
|
117), 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END SELECT<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SELECT CASE ac</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 0<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO aca<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(320,
|
|
70)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(330,
|
|
120)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(310,
|
|
120)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 8</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 130)­(320,
|
|
70)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 70)­(330, 80)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (320, 70)­(310, 80)
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(390,
|
|
100)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (390, 100)­(375,
|
|
95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (390, 100)­(375,
|
|
105)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 4<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(390,
|
|
100)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(265,
|
|
95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (250, 100)­(265,
|
|
105)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 9</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(360,
|
|
80)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 80)­(355, 90)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 80)­(338, 83)
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(360,
|
|
80)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(285,
|
|
110)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 120)­(302,
|
|
117)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 7<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(360, 120)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(285, 90)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(302, 83)
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (280, 80)­(360, 120)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 120)­(355,
|
|
110)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (360, 120)­(338,
|
|
117)<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">aca:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END SELECT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************
|
|
Opción F3 salir al DOS *************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">f3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">TIMER OFF</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SCREEN 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OUT (dato%), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, "Proyecto METEO ***********************************************"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #3, "** Jesús Antonio
|
|
Alquezar Sierra & José Ignacio Díaz Beamud **"
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLOSE #3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Software Estación
|
|
Meteorológica V5.00 ­ 23 de MAYO de 1994 ­"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Por Jesús Antonio
|
|
Alquezar Sierra & José Ignacio Díaz Beamud"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "____________________________________________________________"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************
|
|
Subrutina de borrado de Gráfica ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">borra:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (516, 10)­(629, 44), 0, BF</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">xgraf = 516</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ******************************************
|
|
Subrutina de AYUDA ***********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">f1:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> TIMER STOP</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> FOR yayu = 10 TO 185</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (159, 10)­(yayu * 1.75
|
|
+ 155, yayu), 1, B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> FOR temporiza = 1 TO ayu: NEXT
|
|
temporiza</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (159, 10)­((xayu *
|
|
1.75 + 155) ­ 1, yayu ­ 1), 0, B</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> NEXT<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 3, 23: PRINT "
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 4, 23: PRINT " ACERCA
|
|
ESTACION : "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 5, 23: PRINT " ­­­­­­­­­­­­­­­­­
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 7, 29: PRINT " Programa
|
|
Producido por : "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 8, 29: PRINT "
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 9, 29: PRINT "
|
|
J.I.D.B. & J.A.A.S. "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 11, 29: PRINT "
|
|
HARDWARE & SOFTWARE "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 12, 29: PRINT "
|
|
23 de MAYO de 1994. "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 15, 29: PRINT "
|
|
METEO.EXE V5.00 "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 20, 33: PRINT "­
|
|
PROYECTO ST6 ­"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 22, 32: PRINT "­
|
|
pulse una tecla ­"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PLAY "MBo3L8ED+ED+Eo2Bo3DCL2o2A"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tea:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF INKEY$ = "" THEN GOTO tea
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LINE (159, 10)­(478.75,
|
|
185), 0, BF<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *********************************
|
|
DIBUJA LA N DE NORTE ***********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 50)­(300, 40)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 40)­(340, 50)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 50)­(340, 40)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA S DE SUR *************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 160)­(300, 160)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 160)­(340, 155)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (340, 155)­(300, 155)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 155)­(300, 150)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (300, 150)­(340, 150)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA E DE ESTE ************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 95)­(440, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 95)­(480, 95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 105)­(480, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (440, 100)­(480, 100)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ****************************** DIBUJA
|
|
LA O DE OESTE ***********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (200, 95)­(200, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (200, 105)­(160, 105)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (160, 105)­(160, 95)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LINE (160, 95)­(200, 95)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR N = 90 TO 100</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CIRCLE (320, 100), N</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">NEXT N</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">TIMER ON</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **************************** Subrutina
|
|
de F2 que es configuracion *******</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">f2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLOSE #3</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">TIMER OFF</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pri:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SCREEN 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "******** Detección
|
|
de puerto CENTRONICS (paralelo) para IBM­PC ********"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "********
|
|
********"
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "******** José Ignacio
|
|
Diaz Beamud & Jesús Antonio Alquezar Sierra ********"
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **** Determina la base del puerto
|
|
base *********************************<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 12<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT "En que puerto LPT está
|
|
conectada la ESTACION (1,2,3)"; p</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF p = 1 THEN BB = 8: ba = 9: GOTO in</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF p = 2 THEN BB = 10: ba = 11: GOTO
|
|
in</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF p = 3 THEN BB = 12: ba = 13: GOTO
|
|
in</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOTO pri<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">in:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">LOCATE 10, 12: PRINT "
|
|
"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> DEF SEG = 64: REM **** Pone la memoria
|
|
en el segmento 64</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> datosb% = PEEK(BB): REM **** Saca el
|
|
primer byte (bajo)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> datosa% = PEEK(ba): REM **** Saca el
|
|
segundo byte (alto)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> REM **** La suma determina la posicion
|
|
de LPT **** posicion 0040:0008</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dato% = (256 * datosa%) + (datosb%)
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> IF dato% = 0 THEN GOTO nohay<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> esta% = dato% + 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ctrl% = dato% + 2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 10, 22</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> COLOR 25</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "El puerto paralelo es correcto
|
|
LPT"; p</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT ""</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> COLOR 5</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "
|
|
Dirección BASE = "; HEX$(dato%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "
|
|
Dirección ESTADO = "; HEX$(esta%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "
|
|
Dirección CONTROL = "; HEX$(ctrl%)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (dato%), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> OUT (ctrl%), 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> COLOR 15</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 23, 1: PRINT "Pulse una
|
|
tecla . . ."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> GOTO inicio<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">nohay:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 10, 13</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> COLOR 12</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "No detecto puerto LPT";
|
|
p; "consulte con su manual de usuario."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> COLOR 10</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT "
|
|
¡¡¡¡ PROCESO DETENIDO !!!!"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> END<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">inicio:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">k:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF INKEY$ = "" THEN GOTO k</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">kk3:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT " ¿Que tipo de ordenador
|
|
es en el que tiene instalado este programa.?"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT " Si su equipo no esta
|
|
en la lista escoja el que más se adecua a la"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT " velocidad de su equipo
|
|
. . ."<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "
|
|
1 ­ PC­XT (8086)"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "
|
|
2 ­ PC­i386SX 25 Mhz"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "
|
|
3 ­ PC­i486DX 33 Mhz"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT "Eliga OPCION "; equi
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF equi > 3 OR equi < 1 THEN GOTO
|
|
kk3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Introduce el número
|
|
de intervalos que quieres para que sea guardada"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "la temperatura en el fichero
|
|
METEO.DAT, en segundos . . ."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Nota : Se pierde el antiguo
|
|
fichero METEO.DAT"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">INPUT "Tiempo "; tifi%<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************************************
|
|
Escribe fichero de Configuración **<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">OPEN "METEO.CFG" FOR OUTPUT
|
|
AS #1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #1, dato%</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #1, esta%</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #1, ctrl%</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #1, equi</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT #1, tifi%</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLOSE #1<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF ero = 1 THEN GOTO fin2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOTO propri</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fin2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Vuelva a ejecutar el programa
|
|
. . . . (GRACIAS)"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM **********************************************
|
|
Subrutina de Error *******<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">er:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ero = 1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">CLS</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SCREEN 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Este programa no se ha configurado
|
|
todavia ahora tendra que acerlo"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "antes de poder ejecutarlo,
|
|
la configuración se guardará en el archivo"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "METEO.CFG que será
|
|
copiado en el directorio desde donde se haya"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "ejecutado este programa y
|
|
será de formato ASCII . . ."</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT : PRINT : PRINT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">PRINT "Pulse un tecla para configurar
|
|
. . ."<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">kk2:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">IF INKEY$ = "" THEN GOTO kk2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">GOTO f2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM *************************************
|
|
Subrutina de Selección de equipo **<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pontem:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">SELECT CASE equi<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> REM ********************** Configuración
|
|
XT (8086) ******************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 1<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> linei = 1: circi = 1: circv =
|
|
1: stb = 1: ayu = 1: est6 = 10<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> REM ********************** Configuración
|
|
286 ************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> linei = 1: circi = 1: circv =
|
|
1: stb = 1: ayu = 1: est6 = 10<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> REM ********************** Configuración
|
|
486DX 33Mhz ****************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> CASE IS = 3<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> linei = 50: circi = 105: circv
|
|
= 500</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> stb = 100: ayu = 200: est6 =
|
|
50<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END SELECT</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ********************* Subrutina de
|
|
tiempo para que el ST6 trate dato ****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">datemp:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">FOR temporiza = 1 TO est6: NEXT temporiza
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Subrutina de temp max **************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temmax:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmax = temact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 6, 9: PRINT USING "###.##";
|
|
temmax: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 6, 16: PRINT "C
|
|
"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Subrutina de temp min **************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temmin:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> temmin = temact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 8, 9: PRINT USING "###.##";
|
|
temmin: REM ** Limita present.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 8, 16: PRINT "C
|
|
"<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Subrutina de Presión Máxima ********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">premaxi:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> premax = preact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 19, 9: PRINT USING "#.###";
|
|
premax: REM *** Limita presenta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 19, 15: PRINT "B.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***********************************
|
|
Subrutina de Presión Máxima ********<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">premini:</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> premin = preact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 21, 9: PRINT USING "#.###";
|
|
premin: REM *** Limita presenta.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> LOCATE 21, 15: PRINT "B.
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ***************************************
|
|
Impresión Tempe en fichero *****<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fiche:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT #3, USING "###.##";
|
|
temact; : PRINT #3, " ­­­­­­­>
|
|
";</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT #3, TIME$; : PRINT #3,
|
|
" "; USING "###.##"; temmax;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT #3, " "; USING
|
|
"###.##"; temmin;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> PRINT #3, " "; USING
|
|
"###.##"; temmed<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RETURN<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">REM ************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">END<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">BREVE EXPLICACION AL PROGRAMA METEO.BAS
|
|
:<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Este programa está escrito y compilado
|
|
en QUICKBASIC de Microsoft. Es un programa que se comunica con
|
|
la estación metereológica a través del protocolo
|
|
ya establecido. El programa </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">nada más inicializarse comprueba
|
|
que existe el archivo de configuración (METEO.CFG). Si
|
|
este no existe salta a la subrutina de configuración. También
|
|
cada vez que se ejecuta el programa borra los datos anteriores
|
|
de METEO.DAT de control de temperatura y crea uno nuevo. El programa
|
|
una vez realizada la pantalla de METEO trata de comunicarse con
|
|
la estación, entra en un bucle hasta que la entrada de
|
|
el registro de estado (por el cual la estación envía
|
|
datos al PC) hay un 05h (mirar capitulo de protocolo). En ese
|
|
momento el programa saca el código de la información
|
|
que necesita y produce un pulso en STROBE para interrumpir al
|
|
ST6. Cuando detecta dato listo recoge el dato, lo introduce en
|
|
una variable y saca al puerto de datos un 08h en espera de la
|
|
parte baja que cuando es recibida se coloca en otra variable,
|
|
con esta variable se realiza una operación, ya que como
|
|
la información se recoge de los 4 bits de mayor peso del
|
|
registro de estado habrá que pasarlo a parte baja para
|
|
sumarlo con la parte alta. Ahora habrá que determinar cual
|
|
es el dato completo, para ello se utiliza una tercera variable.
|
|
Los cálculos son :<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><I><FONT FACE="Courier">para la parte alta :<BR>
|
|
</FONT></I></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">dato_alto = inp(esta%) <BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">parte_alta = (dato_alto AND 240)<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><I><FONT FACE="Courier">para la parte baja :<BR>
|
|
</FONT></I></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">dato_bajo = inp(esta%)<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">parte_baja = (dato_bajo AND 240) /
|
|
16<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><I><FONT FACE="Courier">y el resultado de la unión
|
|
es :<BR>
|
|
</FONT></I></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">dato_total = parte_alta + parte_baja
|
|
<BR>
|
|
<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Con esto dato_total es el valor del registro
|
|
ADR del ST6, que es lo que nos manda el PC por lo tanto ahora
|
|
podremos operar con el para conseguir el valor deseado. <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><I><FONT FACE="Courier">NOTA : Se recuerda que como el ST6
|
|
está alimentado a 5V la resolución del convertidor
|
|
es de 19,5mV.<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></I></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Para hallar el valor de la temperatura
|
|
a partir de dato_total sería :<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">tempe = (dato_total * .01953) * 2
|
|
* 10<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">dato_total se multiplica por 0.0195V
|
|
para saber el valor en voltios del ADR, después este resultado
|
|
se multiplica por 2, ya que la entrada del A/D esta dividida entre
|
|
dos por medio de un divisor de tensión y posteriormente
|
|
se multiplica por 10 que es el valor por el cual hay que multiplicar
|
|
en resultado en VOLTIOS para saber la temperatura, ya que la sonda
|
|
entrega de 0-10V en un rango de temperaturas de 0-100ºC,
|
|
osea 100/10=10.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Para determinar el valor de la presión
|
|
a partir de dato_total sería :<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">presion = ((dato_total * .01953) *
|
|
2) / 5<BR>
|
|
</FONT></B></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">dato_total se multiplica por 0.0195V
|
|
para saber el valor en voltios del ADR, después este resultado
|
|
se multiplica por 2, por que la tensión de entrada del
|
|
A/D esta divida entre 2, y para saber a que presión equivale
|
|
esa tensión el resultado se multiplica por 5.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Para la veleta no hay que realizar ningún
|
|
tipo de calculo ya que el valor de los 4 bits de mayor peso del
|
|
registro de estado determinan en que posición se encuentra.
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">El programa METEO.BAS pide los datos
|
|
de temperatura y presión de máximas y mínimas
|
|
sólo cuando al se ejecuta al programa, después es
|
|
el mismo programa BASIC el que lleva ese control, así se
|
|
consigue mayor fluidez datos para refrescar a la veleta.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Los datos de temperatura se registran
|
|
en el fichero METEO.DAT y los de la configuración en METEO.CFG.
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><B><FONT FACE="Courier">VI-d,II) PROGRAMA DEL ST6</FONT></B><!----><FONT FACE="Courier">VI-d,II) PROGRAMA DEL ST6
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Ante la dificultad para poder realizar
|
|
el organigrama mediante alguno de los programas existentes, se
|
|
opta por explicar los bloques.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Hay que advertir para la comprensión
|
|
del programa que cada vez que se va a sacar un dato a un puerto
|
|
se realiza la complementacion del bit 3, es debido a una característica
|
|
del puerto paralelo del PC y se realiza en el ST6 por ser mas
|
|
fácilmente realizable que en el PC.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Programa principal:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Este programa comienza con la definición
|
|
de los símbolos y de las posiciones de memoria que se van
|
|
a utilizar en el desarrollo del programa, a continuación
|
|
se determina si el sistema estaba funcionando anteriormente (Como
|
|
mas adelante se explicara esta previsto que el PC pueda desconectarse
|
|
en cualquier momento y se ha dotado al sistema de una rutina "anticuelge"
|
|
en el único momento que podría ocurrir, esta rutina
|
|
provoca el RESET mediante el WDR), en caso de haber estado funcionando
|
|
salta una rutina de inicialización, en caso contrario salta
|
|
a la rutina de inicialización, si estaba o no estaba funcionando
|
|
anteriormente se determina por medio de un posición de
|
|
memoria puesta a tal efecto.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La rutina de inicialización, lo
|
|
que realiza es cargar el dato 00h en los registros destinados
|
|
a guardar las temperaturas y presiones máximas, y guardar
|
|
FFH en los registros destinados a los mínimos, a continuación
|
|
llama a un temporizador de 5 Sg y después pone a 1 el registro
|
|
de control de funcionamiento con lo que termina la rutina de inicialización
|
|
y vuelve al flujo principal.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">A continuación viene una rutina
|
|
de programación de puertos que a programa a los puertos
|
|
según la función que van a realizar, después
|
|
habilita las interrupciones.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">A continuación comienza la rutina
|
|
que se repite ciclicamente, comienza mediante la indicación
|
|
al PC de que esta listo para ser interrumpido, comienza la conversión
|
|
de temperatura para ello reprograma los puertos, una vez acabada
|
|
la conversión se determina si la temperatura es máxima
|
|
o mínima y si es así la guarda en el registro correspondiente
|
|
además de en el de temperatura actual, después realiza
|
|
la conversión de la presión con lo que vuelve a
|
|
reprogramar los puertos, una vez acabada la conversión
|
|
determina si es máxima o mínima y la guarda en el
|
|
lugar correspondiente además de en el registro de presión
|
|
actual. después de esto salta al comienzo de la rutina
|
|
repetitiva.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Hay que decir que el ST6 puede ser interrumpido
|
|
en cualquier momento por el PC con lo cual se salta a la rutina
|
|
de interrupción.<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">RUTINA DE INTERRUPCIÓN:<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">A esta rutina se accede desde el programa
|
|
principal mediante la interrupción del PC, una vez en esta
|
|
rutina se carga el valor de nolisto en el puerto que comunica
|
|
en dirección al PC, con lo cual se dehabilita el permiso
|
|
al PC para que interrumpa, después se carga el código
|
|
que manda el PC en el registro reservado a tal efecto, a continuación
|
|
se determina a que código pertenece saltando a la rutina
|
|
correspondiente, en caso de ser un código o valido se vuelve
|
|
al programa principal.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Las rutinas son todas prácticamente
|
|
iguales exceptuando la de la veleta que se describirá mas
|
|
adelante.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">Todas las rutinas de envió de
|
|
datos (exceptuando la de la veleta) funcionan igual todas ellas
|
|
cogen dato solicitado y lo transmiten de nible en nible mandando
|
|
primero la parte alta y después la parte baja, antes de
|
|
mandar el siguiente dato o de volver a la subrutina anterior comprueba
|
|
si el PC lo ha recibido, esto los hace mediante dos códigos
|
|
un para la parte alta y otro para la parte baja.</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">La rutina de la veleta lo que hace es
|
|
leer los datos de la veleta y a continuación lo manda al
|
|
PC, en este caso solo manda un nible por que el dato de la veleta
|
|
es solo de 3 bit.<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">En las rutinas de envió de datos
|
|
es en el único momento en el que se puede colgar el sistema
|
|
esto se soluciona limitando en nº de veces que se puede repetir
|
|
el bucle de comprobación de dato recibido, en caso de agotarse
|
|
ese tiempo (nº de veces que se puede repetir el bucle) salta
|
|
a una rutina para hacer funcionar el wachtdog esto lo hace entrando
|
|
en un bucle cerrado que no carga el WDR. Hay que advertir que
|
|
durante todo el programa se recarga el WDR para evitar el RESET.
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">A continuacion se encuetra el fichero
|
|
fuente<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "
|
|
METEO21.ASM "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "****************************************************************
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "****** Programa para ST6215
|
|
por J.I.D.B. & J.A.A.S. ****** "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "******
|
|
****** "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "****** ESTACION
|
|
METEREOLOGICA ****** "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "******
|
|
V 2.01 ****** "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "****************************************************************
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "
|
|
"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY " PROGRAMA
|
|
TERMINADO EL DIA "</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.DISPLAY "
|
|
24 DE MAYO DE 1994 "<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;**************************** DEFINE
|
|
REGISTROS ******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">x .def 80h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">y .def 81h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">v .def 82h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">w .def 83h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">a .def 0ffh,m <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drpa .def 0c0h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drpb .def 0c1h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drpc .def 0c2h <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrpa .def 0c4h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrpb .def 0c5h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrpc .def 0c6h <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ior .def 0c8h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rdw .def 0c9h <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">orpa .def 0cch </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">orpb .def 0cdh </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">orpc .def 0ceh <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">adr .def 0d0h,m </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">adcr .def 0d1h <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">psc .def 0d2h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tcr .def 0d3h </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tscr .def 0d4h <BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">wdr .def 0d8h <BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*************** DEFINICION POSICIONES
|
|
MEMORIA ******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temact .def 84h,0ffh,0ffh,m ; DEFINE
|
|
POSIONES DE MEMORIA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">preact .def 85h,0ffh,0ffh,m ; A UTILIZAR
|
|
PARA LA PROGRMACION</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">veleta .def 0c2h,m ; VELETA
|
|
(PC)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temmin .def 86h,0ffh,0ffh,m ; TEMPERATURA
|
|
MINIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temmax .def 87h,0ffh,0ffh,m ; TEMPERATURA
|
|
MAXIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">premin .def 88h,0ffh,0ffh,m ; PRESION
|
|
MINIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">premax .def 89h,0ffh,0ffh,m ; PRESION
|
|
MAXIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">partal .def 8Ah,0ffh,0ffh,m ; PARTE
|
|
ALTA A TRANSMITIR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">partba .def 8bh,0ffh,0ffh ; PARTE
|
|
BAJA A TRANSMITIR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comu .def 8ch,0ffh,0ffh ; REGISTRO
|
|
DE TRANSMISIONES</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">control .def 8dh,0ffh,0ffh,m ; Registro
|
|
de control de funcionamiento</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">salva .def 8eh,0ffh,0ffh ; Posición
|
|
Salva Acumulador para sobrutina<BR>
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">alta .equ 11110000b ; Define
|
|
palabras para control rapido</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">baja .equ 00001111b </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tempe .equ 01h ; CODIGO
|
|
DE LA TEMPERATURA ACTUAL<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">presi .equ 02h ; CODIGO
|
|
DE LA PRESION ACTUAL<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">velet .equ 03h ; CODIGO
|
|
DE LA VELETA<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tempm .equ 04h ; CODIGO
|
|
DE LA TEMPERATURA MINIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tempx .equ 05h ; CODIGO
|
|
DE LA TEMPERATURA MAXIMA<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">presm .equ 06h ; CODIGO
|
|
DE LA PRESION MINIMA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">presx .equ 07h ; CODIGO
|
|
DE LA PRESION MAXIMA<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">repc .equ 08h ; Codigo
|
|
de dato recibido ( PC > ST6)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rep2 .equ 09h ; Codigo
|
|
dato recibido 2<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">listo .equ 11110101b ; CODIGO
|
|
DE LISTO PARA RECIBIR INTERRUCCION<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">nolisto .equ 0 ; CODIGO
|
|
DE ANULACION DE LISTO<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrte .equ 00h ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ortem .equ 50h ; | ACTIVA
|
|
EL ADC DE LA PATILLA Nº6</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drtem .equ 0e0h ;/<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrpr .equ 00h ;\
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">orpre .equ 90h ; | ACTIVA
|
|
EL ADC DE LA PATILLA Nº7</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drpre .equ 0e0h ;/<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ddrve .equ 00h ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">orvel .equ 10h ; | DESACTIVA
|
|
LOS CONVERTIDORES</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">drvel .equ 0e0h ;/<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************************ PROGRAMACION
|
|
INICIAL DE PUERTOS *******************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.org 0800h<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reset reti ; Retorna
|
|
a modo normal desues del reset</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi a,0aah ; Carga
|
|
en el acumlador ffh</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cp a,control ; Compara
|
|
el acumulador con control</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz comi1 ; Si
|
|
ya estaba funcionando salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reco</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comi1 jp comi</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reco ldi temmax,0 ;\ Realiza
|
|
los ajustes para el correcto</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi premax,0 ; | funcionamiento
|
|
del sistema</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi temmin,0ffh ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi premin,0ffh ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi a,05h ; Bloquea
|
|
el sistema Durante 5 Sg</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call temp ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi control,0aah ; Pone
|
|
el registro de control en fucionamiento<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comi ldi ddrpb,00011111b ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi orpb,00011111b ; | Programa
|
|
el puerto B como salida </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpb,11100000b ;/ (PB0­PB4)
|
|
resto alta impedancia<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi ddrpc,00h ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi orpc,00h ; | Programa
|
|
como entrada el puerto c</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpc,80h ;/
|
|
(Veleta) ( PC 7 en alta impedancia)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi ddrpa,ddrve ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi orpa,orvel ; | Programa
|
|
puerto A como entrada</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpa,drvel ;/<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi ior,00010000b ; Habilita
|
|
las interrupciones de PA a </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; flanco
|
|
descendente<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;**************** FINAL PROGRAMACION
|
|
DE PUERTOS *****************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************** COMIENZO PROGRAMA
|
|
PRINCIPAL ******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">prin ldi a,listo ; Carga
|
|
en A listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrutina de complementación bit 4</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Indica
|
|
al PC Que el ST6 esta listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi ddrpa,ddrte ; Programa
|
|
el puerto a para poder medir</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi orpa,ortem ; la
|
|
temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpa,drtem<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00010000b ; Conecta
|
|
el ADC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> nop ; Espera
|
|
a que se conecte</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00110000b ; Da
|
|
comienzo a la conversion<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">lazo1 ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrr 6,adcr,lazo1 ; Comprueba
|
|
si la conversion ha finalizado</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; y si
|
|
es asi continua</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,adr ; coge
|
|
el dato resultado de la conversion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00h ; apaga
|
|
el ADC </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld temact,a ; Guarda
|
|
la temperatura en su posicion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,temmin ; Comienza
|
|
la determinacion de temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cp a,temact ; minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnc gutmi ; Si
|
|
no se ha producido carry salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp ftmi ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gutmi jrnz gutmin ; si
|
|
no se ha producido flag de 0 salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp ftmi ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gutmin ld a,temact ; guarda
|
|
la temperatura actual como minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld temmin,a ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp presion ; si
|
|
la temperatura era minima salta al final</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; de
|
|
las temperaturas<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">ftmi ld a,temmax ; Comienza
|
|
la determinacion de temperatura</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cp a,temact ; maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrc gutma ; Si
|
|
se ha producido carry salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp presion ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gutma jrnz gutmax ; si
|
|
no se ha producido flag de 0 salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp presion ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gutmax ld a,temact ; guarda
|
|
la temperatura actual como maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld temmax,a ;<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">presion ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi ddrpa,ddrpr ; Programa
|
|
el puerto a para poder medir</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi orpa,orpre ; la
|
|
presion </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpa,drpre</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00010000b ; Conecta
|
|
el ADC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> nop ; Espera
|
|
a que se conecte</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00110000b ; Da
|
|
comienzo a la conversion<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">lazo2 ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrr 6,adcr,lazo2 ; Comprueba
|
|
si la conversion ha finalizado</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; y si
|
|
es asi continua</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,adr ; coge
|
|
el dato resultado de la conversion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi adcr,00h ; apaga
|
|
el ADC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld preact,a ; Guarda
|
|
la presion en su posicion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,premin ; Comienza
|
|
la determinacion de de presion </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cp a,preact ; minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnc gupmi ; Si
|
|
no se ha producido carry salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fpmi ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gupmi jrnz gupmin ; si
|
|
no se ha producido flag de 0 salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fpmi ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gupmin ld a,preact ; guarda
|
|
la presion actual como minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld premin,a ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp prin ; si
|
|
la presion era minima salta al final</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; de
|
|
las presiones (comienzo programa)<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fpmi ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,premax ; Comienza
|
|
la determinacion de presion </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cp a,preact ; maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrc gupma ; Si
|
|
se ha producido carry salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp prin ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gupma jrnz gupmax ; si
|
|
no se ha producido flag de 0 salta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp prin ; salta
|
|
al final de la rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">gupmax ld a,preact ; guarda
|
|
la presion actual como maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld premax,a ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp prin ; Salta
|
|
la principio de rutina<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* FINAL RUTINA PRINCIPAL
|
|
*******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* COMIENZO INTERRUPCION
|
|
COMUNICACIONES ******************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comunica </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld salva,a ; Guarda
|
|
en Salva el ACUMULADOR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi a,nolisto ; Carga
|
|
en A nolisto ( desabilia permiso in)</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrutina de complementación bit 4</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Indica
|
|
al PC Que el ST6 no esta listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi drpb,0e0h ; Indica
|
|
al PC que esta atendiendo interrup </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,drpa ; Entra
|
|
dato del PC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Pongo
|
|
a 0 el las lineas que no son de comu</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cpi a,tempe ; Comprueba
|
|
codigos de operacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz pr</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comtem ; Llama
|
|
a la rutina de com de tempe actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pr cpi a,presi ; Comprueba
|
|
si corresponde a presion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz vel </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call compre</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">vel cpi a,velet ; Comprueba
|
|
si corresponde a veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz tmin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comvel</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tmin cpi a,tempm ; Comprueba
|
|
si corresponde a T min</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz tmax</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comtmin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">tmax cpi a,tempx ; Comprueba
|
|
si corresponde a T max</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz pmin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comtmax</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pmin cpi a,presm ; Comprueba
|
|
si corresponde a P min</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz pmax</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call compmin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">pmax cpi a,presx ; Comprueba
|
|
si corresponde a P max</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz fin </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call compmax<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fin ld a,salva ; Recupera
|
|
el valor del acumulador</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; retorna
|
|
al programa principal<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* FIN RUTINA DETERMINACION
|
|
INTERRUPCION *****************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* COMIENZO RUTINAS
|
|
DE COMUNICACIONES *********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************** TEMPERATURA ACTUAL
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comtem ld a,temact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la temperatura actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************** FIN TEMPERATURA ACTUAL
|
|
**********************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************************ PRESION ACTUAL
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">compre ld a,preact</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la presion actual</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************** FIN PRESION ACTUAL
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************** TEMPERATURA MAXIMA
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comtmax ld a,temmax</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la temperatura maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************** FIN TEMPERATURA MAXIMA
|
|
**********************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************** TEMPERATURA MINIMA
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comtmin ld a,temmin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la temperatura minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************** FIN TEMPERATURA MINIMA
|
|
**********************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;********************** PRESION MAXIMA
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">compmax ld a,premax</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la presion maxima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************** FIN PRESION MAXIMA
|
|
**********************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;********************** PRESION MINIMA
|
|
************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">compmin ld a,premin</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la presion minima</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
transmision parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
parte baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci2 ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* FIN PRESION MINIMA
|
|
**********************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************************** VELETA ******************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comvel ld a,veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld comu,a ; Carga
|
|
la VELETA</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,comu ; Comienza
|
|
la transmision de parte alta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,alta ;\</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; | Rota
|
|
parte alta a la baja</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ; |</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> rlc a ;/</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> res 3,a ; Elimina
|
|
posible bit de error</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
posible Carry</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 5,a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 6,a ; Mantiene
|
|
el estado de alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 7,a ; Impedancia</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call comple ; Llama
|
|
a subrrutina de complementacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld drpb,a ; Saca
|
|
estado de la veleta</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 4,drpb ; Indica
|
|
dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> call reci ; Llama
|
|
a comprobacion recep</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti ; Fin
|
|
trasmision<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* FIN VELETA *****************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;******************* COMPROBACION DE
|
|
DATO RECIBIDO PARTE ALTA ***************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci ldi w,0ffh ; Carga
|
|
nº max de veces del bucle </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci0 ldi v,0ffh ; Carga
|
|
nº max de veces </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci1 ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,drpa ; Carga
|
|
en el acumulador el puerto del PC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
parte alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cpi a,8 ; Comprueba
|
|
si coincide con " Dato Recibido"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz rec0 ; Vuelve
|
|
a comprobarlo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp firec ; Salta
|
|
al final de subrutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rec0 dec v ; Decrementa
|
|
el nº de veces que quedan</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz rec1 ; Si
|
|
se ha ejecutado el bucle 256 veces decre </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; el
|
|
registro w</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reci1 ; Salta
|
|
al principio de rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rec1 dec w ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz cuelge ; Si
|
|
se, ha terminado el bucle cuelga el sistema</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reci0 ; </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">cuelge jp reini ; cuelga
|
|
el sistema</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">firec res 4,drpb ; Deja
|
|
de indicar dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ret ; Vuelve
|
|
a rutina anterior<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reini nop ; Entra
|
|
en bucle cerrado para que se produzca </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reini ; el
|
|
reset del sistema provocado por wdr<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*******************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************** FIN COMPROBACION DATO
|
|
RECIBIDO PARTE ALTA **********</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*******************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*******************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************** COMPROBACION DATO RECIBIDO
|
|
PARTE BAJA **************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*******************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci2 ldi w,0ffh ; Carga
|
|
nº max de veces del bucle </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci02 ldi v,0ffh ; Carga
|
|
nº max de veces </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">reci12 ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ld a,drpa ; Carga
|
|
en el acumulador el puerto del PC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> andi a,baja ; Elimina
|
|
parte alta </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> cpi a,09H ; Comprueba
|
|
si coincide con " Dato Recibido"</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz rec3 ; Vuelve
|
|
a comprobarlo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp firec2 ; Salta
|
|
al final de subrutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rec3 dec v ; Decrementa
|
|
el nº de veces que quedan</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz rec12 ; Si
|
|
se ha ejecutado el bucle 256 veces decre </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ; el
|
|
registro w</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reci12 ; Salta
|
|
al principio de rutina</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">rec12 dec w ;</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz cuelge2 ; Si
|
|
se, ha terminado el bucle cuelga el sistema</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp reci02 ; </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">cuelge2 jp reini ; cuelga
|
|
el sistema</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">firec2 res 4,drpb ; Deja
|
|
de indicar dato listo</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh ; Recarga
|
|
el WDR</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ret ; Vuelve
|
|
a rutina anterior<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;**************** FIN COMPROBACION DE
|
|
DATO RECIBIDO PARTE BAJA **************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;**************** SUBRRUTINA DE COMPLEMENTACION
|
|
DE DATOS ********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">comple jrs 3,a,stb ; Comprueba
|
|
el estado del bit 3 del </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> set 3,a ; acumulador
|
|
y lo complementa, esto es </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ret ; necesario
|
|
para la correcta comunicacion</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">stb res 3,a ; con
|
|
el PC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ret ;<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;************* FINAL SUBRRUTINA DE COMPLEMETANCION
|
|
DE DATOS *****************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***********************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*********************** TEMPORIZADOR
|
|
PROGRAMABLE PARA EL INICIO *******</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***********************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">temp jrnz inic</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp fin1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">inic ldi v,0ach</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">sal2 ldi w,0ffh</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">sal1 ldi wdr,0feh ;Recarga el
|
|
WATCHDOG para que no llege a ser 0</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> nop ;y se produzca
|
|
un reset</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> nop</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dec w</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrnz sal1</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dec v </FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp saltito</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fin1 jp fin2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">saltito jrnz sal2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> dec a</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi wdr,0feh</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jrz fin2</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> jp temp</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">fin2 ldi wdr,0feh</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ldi control,0aah</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> ret<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;********************** FINAL TEMPORIZADOR
|
|
PROGRAMABLE *********************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;***************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*********************** FINAL DE SUBRRUTINAS
|
|
*******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;*************************** VECTORES
|
|
DEL ST6 *******************************</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">;****************************************************************************
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.org 0ff0h<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">adc nop ;Vector
|
|
conv. A/D</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">timer nop ;Vector
|
|
del timer</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">int2 nop ;Vector
|
|
de PB y PC</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">int1 jp comunica ;Vector
|
|
de PA<BR>
|
|
<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.org 0ffch<BR>
|
|
</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">nmi nop ;Vector
|
|
de NMI</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier"> reti</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">res jp reset ;Vector
|
|
de RESET</FONT></TT>
|
|
<P>
|
|
<TT><FONT FACE="Courier">.end</FONT></TT>
|
|
<HR>
|
|
<P>
|
|
<CENTER><FONT SIZE=1>ULTIMA MODIFICACION 29-3-1997</FONT></CENTER>
|
|
<CENTER><EMBED SRC="meteo.mid" WIDTH=140 HEIGHT=60 AUTOSTART="true" LOOP="infinite"></EMBED>
|
|
|
|
</BODY>
|
|
</HTML>
|