??? 11/25/04 07:58 Read: times |
#81889 - too more fix Responding to: ???'s previous message |
hi,
You should use one of suggested fixes. But you used both of them and so come to trouble once again. You do not set TI flag anymore but now check for it before transfer. Better just disable serial interrupt on transmitter side: //transmit program #include<reg51.h> void Serial_Init(void) { SCON=0x52; // set TI flag to indicate that UART is free ES=0; // disable serial interrupt due we have no its ISR // EA=1; // enable rest interrupts if it needs TMOD=0x20; TH1=0xE6; TR1=1; } void Transmit_Char(unsigned char c) { while(!TI); //Waits until previous transmit has been done TI=0; SBUF=c; }Code above should help to send byte now. Regards, Oleg |
Topic | Author | Date |
AT89c51 serial communication problem | 01/01/70 00:00 | |
Try | 01/01/70 00:00 | |
While loop in Transmit Char function | 01/01/70 00:00 | |
mistakes | 01/01/70 00:00 | |
mistakes fixed but still in a fix | 01/01/70 00:00 | |
too more fix | 01/01/70 00:00 | |
Give little more details | 01/01/70 00:00 | |
more details | 01/01/70 00:00 | |
problem solved | 01/01/70 00:00 | |
answer wrong | 01/01/70 00:00 | |
Yet another problem you must fix. | 01/01/70 00:00 | |
Hex files needed | 01/01/70 00:00 | |
Check The serial port | 01/01/70 00:00 | |
Problem solved![]() | 01/01/70 00:00 |