MPMC Sample File
MPMC Sample File
MPMC Sample File
TECHNOLOGY
(ETEE 358)
6th Semester
2017 - 2021
INTRODUCTION:
Easy8051B development system is a full-featured development board for Atmel 8051
microcontrollers. It is designed to allow students and engineers to easily test and explore the
capabilities of the 8051 microcontrollers. It also allows 8051 microcontrollers to be interfaced
with external circuits and a broad range of peripheral devices, making it possible for the user to
concentrate on software development.
Figure 1 illustrates the development board. There are identification marks beside each
component on a silkscreen. These marks describe connections to the microcontroller, operation
modes, and provide additional information. Since all relevant information is provided on the
board there is almost no need for additional schematics.
KEY FEATURES
1. External power supply 8-16 V AC/DC.
2. Choose between external and USB power supply.
3. Very fast and flexible USB programmer on board. The key feature is expandability. By
downloading new software, you will be able to program new MCUs in coming years.
4. DS1820 temperature sensor allows to measure temperature with 0.5°C accuracy.
5. One RS232 port for communication with PC or another microcontroller.
6. 4-channel 12-Bit ADC (Analog-to-Digital Converter) with SPI interfaces.
7. 12-Bit DAC (Digital-to-Analog Converter) with SPI interface.
8. By setting jumper in the upper position the pins of the appropriate port are set to logical one
(pull-up). By setting jumper in the lower postion, the pins are set to logical zero (pull-down).
Select pull up to provide logical zero on pin’s inputs. Select pull down to provide logical one on
pin’s inputs
9. LCD connector allows easy connection of LCD in 4-bit mode.
10. Graphic LCD connector allows easy connection of GLCD or LCD in 8-bit mode.
11. Easy8051B supports microcontrollers in DIP14, DIP16, DIP20, DIP40, PLCC44 and PLCC32
package.
12. 32 buttons allow control of every pin on the microcontroller.
13. By pressing the button select high/low state of the pins.
14. See all the signals - each pin has an LED.
15. 4.096V voltage reference is used for working with A/D and D/A Converters.
16. Upper four switches on the SW2 turns on/off the LEDs on PORT0, PORT1, PORT2 and PORT3.
Select port to connect LEDs to. By using lower four switches select which digit on seven
segment display are to be turned on.
17. Set LCD contrast according to display characteristics
18. Set GLCD contrast according to display characteristics.
19. On-Board peripherals are connected to the microcontroller via switches on the SW1.
20. Seven segment displays in multiplex mode for displaying values.
21. Reset circuit - if the reset button is pressed MCU will start executing from the beginning.
22. On-Board oscillator circuit for generating microcontroller’s clock input.
SWITCHES
The Easy8051B development board features a number of peripheral devices. In order to enable
them before programming, the appropriate jumpers or switches have to be properly set. Switches
are devices that have two positions - ON and OFF, which have a role to establish or break
connection between two contacts. The Easy8051B development board has two groups of
switches.
The first group, SW1, is used to enable SPI communication for interfacing with A/D and D/A
Converters and for connecting ADC CS (Chip Select) and DAC CS to the microcontroller pins.
It is also used for RS-232 communication.
Fig.2: Group of 8 Switches.
The upper four switches (1, 2, 3, 4) on the SW2 are used to enable LEDs connected to PORT0,
PORT1, PORT2 and PORT3/PORT4. For example, if the switch enabling PORT1 is OFF, all
PORT1 LEDs will be turned off. The lower four switches on the SW2 are used to enable the 7-
segment displays. If there is no need to use the 7-segment displays in a project, these switches
should be turned off.
JUMPERS
Jumpers, like switches, can break or establish connection between two points. Under the plastic
cover of a jumper there is a conductive contact which establishes connection when the jumper is
placed over two pins.
Jumpers are commonly used as selectors between two possible connections via three pin
connector. As illustrated in Figure 4, the connector in the middle can be connected to the left or
right pin, depending on the jumper’s position.
Fig.3: Jumpers as Multiplexers.
MCU SOCKETS
Easy8051B is delivered with the AT89S8253 40-pin microcontroller. The users can remove this
one and fit a different microcontroller in DIP40, DIP20, DIP16, DIP14, PLCC44 or PLCC32
packages of an adequate pinout.
Fig.4: MCU Socket.
Note: Since all packages have parallel connections, there must not be more than one
microcontroller on the board at a time.
Microcontroller’s pins are routed to various peripherals as illustrated in Figure 6. All ports are
directly connected to Direct Port Access connectors. Such connectors are normally used for
connecting external peripherals to the board as well as for connecting digital logic probes for
testing and measuring.
All ports are connected to LEDs; push buttons switches and pull-up/down resistors, which allow
easy monitoring and testing of digital pin state.
Some pins are connected to other peripherals such as DS1820 temperature sensor, RS-232
communication, 7-segment displays, LCD, etc.
Fig.5: System Connection.
POWER SUPPLY
Easy8051B has two kinds of power supply- regulated supply from the USB cable (by default)
and external power supply. In case of the USB power supply, the system should be connected to
a PC using the USB programming cable, while the jumper J11 should be set in the right-hand
position.
In case of the external power supply, the Easy8051B board produces +5V using an LM7805
voltage regulator. The external power supply can be AC or DC. Power supply voltage can be in
the range of 8-16V and the jumper J11 should be set in the left-hand position. Figure 8 illustrates
USB and external power supply connectors.
Fig.9: microICD.
OSCILLATOR
The Easy8051B development board has on-board oscillator circuit for generating
microcontroller’s clock input. Within the 8051Flash programmer, either internal RC oscillator or
external clock can be selected. External oscillator is connected to the XTAL1 pin on the
microcontroller.
Fig.10: Oscillator.
LEDs
Light Emitting Diodes (LEDs) are the most commonly used components, usually for displaying
pin’s digital state. Easy8051B has 38 LEDs connected to the microcontroller’s PORT0, PORT1,
PORT2, PORT3 and PORT4.
A/D CONVERTER
The Easy8051B development system has a 4-channel 12-Bit A/D Converter (Analog-to-Digital
Converter) with SPI serial interface (MCP3204).
In order to use it, switches 1,2,3 and 4 on the SW1 must be enabled. In order to simulate an
analog input, potentiometer P3 should be connected to one of four analog inputs through the
jumper group J9. MCP1541 is used as a 4.096V voltage reference for ADC.
Fig.25: A/D Converter.
Assembly Code:-
0000 7407 mov a,#07h
0002 75F006 mov b,#06h
0005 25F0 subb a,b
0007 F580 mov p0,a
c. Write a program to divide two numbers
Assembly Code:-
0000 7407 mov a,#07h
0002 75F006 mov b,#06h
0005 84 div ab
0006 F580 mov p0,a
0008 85F090 mov p1,b
Assembly Code:-
0000 758901 mov tmod, #01H
0003 D293 setb p1.3
0005 758C00 l1: mov th0,#00h
0008 758A00 mov tl0, #00h
000B D28C setb tcon.4
000D 308DFD again: jnb tcon.5,again
0010 C28C clr tcon.4
0012 C28D clr tcon.5
0014 B293 cpl p1.3
0016 80ED sjmp l1
Assembly Code:-
0000 758901 mov tmod, #01H
0003 7400 mov a,#00h
0005 758C00 l1:mov th0, #00h
0008 758A00 mov tl0,#00h
000B F590 mov p1, a
000D D28C setb tcon.4
000F 308DFD again: jnb tcon.5,again
0012 C28C clr tcon.4
0014 C28D clr tcon.5
0016 F4 cpl a
0017 80EC sjmp l1
Assembly Code:-
0000 758901 mov tmod, #01H
0003 74FE mov a, #0feh
0005 758C00 l1: mov th0, #00h
0008 758A00 mov tl0, #00h
000B 23 rl a
000C F590 mov p1, a
000E D28C setb tcon.4
0010 308DFD again:jnb tcon.5,again 0013
C28C clr tcon.4
0015 C28D clr tcon.5
0017 80EC sjmp l1
Assembly Code:-
0000 758901 MOV TMOD,#01H
0003 C290 BACK: CLR P1.0
0005 1135 ACALL L1
0007 D290 SETB P1.0
0009 C291 CLR P1.1
000B 1135 ACALL L1
000D D291 SETB P1.1
000F C292 CLR P1.2
0011 1135 ACALL L1
0013 D292 SETB P1.2
0015 C293 CLR P1.3
0017 1135 ACALL L1
0019 D293 SETB P1.3
001B C294 CLR P1.4
001D 1135 ACALL L1
001F D294 SETB P1.4
0021 C295 CLR P1.5
0023 1135 ACALL L1
0025 D295 SETB P1.5
0027 C296 CLR P1.6
0029 1135 ACALL L1
002B D296 SETB P1.6
002D C297 CLR P1.7
002F 1135 ACALL L1
0031 D297 SETB P1.7
0033 80CE SJMP BACK
0035 758C12 L1: MOV TH0,#12H
0038 758A55 MOV TL0,#55H
003B D28C SETB TCON.4
003D 308DFD HERE: JNB TCON.5,HERE
0040 C28C CLR TCON.4
0042 C28D CLR TCON.5
0044 22 RET
Experiment No. 9
Aim: Write a program to implement Interrupt INT0, INT1. Glow all LEDs of P0 when INT0 is activated
& glow all LEDs of P2 when INT1 is activated.
Assembly Code:-
ORG 00H
LJMP main ORG
0003H MOV P0,
#00H RETI
ORG 0013H MOV
P2, #00H RETI
main: ORG 30H MOV
IE, #85H
Here: SJMP Here