In this section we will the discuss the basic requirements
to write a program i.e to declare the bit stream
Whenever we write the program.
An ARM 7 controller is a 32-bit microcontroller hence every
bit stream i.e handled by the controller or the instructions given to it are of
32-bit.
In order to write this 32-bit stream as is it long we will
follow three easy ways to declare the stream which are
1. Binary representation.
2. Hexadecimal representation.
3. Decimal representation.
1 Binary representation:
In this
method during the instructions given the bit stream is declared by giving
overall 32-bits as seen below.
Ex: in order to set a value of 1 to P0.0 we
will use the following instruction.
IOSET=0b00000000000000000000000000000001;
The b represents it is a binary presentation.
Similarly
in order to clear the same pin we will use following instruction
IOCLR=0b00000000000000000000000000000001;
1
Hexa decimal representation:
Over all 32
bits in hexa decimal number which is relatively easy compared to binary
representation.
Ex: in
order to set a value of one to the pin from P0.0 to P0.3 we will use following
instruction
IOSET= 0X0000000F;
The
first X represents it is a hexa representation.
Similarly in order to clear we will use following
IOCLR=0x0000000F
1
Decimal representation:
In
this method instructions are declared by giving a decimal number as following.
In order to set the last bits P0.0 to P0.3
we will use the following instruction
IOSET=15;
Similarly for the clearing purpose we will
use
IOCLR=15;
In this entire ARM 7 section we will follow
the hexa decimal representation as it is little convenient comparing both
other. The convenience will be explained later during programming.
0 comments:
Post a Comment