??? 06/01/04 20:52 Read: times |
#71571 - LCP932 and UART Sample Program |
Hi, I need to know how can I use the UART sample program to send characters to the screen of a PC, but the charecters will be the micro's memory contents and not a predefined string. If a key is pressed then read a memory location and send it to the screen. How can I modify it. Below is the sample program.
Thanks if (sendRQ) // wait for command 'S' { sendtoPC(text); sendRQ=0; } void UART_ISR(void) interrupt 4 { RI = 0; // clear receive interrupt flag ch=SBUF; // copy input bufffer to ch if (ch=='1') sendRQ=1; // set flag for polling in main loop //if (ch== '2') //if (ch == '3') } void sendtoPC(char* dat) { int j=0; while(dat[j]) // send string { TI=0; // clear transmit interrupt flag SBUF=dat[j]; // start sending one byte while (!TI); // wait until sent j++; } } |
Topic | Author | Date |
LCP932 and UART Sample Program | 01/01/70 00:00 | |
RE: LCP932 and UART Sample Program | 01/01/70 00:00 | |
RE: Pointers![]() | 01/01/70 00:00 |