资源描述:
《ARM嵌入式系统教程 教学课件 作者 张石Example6.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、;例六:基于S3C4510B的串行通信程序;项目名:Example6.mcp,文件名:Example6.s———————————————————————————————————————;DefineSpecialFunctionRegisterIOPMODEQU0x3FF5000IOPDATAEQU0x3FF5008UARTLCON0EQU0x3FFD000UARTCONT0EQU0x3FFD004UARTSTAT0EQU0x3FFD008UTXBUF0EQU0x3FFD00CUARTBRD0EQU0x3FFD014AREAInit,CODE
2、,READONLYENTRY;LEDDisplayLDRR1,=IOPMODLDRR0,=&ffSTRR0,[R1]LDRR1,=IOPDATALDRR0,=&ffSTRR0,[R1];UART0linecontrolregisterLDRR1,=UARTLCON0LDRR0,=0x03STRR0,[R1];UART0controlregiserLDRR1,=UARTCONT0LDRR0,=0x9STRR0,[R1];UART0baudratedivisorregiser;Baudrate=19200,对应于50MHz的系统工作频率LDRR1
3、,=UARTBRD0LDRR0,=0x500STRR0,[R1];Printthemessages!LOOPLDRR0,=Line1BLPrintLineLDRR0,=Line2BLPrintLineLDRR0,=Line3BLPrintLineLDRR0,=Line4BLPrintLineLDRR1,=0x7FFFFFLOOP1SUBSR1,R1,#1BNELOOP1BLOOP;PrintlinePrintLineMOVR4,LRMOVR5,R0LineLDRBR1,[R5],#1ANDR0,R1,#&FFTSTR0,#&0MOVEQPC,
4、R4BLPutByteBLinePutByteLDRR3,=UARTSTAT0LDRR2,[R3]TSTR2,#&40BEQPutByteLDRR3,=UTXBUF0STRR0,[R3]MOVPC,LRLine1DCB&A,&D,"0123456789*",0Line2DCB&A,&D,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",0Line3DCB&A,&D,"abcdefghijklmnopqrstuvwxyz.",0Line4DCB&A,&D,0END