??? 12/03/04 03:03 Read: times |
#82445 - serial interrupt in adc interrupt Responding to: ???'s previous message |
just set tis bit by software:
TI=1; By this way, if you use interrupts then serial ISR will be executed when it is allowed. Oh, yes. How amazingly simple it is! Exactly I have read all the example code from all of you through, a little bit tiny and precise parts of them are better understanding with discussion here for me. Some applications get me cofused in that only a short time has passed since I started to handle with 8052. Actually, my purpose for serial interrupt is to transmit 3 times in a cycle of ADC interrupt. ADC interrupt sounds to be called very well by each end of ADC in main. But then serial interrupt is still not well. No expected output coming, just nothing. Here is my code. Serial port mode 3 has been employed. Are there still some confusions or misunderstandings? ////////// UART SERIAL PORT INTERRUPT ROUTINE ////////// void serial(void) interrupt 4 { if(TI) { TI = 0; SBUF = tmp; } } ////////// ADC INTERRUPT ROUTINE ////////// void adc(void) interrupt 6 { if(!flag) { /* transmit data1 */ tmp = data1; TB8 = 1; // 9th bit = 1 TI = 1; /**** NEED TRANSMISSION HERE! ****/ flag = 1; } else if(flag) { /* transmit data2 */ tmp = data2; TB8 = 0; // 9th bit = 0 TI = 1; /**** NEED TRANSMISSION HERE ****/ /* transmit data3 */ tmp = data3; TI = 1; /**** NEED TRANSMISSION HERE ****/ flag = 0; } } |
Topic | Author | Date |
THE TIME OF TI | 01/01/70 00:00 | |
Bitrate | 01/01/70 00:00 | |
interrupt-driven | 01/01/70 00:00 | |
Why interrupt driven? | 01/01/70 00:00 | |
UART Serial Port Interrupt | 01/01/70 00:00 | |
all the above | 01/01/70 00:00 | |
UART communication by UART interrupt | 01/01/70 00:00 | |
just TI=1 | 01/01/70 00:00 | |
serial interrupt in adc interrupt | 01/01/70 00:00 | |
start with something simple | 01/01/70 00:00 | |
misunderstand behaviour | 01/01/70 00:00 | |
See the examples | 01/01/70 00:00 | |
not has to, but can | 01/01/70 00:00 | |
The difference is | 01/01/70 00:00 | |
" | 01/01/70 00:00 | |
He's right | 01/01/70 00:00 | |
How the 8051 UART works | 01/01/70 00:00 | |
The TI-bit Set Time | 01/01/70 00:00 | |
no, at the middle | 01/01/70 00:00 | |
The Transmitter Part, Actually | 01/01/70 00:00 | |
Setting of TI | 01/01/70 00:00 | |
sometimes chip designers listen | 01/01/70 00:00 | |
So, Erik | 01/01/70 00:00 | |
where does it happen | 01/01/70 00:00 | |
Mode 1 TI timing. | 01/01/70 00:00 | |
How to post code | 01/01/70 00:00 | |
RS485 & bus turnaround![]() | 01/01/70 00:00 |