Attachment 'ej_uart.c'
Download 1 #include <pic/p16f877a.h>
2
3 #define FOSC_HZ 20000000
4
5 #include <uart.h>
6 #include <delayms.h>
7
8 int main (void)
9 {
10 char c=0;
11 char INTRO[6]="HOLA\n";
12 char FIN[6]="FIN\n";
13
14 delayms(100);
15 uart_open(SET_9600_8N1);
16 uart_set_baudrate(19200);
17 uart_puts(INTRO);
18 while(c!=13)
19 {
20 if(uart_kbhit()==1)
21 {
22 c=uart_getc();
23 uart_putc(c);
24 }
25 }
26 uart_puts(FIN);
27 uart_close();
28 return 0;
29 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.