Uart output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Uart output

1,075 次查看
shunpinglin
Contributor III

hello,

  Now, I write uart assemble code during the boot of ls1021atwr.  But the uart don't ouput anything, I don't know any? do anyone have idea?

The following assemble code:

UART_LCR=0x21C0503
        UART_DLB=0x21C0500
        UART_DMB=0x21C0501
        UART_SND=0x21c0500
        UART_IER=0x21c0501
        UART_MCR=0x21c0504
        UART_FCR=0x21c0502
   
    LOOP1:
        ldr r3, =0x21c0505
        ldr r4, [r3]
        tst r4, #0x40
        bne LOOP1
            
        ldr r0, =(UART_IER)
        ldr r1, =0x00
        str r1, [r0]
            
        ldr r0, =(UART_MCR)
        ldr r1, =0x03
        str r1, [r0]

        ldr r0, =(UART_FCR)
        ldr r1, =0x07
        str r1, [r0]
        /*  
         * setting line control register and
         * setting serial baud,including DLB and DMB   
        */
        ldr r0, =(UART_LCR)
        ldr r1, =0X83
        str r1, [r0]

        ldr r0, =0XA3
        ldr r1, =(UART_DLB)
        str r0, [r1]

        ldr r0, =0X00
        ldr r1, =(UART_DMB)
        str r0, [r1]

        ldr r0, =(UART_LCR)
        ldr r1, =0X03
        str r1, [r0]
        /*
         * send data to send buffer
        */

        mov r0, #0x24
        ldr r1, =(UART_SND)
        str r0, [r1]

        mov r3, #100
    LOOP2:
        sub r3, r3, #1
        cmp r3, #0
        bne LOOP2

标签 (1)
标记 (4)
0 项奖励
回复
1 回复

915 次查看
shunpinglin
Contributor III

one byte register,using ‘strb’ instruction

0 项奖励
回复