We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
In LPC2148(ARM uC) there is a register CPSR (Current Program Status Register). This CPSR contains a no. of flags which report & control the operation of the ARM7 CPU. It is similar to PSW (Program Status Word) of uP & 8051 uC. I've went throught it's datasheet, User manuals but i'm unable to find its base address. For E.g. PCON has base address 0xE01FC0C0 FIO0PIN has base address 0x3FFFC014 FIO0SET has base address 0x3FFFC018 FIO0CLR has base address 0x3FFFC01C FIO1DIR has base address 0x3FFFC020
I want to add CPSR Register in include file. Plz if anybody has this information plz reply.
Als0 in 8051 we have Accumulator(A-Register) & B-Register & few other registers , similarly LPC2148(ARM uC)has R0-R15 Registers, i suppose these must also hv some address. I want to add these Registers too in include file. If some one has this information plz do share
Regards, Pratibha
Please, be sure to include links to all your cross-posts - so that people can see the full picture, and don't waste time duplicating answers in one forum that have already been given in an other (or others)!
Why do you assume that processor registers should have a hardware address in the form of a number you may add to your include file?
The C51 processor memory-maps every single processor register. Most other processors do not. They may memory-map the control registers for peripherial functions, such as UART, PLL, timer, PWM, ... But the actual processor registers have their address hard-coded into the different processor instructions, i.e. you can not access the regsiters of the processor core with normal memory accesses.
Please visit the ARM site and pick up the documentation for the ARM core your processor is based on. There you will find all required documentation about the assembler instructions you must use to access the processor registers.
But back to another thing: What are you planning to do, that make you think that you need to know how to access these registers? If you work in (and known) ARM assembler, then you already have access to the registers. If you work in C, then you should normally not need access to them.
Actually i had written a C-code for 8051 where i accessed PSW & B register. Basically i was coping PSW into B register (since it couldn't be copied into any other variable). I was reading CY flag(D7 bit of PSW). Now i'm using the same C-code for LPC2148 & compiler could not recognize PSW & Reg B as these sfr are related to 8051, hence i searched similar register in LPC2148 which is CPSR(Current Program Status Register). But i couldn't find its Address. Now if u could answer then plz reply else its OK.... Also let me knw is it possible to copy this CPSR(if base address is know & added to the INC file) reg into any variable?
But how to do it??????
I indirectly gave you the answer to how to access these registers, but obviously not explicit enough for you.
No, you still did not post why you thought that you would need these registers. You just posted that you did use registers in the C51 program.
So once more: Why do you think that you need access to these registers? What problem are you trying to solve, that make you think these registers are needed? Note that C, C++, Pascal, C#, Modula 2, ... are general-purpose languages but none of them have a method for accessing any ackumulator or status register. A number of people must somehow have decided that a general-purpose language does not need such a function.
Exactly what you _you_ need it for?
You are assuming that the LPC2148 works just like an 8051, only bigger - that is a completely false assumption!
As Per says, you need to go right back to your underlying requirement, and think about how to implement that on the LPC2148.
So, again, what is your actual requirement?
What is it that you are actually trying to achieve?
As mentioned several times already in this thread - what do you need this for? your processor relies heavily on memory mapped IO, but for peripherals, not registers. If you can explain what problem you are trying to solve, maybe we can help you?