EMBEDDED LAB MANUAL PDF
EMBEDDED LAB MANUAL PDF
B.E – VI Semester
SYLLABUS
CO ARM & MICROCONTROLLERS LAB
Sub Code: EC601 IA Marks: 5
Hrs/week: 02
I. PROGRAMMING
1 Write an ALP to i) multiply two 16-bit binary numbers. ii) add two 64-bit numbers.
2 Write an ALP to find the sum of first 10 integer numbers.
3 Write an ALP to find factorial of a number.
4 Write an ALP to add an array of 16-bit numbers and store the 32-bit result in internal RAM.
5 Write an ALP to find the square of a number (1 to 10) using look-up table.
6 Write an ALP to find the largest/smallest number in an array of 32 numbers.
7 Write an ALP to arrange a series of 32-bit numbers in ascending/descending order.
8 i) Write an ALP to count the number of ones and zeros in two consecutive memory locations. ii)Write an
ALP to Scan a series of 32-bit numbers to find how many are negative.
II. INTERFACING
• Students should come with thorough preparation for the experiment to be conducted.
• Students should take prior permission from the concerned faculty before availing the
leave.
• Students should come with formals. And to be present on time in the laboratory.
• Students will not be permitted to attend the laboratory unless they bring the practical
record fully completed in all respects pertaining to the experiment conducted in the
previous class.
• Students will be permitted to attend laboratory unless the bring the observation book
fully completed in all respects pertaining to the experiment conducted in the present class.
• They should obtain the signature of the staff-in-charge in the observation book after
CONTENTS
INTRODUCTION
EXTERNAL
INTERRUPTS
4K
ROM TIMER 1
INTERRUPT 128 Byte RAM COUNTER
CONTROL INPUTS
TIMER 0
CPU
P0 P2 P1 P3 TXD RXD
X1 X2
ADDRESS /
DATA
4. Create a source file (using File->New), type in the assembly or C program and save
this (filename.asm/filename.c) and add this source file to the project using either
one of the following two methods. (i) Project->Manage->Components,
Environment Books->addfiles-> browse to the required file -> OK
“OR” ii) right click on the Source Group in the Project Window and the Add
Files to Group option.
5. Set the Target options using -> Project – Options for Target opens the
µ Options for Target – Target configuration dialog. Set the Xtal
(Crystal frequency) frequency as 11.0592 MHz, and also the Options for Target –
Debug – use either Simulator / Keil Monitor- 51 driver.
6. If Keil Monitor- 51 driver is used click on Settings -> COM Port settings select
the COM Port to which the board is connected and select the baud rate as 19200 or
9600 (recommended). Enable Serial Interrupt option if the user application is not
using on-chip UART, to stop program execution.
7. Build the project; using Project -> Build Project.
application and links. Any errors in the code are indicated by – “Target not created”
in the Build window, along with the error line. Debug the errors. After an error free,
to build go to Debug mode.
8. Now user can enter into Debug mode with Debug- Start / Stop Debug session
Running. Also the (reset, run, halt) icons can be used. Additional icons
are (step, step over, and step into, run till cursor).
10. If it is an interface program the outputs can be seen on the LCD, CRO, motor, led
status, etc. If it is a part-A program, the appropriate memory window is opened
using View -> memory window (for data RAM & XRAM locations), Watch
window (for timer program), serial window,etc. Note:
To access data RAM area type address as D: 0020h. Similarly to access the DPTR region (XRAM-
present on chip in AT89C51ED2) say 9000h location type in X: 09000H.
Experiment 1
Write an ALP to i) multiply two 16-bit binary numbers.
ii) add two 64-bit numbers.
ORG 0000H
MOV R0,#0FFH ;MSB1
MOV R1,#0EFH ;MSB2
MOV R2,#0FFH ;LSB1
MOV R3,#9DH ;LSB2
MOV A,R2
MOV B,R3
MUL AB
MOV R4,A
MOV R5,B
MOV A,R2
MOV B,R1
MUL AB
MOV R6,B
ADDC A,R5
MOV R5,A
MOV A,R1
MOV B,R4
MUL AB
ADDC A,R5
MOV R5,A
MOV A,B
ADDC A,R6
MOV R6,A
MOV A,R1
MOV B,R2
MUL AB
ADDC A,R6
MOV R6,A
MOV A,B
ADDC A,#00H
MOV R7,A
END
Experiment 2
Write an ALP to find the sum of first 10 integer numbers.
LOOP:
ADD A, R1 ; Add the current value of the loop counter to the accumulator
INC R1 ; Increment the loop counter
CJNE R1, #11, LOOP ; Continue the loop if the counter is less than 11
Experiment 3
LOOP:
ADD A, R1 ; Add the current value of the loop counter to the accumulator
INC R1 ; Increment the loop counter
CJNE R1, #11, LOOP ; Continue the loop if the counter is less than 11
END
Experiment 4
Write an ALP to add an array of 16-bit numbers and store the 32-bit result in internal RAM.
MOV DPTR, #0X1111 ; Load the address of the first 16-bit number
MOVX A, @DPTR ; Load the least significant byte of NUM1 to accumulator
ADD A, #0 ; Clear carry flag
MOV R0, A ; Store the result in R0
MOV DPTR, #0X1234 ; Load the address of the second 16-bit number
MOVX A, @DPTR ; Load the least significant byte of NUM2 to accumulator
ADD A, R0 ; Add with the least significant byte of NUM1
MOV R0, A ; Store the result in R0
; At this point, R0 and R1 contain the least and most significant parts of the 32-bit result
INC DPTR
END
Experiment 5
Write an alp to find the square of a number
MOV DPL, A ; Copy the least significant byte of the result to DPL
MOV DPH, B ; Copy the most significant byte of the result to DPH
Experiment 6
Write an ALP to find the largest/smallest number in an array of 32 numbers.
MAIN:
MOV DPTR, #ARRAY_ADDR ; Load the starting address of the array
MOV R0, #0 ; Initialize loop counter R0
MOV A, #0xFF ; Initialize smallest value to maximum
MOV B, #0 ; Initialize largest value to minimum
LOOP:
MOVX A, DPTR ; Load the current 32-bit value from the array
NOT_LESS_THAN_SMALLEST:
; Check if the current value is greater than the largest
CJNE A, B, NOT_GREATER_THAN_LARGEST ; If not equal to B, proceed
NOT_GREATER_THAN_LARGEST:
INC DPTR ; Move to the next 32-bit value in the array
INC R0 ; Increment loop counter
CJNE R0, #ARRAY_SIZE, LOOP ; Continue the loop until all elements are processed
; At this point, A contains the smallest value, and B contains the largest value
CONTINUE_LOOP:
; Add any further processing or output as needed
.MODEL SMALL
.STACK 100H
.DATA
NUMBERS DB 5, 3, 8, 1, 9 ; Array of numbers to be sorted
COUNT DB 5 ; Number of elements in the array
MSG1 DB 'Sorted in Ascending Order: $'
MSG2 DB 0DH, 0AH, 'Sorted in Descending Order: $'
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
CALL SORT_ASCENDING
CALL DISPLAY_ARRAY
CALL SORT_DESCENDING
CALL DISPLAY_ARRAY
MAIN ENDP
;----------------------------------------------------------
; Subroutine to Sort Array in Ascending Order (Bubble Sort)
;----------------------------------------------------------
SORT_ASCENDING PROC
MOV CX, COUNT
DEC CX
OUTER_LOOP1:
MOV SI, 0
MOV DX, CX
INNER_LOOP1:
MOV AL, NUMBERS[SI]
MOV BL, NUMBERS[SI+1]
CMP AL, BL
JBE SKIP_SWAP1
; Swap values
MOV NUMBERS[SI], BL
MOV NUMBERS[SI+1], AL
SKIP_SWAP1:
INC SI
DEC DX
JNZ INNER_LOOP1
LOOP OUTER_LOOP1
RET
SORT_ASCENDING ENDP
;----------------------------------------------------------
; Subroutine to Sort Array in Descending Order (Bubble Sort)
;----------------------------------------------------------
SORT_DESCENDING PROC
MOV CX, COUNT
DEC CX
OUTER_LOOP2:
MOV SI, 0
MOV DX, CX
INNER_LOOP2:
MOV AL, NUMBERS[SI]
MOV BL, NUMBERS[SI+1]
CMP AL, BL
JAE SKIP_SWAP2
; Swap values
MOV NUMBERS[SI], BL
MOV NUMBERS[SI+1], AL
SKIP_SWAP2:
INC SI
DEC DX
JNZ INNER_LOOP2
LOOP OUTER_LOOP2
RET
SORT_DESCENDING ENDP
;----------------------------------------------------------
; Subroutine to Display Array Elements
;----------------------------------------------------------
DISPLAY_ARRAY PROC
MOV CX, COUNT
MOV SI, 0
DISPLAY_LOOP:
MOV DL, NUMBERS[SI] ; Get number
ADD DL, 30H ; Convert to ASCII
MOV AH, 02H
INT 21H ; Print character
MOV DL, ' ' ; Print space
INT 21H
INC SI
LOOP DISPLAY_LOOP
MOV DL, 0DH ; New Line
INT 21H
MOV DL, 0AH
INT 21H
RET
DISPLAY_ARRAY ENDP
END MAIN
8 i) Write an ALP to count the number of ones and zeros in two consecutive memory locations.
ii)Write an ALP to Scan a series of 32-bit numbers to find how many are negative.
To count zeros
ORG 0H
MOV DPTR,# DATA START
MOV R0,#00
MOV R1,#00
MOVX A,@DPTR
CALL CountBits
CountBits:
MOV B,#09
CountLoop:
Rlc a
JNC OnesBit
JNC R1
SJMP BitEnd
OnesBit:
JNC R0
Bit END:
DJNZ B,CountLoop
RET
DatatStart:
DB 10101011B
DB 11001100B
END
ORG 0H
MOV DPTR,#5000H
MOVX A,@DPTR
CPLA
INC A
MOV DPTR,#6000H
MOVX @DPTR,A
END
HARDWARE PROGRAMS
Steps
Project Creation in Keil uvision4 IDE:
_ Create a project folder before creating NEW project.
_ Use separate folder for each project
_ Open Keil uVision4 IDE software by double clicking on “Keil Uvision4” icon.
_ Go to “Project” then to “New Project” and save it with a name in the
Respective Project folder, already you created.
_ Select the device as “NXP (founded by Philips)” In that “LPC1768” then
Press OK and then press “NO” button to add “system_LPC17xx.s” file.
_ Go to “File” In that “New” to open an editor window. Create your source file
And use the header file “LPC17xx.h” in the source file and save the file. Color
syntax highlighting will be enabled once the file is saved with a Recognized
extension such as “.C “.
_ Right click on “Source Group 1” and select the option “Add Files to Group
'Source Group 1' “add the. C source file(s) to the group.
_ Again right click on Source Group 1 and select the option “Add Existing Files
to Group 'Source Group 1' “add the library file start.lib : So it is
recommended to copy the file
CD:ALS-SDA-ARMCTXM3-06 \SOFTWARE\library\standard_library\start.lib to the project folder and add to the
source group.
_ Then go to “Project” in that “Translate” to compile the File (s).
_ Go to “Project” in that “Build Target” for building all source files such as
“.C”,”.ASM”, “.h”, files, etc…This will create the hex file if no warnings & no
Errors.
_ In Project Window Right click “TARGET1” and select “options for target
‘TARGET1’
_ Then go to option “Target” in that
_ Xtal 12.0MHz and Use MicroLIB
_ Select IROM1 (starting 0×0 size 0×8000).
_ Select IRAM1 (starting 0×10000000 size 0×8000).
_ Then go to option “Output”
_ Select “Create Hex file”.
_ Then go to option “Linker”
_ Select use memory layout from target dialogue
Experiment 9
Interface a Stepper motor and rotate it in clockwise and anti-clockwise direction.
a. Circuit Diagram:
8 P 0.0 Stepper
Motor Stepper
0 Motor
Driver circuit
5 P 0.7
1
Theory:
Stepper motor is an electromechanical device which converts electrical
pulses into discrete mechanical movements. The shaft or spindle of a stepper motor
rotates in discrete step increments when electrical command pulses are applied to it
in the proper sequence. The motors rotation has several direct relationships to these
applied input pulses. The sequence of the applied pulses is directly related to the
direction of motor shafts rotation. The speed of the motor shafts rotation is directly
related to the frequency of the input pulses and the length of rotation is directly
related to the number of input pulses applied.
expensive sensing and feedback devices such as optical encoders. Your position is
known simply by keeping track of the input step pulses.
#include <LPC17xx.H>
void clock_wise(void);
void anti_clock_wise(void);
unsigned long int var1,var2;
unsigned int i=0,j=0,k=0;
int main(void)
{
LPC_PINCON->PINSEL4 = 0x00000000; //P2.0 to P2.3 GPIO
LPC_GPIO2->FIODIR = 0x0000000F; //P2.0 to P2.3 output
while(1)
{
for(j=0;j<50;j++) //50 times in Clock wise Rotation
clock_wise();
Experiment 10
Interface a DAC and generate Triangular waveform. */
/********************************************************************
*
ARM MBED LPC1768 has a 10-bit DAC in-built with single DAC (analog output) channel. This DAC can be used to
output analog data on the only single pin (p18). This analog output data can vary in the range between VSS and VCC.
The DAC can be used to generate a sine wave signal. To generate this signal, the VREF and the DAC are initialized first,
then the output value can be changed by writing a new value to the DACn. DATA register. Before the sine wave is
generated, the samples corresponding to a period are calculated and stored in a buffer.
Input 00H and FFH at regular intervals, to generate a square wave. The frequency can be varied by varying the time delay.
TRIANGULAR WAVEFORM GENERATION By outputing digital data from 00H to FFH in steps of 01H and then
from FFH to 00H. Decrementing in steps of 01H, the triangular waveform is generated.
********************************************************************
*******/
#include <LPC17xx.H>
int main ()
{
unsigned long int temp=0x00000000;
unsigned int i=0;
while(1)
{//output 0 to FE
for(i=0;i!=0xFF;i++)
{
temp=i;
temp = temp << 4;
LPC_GPIO0->FIOPIN = temp;
}
// output FF to 1
for(i=0xFF; i!=0;i--)
{
temp=i;
temp = temp << 4;
LPC_GPIO0->FIOPIN = temp;
}
}//End of while(1)
}//End of main()
Interface a DAC and generate Square waveform. */
/********************************************************************
*
* External DAC interface (Square Wave)
* Controller : LPC1768
* Project : ALS-SDA-ARMCTXM3-06
* Description : This example explains about how Sqaure Wave is generated.P0.4 to P0.11 are used to get the Digital
values.
0xff ________
| | |
| | |
| | |
| |
|
0x00 | |_________|
***************************************************************************/
#include <LPC17xx.H>
void delay(void);
int main ()
{
LPC_PINCON->PINSEL0 &= 0xFF0000FF ; //
Configure P0.4 to P0.11 as GPIO
LPC_GPIO0->FIODIR |= 0x00000FF0 ;
LPC_GPIO0->FIOMASK = 0XFFFFF00F;
while(1)
{
LPC_GPIO0->FIOPIN = 0x00000FF0 ;
delay();
LPC_GPIO0->FIOCLR = 0x00000FF0 ;
delay();
}
}
void delay(void)
{
unsigned int i=0;
for(i=0;i<=9500;i++);
}
Experiment 11
Display the Hex digits 0 to F on a 7-segment LED interface, with an appropriate delay in
between. */
PS
PS
Keypad
8051µC
7-Seg
Display
#include <LPC17xx.h>
unsigned int delay, count=0, Switchcount=0,j;
while(1)
{
LPC_GPIO0->FIOSET |= ALLDISP;
LPC_GPIO0->FIOCLR = 0x00000ff0;
// clear the data lines to 7-segment displays
LPC_GPIO0->FIOSET = Disp[Switchcount]; // get the 7-segment display
value from the array
for(j=0;j<4;j++)
for(delay=0;delay<30000;delay++); //
delay
Switchcount++;
if(Switchcount == 0x10)
// 0 to F has been displayed ? go back to 0
{
Switchcount = 0;
LPC_GPIO0->FIOCLR = 0x00180ff0;
}
}
}
Experiment 12
Interface a simple Switch and display its status through Relay, Buzzer and LED. */
PIC is a family of Harvard architecture microcontrollers made by Microchip Technology. The PIC architecture is
distinctively minimalist. It is characterized by the following features:
#include <LPC17xx.H>
int main(void)
{
LPC_PINCON->PINSEL1 = 0x00000000;
//P0.24,P0.25 GPIO
LPC_GPIO0->FIODIR = 0x03000000;
//P0.24 configured output for buzzer,P0.25 configured output for Relay/Led
while(1)
{
if(!(LPC_GPIO2->FIOPIN & 0x00000800)) //Is GP_SW(SW4) is
pressed??
{
LPC_GPIO0->FIOSET = 0x03000000;
//relay on
}
else
{
LPC_GPIO0->FIOCLR = 0x03000000;
//relay off
}
}
}//end int main(void)
Additional Programs
1. Program to generate arithmetic progression. //Tn=a+(n-
1)d
mov r1,#03h //d
mov r2,#01h //a mov r3,#08h
mov
r0,#30h
mov
30h,r2
mov
r4,#01h
next: mov a,r1
mov
b,r4
mul
ab
addc
a,r2
inc r0
mov
@r0,a
inc r4
djnz
r3,next
end
notvalid: inc r0
mov @r0,#11h ; in valid 2 out of 5 code
exit: sjmp exit
end
Mov dptr,#9000h
Mov r1,#04h
Mov r2,#90h
Mov r3,#91h
Mov r4,#92h
Clr c
Mov dph,r2
Back: movx a, @dptr
Mov r5,a
Mov dph,r3
Movx a,@dptr
Addc a,r5 //Note:For multibyte subtraction put subb a,r5
Mov dph,r4
Movx @dptr,a
Inc dptr
Djnz r1,back
Jnc end1
Mov a,#01h
Movx @dptr, a
End1:lcall 0003h
End
REFERENCES
1. “The 8051 Microcontroller and Embedded Systems – using assembly and C ”-,
by Muhammad Ali, Mazidi and Janice Gillespie Mazidi and Rollin D. McKinlay; PHI,
2006 / Pearson, 2006
Viva Questions
1. What do you mean by Embedded System? Give examples.
2. Why are embedded Systems useful?
3. What are the segments of Embedded System?
4. What is Embedded Controller?
5. What is Microcontroller?
6. List out the differences between Microcontroller and Microprocessor.
7. How are Microcontrollers more suitable than Microprocessor for Real Time
Applications?
8. What are the General Features of Microcontroller?
9. Explain briefly the classification of Microcontroller.
10. Explain briefly the Embedded Tools.
11. Explain the general features of 8051 Microcontroller.
12. How many pin the 8051 has?
13. Differentiate between Program Memory and Data Memory.
14. What is the size of the Program and Data memory?
15. Write a note on internal RAM. What is the necessity of register banks? Explain.
16. How many address lines are required to address 4K of memory? Show the
necessary calculations.
17. What is the function of accumulator?
18. What are SFR’s? Explain briefly.
19. What is the program counter? What is its use?
20. What is the size of the PC?
21. What is a stack pointer (SP)?
22. What is the size of SP?
23. What is the PSW? And briefly describe the function of its fields.
24. What is the difference between PC and DPTR?
25. What is the difference between PC and SP?
26. What is ALE? Explain the functions of the ALE in 8051.
27. Describe the 8051 oscillator and clock.
28. What are the disadvantages of the ceramic resonator?
29. What is the function of the capacitors in the oscillator circuit?
30. Show with an example, how the time taken to execute an instruction can be
calculated.
31. What is the Data Pointer register? What is its use in the 8051?
32. Explain how the 8051 implement the Harvard Architecture?
33. Explain briefly the difference between the Von Neumann and the Harvard
Architecture.
34. Describe in detail how the register banks are organized.
35. What are the bit addressable registers and what is the need?
36. What is the need for the general purpose RAM area?
37. Write a note on the Stack and the Stack Pointer.
38. Why should the stack be placed high in internal RAM?
39. Explain briefly how internal and external ROM gets accessed.
40. What are the different addressing modes supported by 8051 Microcontroller ?
41. Explain the Immediate Addressing Mode.
42. Explain the Register Addressing Mode.
43. Explain the Direct Addressing Mode.
90. Explain the function of the PCON register during serial data communication.
91. How the Serial data interrupts are generated?
92. How is data transmitted serially in the 8051? Explain briefly.
93. How is data received serially in the 8051? Explain briefly.
94. What are the various modes of Serial Data Transmission? Explain each mode
briefly.
95. Explain with a timing diagram the shift register mode in the 8051.
96. What is the use of the serial communication mode 0 in the 8051?
97. Explain in detail the Serial Data Mode 1 in the 8051.
98. Explain how the Baud rate is calculated for the Serial Data Mode 1.
99. How is the Baud rate for the Multiprocessor communication Mode calculated?
100. Explain in detail the Multiprocessor communication Mode in the 8051.
101. Explain the significance of the 9th bit in the Multiprocessor communication
Mode.
102. Explain the Serial data mode 3 in the 8051.
103. What are interrupts and how are they useful in Real Time Programming?
104. Briefly describe the Interrupt structure in the 8051.
105. Explain about vectored and non-vectored interrupts in general.
106. What are the five interrupts provided in the 8051?
107. What are the three registers that control and operate the interrupts in 8051?
108. Describe the Interrupt Enable (IE) special function register and its various
bits.
109. Describe the Interrupt Priority (IP) special function register and its need.
110. Explain in detail how the Timer Flag interrupts are generated.
111. Explain in detail how the Serial Flag interrupt is generated.
112. Explain in detail how the External Flag interrupts are generated.
113. What happens when a high logic is applied on the Reset pin?
114. Why the Reset interrupt is called a non-maskable interrupt?
115. Why do we require a reset pin?
116. How can you enable/disable some or all the interrupts?
117. Explain how interrupt priorities are set? And how interrupts that occur
simultaneously are handled.
118. What Events can trigger interrupts, and where do they go after getting
triggered?
119. What are the actions taken when an Interrupt Occurs?
110. What are Software generated interrupts and how are they generated?
111. What is RS232 and MAX232?
112. What is the function of RS and E pins in an LCD?
113. What is the use of R/W pin in an LCD?
114. What is the significance of DA instruction?
115. What is packed and unpacked BCD?
116. What is the difference between CY and OV flag?
117. When will the OV flag be set?
118. What is an ASCII code?
2. a) Write an ALP to find cube of given 8-bit data using 8051 /MSP430.
b) Write a C program to interface stepper motor to 8051.
4. a) Write an ALP to find the largest / smallest element in an array using 8051.
b) Write a C program to interface stepper motor to 8051.
8. a) Write an ALP to convert two digit BCD number to its equivalent ASCII value
using 8051 /MSP430.
b) Write a C program to generate square wave of amp = (1V-5V) using
DAC. Display the waveform on CRO.
9. a) Write an ALP to find whether the given number is palindrome or not using
8051.
b) Write a C program to generate Sine waveform using DAC. Display the
waveform on CRO.
10. a) Write an ALP to convert given Hexadecimal number to its equivalent Decimal
number using 8051 /MSP430.
b) Write a C program to interface DC motor to 8051.
11. a) Write an ALP to convert given Decimal number to its equivalent Hexadecimal
using 8051 /MSP430.
b) Write a C program to interface DC motor to 8051.
13. a) Write an ALP to count number of 1’s and 0’s in the given 8-bit data using 8051
/MSP430.
b) Write a C program to interface Elevator to 8051.
14. a) Write an ALP to convert given ASCII number to its equivalent Decimal
number.
b) Write a C program to interface Elevator to 8051
15. a) Write an ALP to find whether given number is even or odd using 8051
/MSP430.
b) Write a C program to interface LCD panel and Hex keypad to 8051.
16. a) Write an ALP to convert given Decimal number to its equivalent ASCII using
8051 /MSP430.
b) Write a C program to interface LCD panel and Hex keypad to 8051.
Annexure-A
MCS-51 Instruction set
Instruction Set
Annexure -B
8051 Special Function Registers:
1. Timer Mode Control Register (TMOD):
TMOD can be considered to be two duplicate 4-bit registers, each of which
controls the action of one of the timers. The “Timer” or “Counter” function is selected
by control bits C/T, and in different operating modes, which are selected by bit-pairs
(M1, M0) in TMOD.
MSB LSB
GATE C/T M1 M0 GATE C/T M1 M0
Timer 1 Timer 0
Gating control when set. Counter “x” is enabled only while “INTx” pin is
GATE high and “TRx” control pin is set. When cleared Timer “x” is enabled
whenever “TRx” control bit is set.
Timer or Counter Selector cleared for Timer operation (input from internal
C/T system clock.) Set for Counter operation (input from “Tx” input pin).
M1 M0 OPERATI0N
0 0 13-bit Timer/Counter 5-bits of “TLx” and 8-bits of “THx” are used.
0 1 16-bit Timer/Counter 8-bits of “TLx” and 8-bits of “THx” are cascaded.
8-bit auto-reload Timer/Counter “THx” holds a value which is to be
1 0
reloaded into “TLx” each time it overflows.
(Timer 0) TL0 is an 8-bit Timer/Counter controlled by the standard Timer
1 1 0 control bits. TH0 is an 8-bit timer only controlled by Timer 1 control bits.
Timer/Counter 1 stopped.
ET1 Enable Timer 1 interrupt. If 1, Enables the TF1 to generate the interrupt.
EX1 Enable External interrupt 1. If 1, Enables the INT1 to generate the interrupt.
ET0 Enable Timer 0 interrupt. If 1, Enables the TF0 to generate the interrupt.
EX0 Enable External interrupt 0. If 1, Enables the INT0 to generate the interrupt.
Annexure C
Architecture of MSP430 microcontroller
All the addressing modes for the source operand and all four addressing modes for the
destination operand can address the complete address space. The bit number show the
content of the As resp. Ad mode bits.
APPENDIX D
MCU 8051IDE
MCU 8051 IDE is a new modern graphical integrated development environment for
microcontrollers based on 8051. For those who believe 8051 is a great piece of
technology this IDE is a new way how to see and feel these still famous
microcontrollers. MCU 8051 IDE is noncommercial open-source software
primarily for Microsoft Windows and GNU/Linux Supported programming languages
are C language and assembly. It has its own assembler and support for 2 external
assemblers. For C language it uses SDCC compiler. There are packages for various
Linux distributions (.rpm and .deb), and installer for Microsoft Windows. This IDE
contains simulator, source code editor, assembler, HW programmer and much other
tools. Simulator supports over 79 MCU primarily from Atmel. There is also support
for simple hardware simulation (like LEDs, keys, etc.).
MCU 8051 IDE simulator is also equipped with a few simulated simple
hardware devices, which can be connected to the simulated MCU. These virtual
hardware components are intended primarily to offer a better insight into
programs interacting with things like LEDs or keys.