|

楼主 |
发表于 2006-10-19 20:20:59
|
显示全部楼层
程序如下
s3c2410上,//UART1
rULCON1 = 0x2;
rUCON1 = 0x345;
rUBRDIV1=( (int)(pclk/16./baud1) -1 );
pISR_UART1 = (U32)Uart1RxInt; //+ //串口接收数据中断初始
ClearSubPending(BIT_SUB_RXD1); //+
ClearPending(BIT_UART1); //+
EnableSubIrq(BIT_SUB_RXD1); //+
EnableIrq(BIT_UART1); //+
static void __irq Uart1RxInt(void) //+
{
U8 DATE1=0;
U8 sent=4;
printf("1rUTRSTAT1=%d\n",rUTRSTAT1);
printf("1rUERSTAT1=%d\n",rUERSTAT1);
ClearSubPending(BIT_SUB_RXD1); //rSUBSRCPND = BIT_SUB_RXD1; //Clear pending bit (Requested)
ClearPending(BIT_UART1);
DATE1= RdURXH1();
//DATE=DATE&0x7f;
printf("sent=%d\n",sent);
printf("date1=%d\n",DATE1);
printf("2rUTRSTAT1=%d\n",rUTRSTAT1);
printf("2rUERSTAT1=%d\n",rUERSTAT1);
}
c2051上
ORG 0000H
LJMP MAIN
ORG 0200H
MAIN:MOV P3,#0FFH
MOV P1,#00H
MOV R0,#40H
MOV R1,#50H
MOV TMOD,#20H
MOV TL1,#0fdH
MOV TH1,#0fdH
SETB TR1
MOV SCON,#40H
mov a,#55h
l1: MOV SBUF,A
JNB TI,$
CLR TI
acall delay1
ajmp l1
DELAY1 :MOV R7,#0ffH
TM1: MOV R6,#0FFH
TM61: DJNZ R6,TM61
DJNZ R7,TM1
RET
end |
|