Académique Documents
Professionnel Documents
Culture Documents
NUST/PNEC
CS311
Part-II
By using Oscilloscope study and compare the following pulses/frequencies on the screen by
using 2/4-channel scope off Intel8051 control bus
a) Crystal clock
b) Read/Write pluses
c) ALE Clock
• Capture these images and show them to Lab demonstrator
• Add these images to your lab report
1
The frequency requirements are changed in Task Area. Down below is an
example for different frequencies
You have to do proper calculation and replace the values to generate
required frequency
DESCRIPTION: The program generates continue pulses of five microseconds and five
milliseconds using software delay loop techniques and then the Clock, RD/WR and ALE
lines are inspected subsequently using the oscilloscope.
THEORY:
The microcontroller which is being used in the lab is 89C420, an ultra-high-speed
microcontroller or simply UHS microcontroller. It offers the highest performance
available in 8051-compatible microcontrollers and features a redesigned processor core
that executes every 8051 instruction up to 12 times faster. The most important thing to
note, however, is that it runs at 1 clock-per-machine cycle.
On an 11.0592 MHz crystal, each machine cycle takes 0.0904µs to execute. The
instruction set of the UHS microcontroller is exactly the same but the due to different
processing speed, the timings differ quite significantly. The UHS microcontroller clock
cycles for the instructions to be used in this program are given in the table on the next
page:
With the help of the clock cycles above, the code for the pulses will be developed in the
next section.
2
FIVE MICROSECOND PULSE
Initial Calculation
Since each clock cycle takes 0.0904µs to execute, the number of clock cycles required for
a 5µs pulse is:
Using the table above and following the order of the code, the number of machine cycles
taken by above program is:
List File
1 ; LAB # 5
2 ; To generate pulses by using delay loop
techniques
3 ; Group:
4 ; Five Microsecond Pulses
5 ; 29/August/2007
6
3
0000 7 ORG 0000H ;This sets the
origin at 00H
0000 790C 8 BEGIN: MOV R1,#0CH ;Move 0CH (12
dec.) in the register R1
0002 D9FE 9 LOOP: DJNZ R1,LOOP ;Loop, to produce
a delay of 12 * 4 cycles
0004 00 10 NOP ;Delay 1 cycle
0005 00 11 NOP ;Delay 1 cycle
0006 B291 12 CPL P1.1 ;Complement the
output
0008 80F6 13 SJMP BEGIN ;Jump back to the
beginning
14 END ;End of program
A51 MACRO ASSEMBLER LAB5A
09/11/2007 17:31:14 PAGE 2
N A M E T Y P E V A L U E ATTRIBUTES
Initial Calculation
Since each clock cycle takes 0.0904µs to execute, the number of clock cycles required for
a 5ms pulse is:
4
Using the table above and following the order of the code, the number of machine cycles
taken by above program is:
List File
1 ; LAB # 5
2 ; To generate pulses by using delay loop
techniques
3 ; Group:
4 ; Five Millisecond Pulses
5 ; 29/August/2007
6
0000 7 ORG 0000H ;Sets the origin
to 00H
0000 7836 8 BEGIN: MOV R0,#36H ;Moves 36H in R0
to be used for external loop
0002 79FF 9 LOOP1: MOV R1,#0FFH ;Moves 0FFH in R1
to be used in internal nested loop
0004 D9FE 10 LOOP2: DJNZ R1,LOOP2 ;Internal Loop
Delay
0006 D8FA
11
DJNZ R0,LOOP1 ;External Loop Delay
0008 B291 12 CPL P1.1 ;Complement the
output bit
000A 80F4 13 SJMP BEGIN ;Jump back to the
beginning
14 END ;End of program
A51 MACRO ASSEMBLER LAB5B
09/11/2007 18:00:35 PAGE 2
5
SYMBOL TABLE LISTING
------ ----- -------
N A M E T Y P E V A L U E ATTRIBUTES
TIMING DIAGRAM
OBSERVATIONS
2. In the 89C420 microcontroller ALE and clocks at 1/4th the system clock frequency,
which is exactly the result obtained on the oscilloscope.
3. The microcontroller is operating in the non-page mode, the default mode, after a
system reset.
6
4. ALE pulses are produced only when EA (External Access) pin is grounded, since it is
generated for external memory. If it is set to high noise is seen on the oscilloscope.