16-10-2012, 05:27 PM
special function registers
Programming_Embedded_System_I.pdf (Size: 2.37 MB / Downloads: 38)
SFRs and ports
Control of the 8051 ports through software is carried out using what
are known as ‘special function registers’ (SFRs).
Physically, the SFR is a area of memory in internal RAM:
• P0 is at address 0x80
• P1 at address 0x90
• P2 at address 0xA0
• P3 at address 0xB0
Creating and using sbit variables
To write to a single pin, we can make use of an sbit variable in the
Keil (C51) compiler to provide a finer level of control.
BUT:
�
It is very difficult to produce precisely timed delays.
� The loops must be re-tuned if you decide to use a different processor,
change the clock frequency, or even change the compiler optimisation
settings.
Preparation for the next seminar
In the lab session associated with this seminar, you will use a
hardware simulator to try out the techniques discussed here. This
will give you a chance to focus on the software aspects of
embedded systems, without dealing with hardware problems.