??? 06/05/06 23:31 Read: times |
#117813 - AT89S8252 MIDI Baud Rate Responding to: ???'s previous message |
Thanks p, it still not working.
Here is situation: source is void Serial_Init (void) { SCON = 0x50; // SCON: mode 1, 8-bit UART, enable rcvr TMOD |= 0x21; // TMOD: timer 1, mode 2, 8-bit reload TH1 = 0xff; // MIDI baud rate for 12.000 clock TL1 = 0xff; PT1=0; // as you proposed ET1=0; PCON &= 0x7f; // SMOD=0 TR1 = 1; // TR1: timer 1 run TI = 1; // TI: set TI to send first char of UART ES=1; EA=1; } from interrupt routine i send last received byte to P2 and i use osciloscope to veryfy last received byte. I use midiOX to send messages from PC to uC, last byte is velocity byte of midi message and i exacrly know the sent value but received value is never the same. void serial_IT(void) interrupt 4 { RI=0; P2=SBUF; } Do i have to refresh TH1 and TL1 from interrupt routine every thime timer 1 overflows? Thanks to anybody that answers!! |