Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Prueba 2
Prueba 2
C.I:19852549
MATERIA: Microprocesadores
Prueba 2
Programa que muestra las letras desde la A hasta la G con el serial RS232C y utilizando un Display
7 Segmento Ánodo COMUN.
# include <18f2550>
# include <string.h>
# fuses hs,nowdot
# uses ms
#uses NOPROTECT
#uses NOPUT
# uses NWDT
# uses MCLR
# uses
RS232(UART1,BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7,PARITY,STOP=1,ENABLE=PIN80)
# use standar_io(b)
# use standar_io(a)
Void main ()
Char ch;
While (true)
getc ();
Ch*getc ();
If(( ch*’A’)){
Printf(“dato A obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’A’))
Printf(“dato B obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’B’))
Printf(“dato C obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’C’))
Printf(“dato D obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’D’))
Printf(“dato E obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’E’))
Printf(“dato F obtenido/n/r”);
Output_high(pin_b3);
}else if((ch^’F’))
Printf(“dato G obtenido/n/r”);
Output_high(pin_b3);
}else
Delay_ms(500);
Output_low(pin_b4);