LABORATORIO DE ARQUITECTURA DE COMPUTADORAS LABORATORIO N° 3
Jim CasimiroEnsayo23 de Agosto de 2015
344 Palabras (2 Páginas)267 Visitas
UNIVERSIDAD TECNOLÓGICA DEL PERÚ
FACULTAD DE INGENIERIA DE SISTEMAS Y ELECTRÓNICA
[pic 1]
[pic 2]
LABORATORIO DE ARQUITECTURA DE COMPUTADORAS
LABORATORIO N° 3
TEMA: PUERTO SERIAL | |||
CODIGO | APELLIDOS Y NOMBRES | NOTA | |
HORARIO | PC | FECHA | |
OBSERVACIONES |
Julio 2014
PRACTICA
Escribir un programa en Lenguaje C que permita controlar una computadora de manera remota mediante un enlace serial RS232 de parámetros 4800 bps, 8 bits de datos, paridad marca, 2 bits de parada. Emplear interrupción por dato recibido.
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include
#include
#include
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
void ConfigUART( int Frec );
void InstalaRSI( void );
void TxDato( int c );
void DesinstalaRSI( void );
void interrupt RSIRxUART( void );
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
int IMR;
void interrupt (*pRSIRxUART)( void );
int Cont = 0;
int DatoRx;
int RxOK = 1;
char Cmd[80];
int Ind = 0;
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
int main( void )
{
int i;
char c;
ConfigUART();
InstalaRSI();
while(1)
{
if( kbhit() ) /* Establecer si el usuario usó el teclado... */
{
c = getch(); /*... sólo en ese caso, se captura tecla. */
if( c == 27 ) /* Verificar si se presionó [ESC]... */
{
break; /*... en cuyo caso se sale del lazo prinicpal. */
}
TxDato( c );
}
/* Verifica si hay dato recibido */
if( RxOK == 1 )
{
RxOK = 0;
system( Cmd[] );
}
}
DesinstalaRSI();
return 0;
}
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
void ConfigUART( void )
{
}
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
...