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

LPC2148 ASSEMBLY PROGRAMMING

I have done programming of lpc2148 in c but now i want to program lpc2148 in assembly language.So, i want to know how to use all the register of lpc2148 for eg, PINSEL , IODIR etc..

I would be thankful if some one provide blinking of led code in assembly language for lpc2148, so that i can start programming.

I have written code for some dsp functions for ARM but not knowing how to run them on lpc2148.

please help !!!

  • Suggest you get some books, and search for some examples. The internet is awash with assorted examples and code fragments you could use, or learn from. The manuals for your part should include register and bit details.

    You're basically try to load and store constants

    C:\Keil\ARM\Boards\Keil\MCB2140\RTX_Blinky\Startup.s

    ..
    ; External Memory Pins definitions
    PINSEL2         EQU     0xE002C014      ; PINSEL2 Address
    PINSEL2_Val     EQU     0x0E6149E4      ; CS0..3, OE, WE, BLS0..3,
                                            ; D0..31, A2..23, JTAG Pins
    ..
    ; Setup External Memory Pins
                    IF      :DEF:EXTERNAL_MODE
                    LDR     R0, =PINSEL2
                    LDR     R1, =PINSEL2_Val
                    STR     R1, [R0]
                    ENDIF
    

  • Thank you so so much for your reply.

    Sir, main problem is everywhere the code are written in c.

    I have studied two books
    1.ARM SYSTEM DEVELOPERS GUIDE
    2.ARM ON CHIP ARCHITECTURE
    but they are explaining general assembly programming but i want application based programming like SPI,ADC,USART for lpc2148.

    I just want to know how to start writing assembly program for lpc2148 else everything i can adjust like addresses of different register from the manual of lpc2148

    can suggest any other book for these purposes

  • The chances of someone writing a book for your specific processor choice are, of course, a lot slimmer. This shouldn't be surprising, there is very little money in writing books. The concepts of assembler are however consistent, you need to focus on the basics first.

    You can review the technical reference manual for your part, you can use the C code as a guide. If you have a licensed version of Keil you can enable it to create assembler listings for the code it is compiling.

    The startup.s file I pointed too, and plenty of other ones, exist in the examples Keil installs.