Hello, I'm trying to write a Function that reads a character from RS232 (trival?). I'm using 80c552, Serial_Mode=1. I think the baudrate is set correct (I can transmit data to the PC). The Problem is, S0BUF is allways empty. I tried it on the simulator too. I paste my code:
CLR RI JNB RI,$ ; waiting for character MOV R7, S0BUF ; <- here S0BUF is ALLWAYS 0x00 RET
What about : JNB RI,$ ; waiting for character CLR RI MOV R7, S0BUF ; <- here S0BUF is ALLWAYS 0x00 RET
1. Thank you for all the answers! 2. RxD is allways 1 3. The complete code of the function
char rs232_getChar(){ #pragma asm CLR RI JNB RI,$ #pragma endasm return S0BUF; }
3. The complete code of the function how about the initialize code? BTW pragma asm CLR RI JNB RI,$ #pragma endasm woul, if I did it, be RI = 0; while (!RI); Erik
RxD is allways 1 So there is no signal at the receive pin ?
View all questions in Keil forum