This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Delay function in lpc 17xx

hello all

i want to introduce delay in program in microsecond range. can any one give me some examples for lpc17xx.

Thanks in advance.

Parents
  • If the assembly language program is written in c file using embedded assembler, will it have the same effect as separate assembly program?

    __asm void delay(uint16_t usec)
            {
            MOVS     r1,#0
            B        |L1.6|
    |L1.4|
            ADDS     r1,r1,#1
    |L1.6|
            ADD      r2,r0,r0,LSL #2
            ADD      r2,r2,r0,LSL #3
            CMP      r2,r1
            BGT      |L1.4|
            BX       lr
            ENDP
    
            }
    

Reply
  • If the assembly language program is written in c file using embedded assembler, will it have the same effect as separate assembly program?

    __asm void delay(uint16_t usec)
            {
            MOVS     r1,#0
            B        |L1.6|
    |L1.4|
            ADDS     r1,r1,#1
    |L1.6|
            ADD      r2,r0,r0,LSL #2
            ADD      r2,r2,r0,LSL #3
            CMP      r2,r1
            BGT      |L1.4|
            BX       lr
            ENDP
    
            }
    

Children
No data