| ??? 02/27/06 17:49 Modified: 02/27/06 18:13 Read: times |
#110863 - putchar C51 serial communication problem |
hi everyone,
I have this problem on C51 compiler or perhaps the Keil simulator.The target hardware is ATMEL AT89c52. Normally, I believe TI bit is set by hardware (UART???) on the completion of data transfer. I wrote asm code (same as on tutorial's) and simulated in keil. I found that TI bit is set by the simulator upon the completion of the transfer. but when I write the same in C (using putchar()),the simulator seems to wait for my setting the TI. so, is the TI bit set by the software/us or done by hardware? The tutorial says "clear TI" before writing to SBUF. But putchar() works only when I include TI=1; before putchar().So, I went on to write my own putcar(), same as ASM code of tutorial except in C (meaning not using XON/XOFF and other addons). but the simulator seems to know what I was upto and refused to budge. I read excellent tutorials (serial.pdf and RS232gd.pdf) written by excellent people and I have somewhat acquainted myself with serial comm. Another question of interest is whether one has also to set TL1 also for mode 1 serial communication. Most tutorials give just value of TH1=XXH. What about value of TL1?? bye, Monish C |
| Topic | Author | Date |
| putchar C51 serial communication problem | 01/01/70 00:00 | |
| Keil putchar source | 01/01/70 00:00 | |
| putchar() reworded | 01/01/70 00:00 | |
| TI | 01/01/70 00:00 | |
| thanks and here is my C code of asm... | 01/01/70 00:00 | |
| should be obvious | 01/01/70 00:00 | |
| To be fair | 01/01/70 00:00 | |
| C gives higher performance! | 01/01/70 00:00 | |
| Initial conditions | 01/01/70 00:00 | |
| waiting better than uninten effcy | 01/01/70 00:00 | |
| Better? | 01/01/70 00:00 | |
| Math? | 01/01/70 00:00 | |
| What????? | 01/01/70 00:00 | |
| no work to do unitl bytes send | 01/01/70 00:00 | |
| OK | 01/01/70 00:00 | |
| or... | 01/01/70 00:00 | |
| That is better | 01/01/70 00:00 | |
| i read about putchar() | 01/01/70 00:00 | |
| Try \Keil\C51\LIB\getkey.c | 01/01/70 00:00 | |
| Keil Library Source Files | 01/01/70 00:00 | |
| ok | 01/01/70 00:00 | |
| No and Yes | 01/01/70 00:00 | |
| but what about AT cmd | 01/01/70 00:00 | |
No | 01/01/70 00:00 |



