??? 08/24/04 21:08 Read: times |
#76365 - RE: MIDI messages handling Responding to: ???'s previous message |
First, let me thank you all for the great help.
I have a reason to believe the serial rate is correctly set. I already tried to run the program using port polling (a simple send and receive) and it works as expected, even under heavy MIDI load. Using the calculator reload value of 0xFE will result in a freq of 31,250.00 Hz 0% deviation (Clock = 24MHz, Timer 1, Mode 2, SMOD=0). Also I would like to ask another serial interrupt handling question: In the first version of my program I used a simple interrupt handler, triggered by the receive signal to echo the incoming byte to the serial register: ;****************************** ; SERIAL INPUT INTERRUPT ROUTINE SERIN: PUSH ACC PUSH PSW ; receive MOV A, SBUF CLR RI ; send ; NOTE: Don't clear the transmit flag. it will be cleared by the ISR ; CLR TI ;CLEAR TRANSMIT INRUP MOV SBUF,A ; move outgoing value from A to SBUF ; NOTE: Don't wait untill the byte has been transmitted ; JNB TI, $ ; Wait till done transmitting POP PSW POP ACC RETI ; SERIAL OUTPUT ROUTINE SEROUT: CLR TI RETI To my amazement, the interrupt handler works fine, even without clearing the transmit flag or any waiting after the byte has been send. My initial expectation was to have some weird nested interrupts, because of my attempt to send data during the receive interrupt. I still have no good explanation why it works fine, even if I feel something is wrong on conceptual level (generating interrupts within interrupt handlers). Your comments will be appreciated. Thank again! |
Topic | Author | Date |
MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI | 01/01/70 00:00 | |
RE: MIDI | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling | 01/01/70 00:00 | |
RE: MIDI messages handling![]() | 01/01/70 00:00 |