| ??? 06/09/00 06:21 Read: times |
#3122 - Problem with changing serial baud rate |
I'm trying to implement a routine to change the serial baud rate, but whenever I try to run it, the MCU hangs and needs a hard reset. The program works fine on a simulator.
The routine is supposed to load a value from a table into RCAP2L based on the index stored in A (=0..9). RCAP2H = FFh. All the table values and corresponding baud rates are already verified as correct, and it's not a watchdog reset issue. MCU = Philips P80CL580 Clock = 3.6864 MHz Baud rate generator = Timer2 Following is the code segment: ===== CLR TR2 ;stop timer2 to write RCAP2L MOV DPTR,#D_BAUDRATE MOVC A,@A+DPTR MOV RCAP2L,A SETB TR2 ;restart timer2 MOV V_BUFF,#S_OK ;== delay 100ms before return to allow time for the host to change its baud rate MOV R5,#100 FRC_BAUDDLY: MOV R4,#154 DJNZ R4,$ ;308 cycles = 1 ms DJNZ R5,FRC_BAUDDLY RET D_BAUDRATE: DB 0A0h ; 1200bps x=0 ...more table entries ===== |
| Topic | Author | Date |
| Problem with changing serial baud rate | 01/01/70 00:00 | |
RE: Problem with changing serial baud rate | 01/01/70 00:00 |



