This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART

Ive tried to move data from Sbuf to Acc.....
Ive tried using this code... whil;e debuggin the code ive used the serial window to pass data....
my main aim is to compare data that i recieve from the Rxd pin with memory

#include<stdio.h>
#include<reg51f.h>

unsigned char c ;

char getchar()
{ while( RI != 0 ) { c = SBUF; RI = 0; } return(c);
}

void main()
{ unsigned char b; b = getchar(); //printf("%c",&b );

B = b;
}

ive also tried using _getkey().. and getchar directly.

Parents
  • First off: Why would you like to use any accumulator when you are programming in C? Stay with C for a C program, and leave assembler for an assembler program - or at least an assembler module.

    Another thing: Are you sure that the getchar() code should look like you posted?

Reply
  • First off: Why would you like to use any accumulator when you are programming in C? Stay with C for a C program, and leave assembler for an assembler program - or at least an assembler module.

    Another thing: Are you sure that the getchar() code should look like you posted?

Children
No data