Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Es Prac explanation.docx, Thesis of Embedded Systems

Es Prac explanation.docx123456

Typology: Thesis

2017/2018

Uploaded on 09/29/2018

devansh-shetty
devansh-shetty 🇮🇳

4.5

(6)

5 documents

1 / 38

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Embedded system practical
1.Design and develop a reprogrammable embedded computer using 8051 microcontrollers and to
show the following aspects.
a. a. Programming
b. b. Execution
c. c. Debugging
1.2.1 Software Requirement: Editor for schematic drawing like Eagle.
https://www.cadsoftusa.com/download-eagle/freeware/
Or Protel.
http://protel-pcb.software.informer.com/1.5/
1.2.2 Hardware Requirement: Soldering Iron, Tweezer, Cutter, Multimeter, Components as
per table1.1.
1.3 Description:
1.3.1 Embedded System:- Embedded systems are those systems that are similar to computer
(they can be termed as computer on a chip) but are designed for some specific task, they may
have lesser components (be in size or in count) associated to it, then PC. They may or may
not contain all components of a computer system.
Unlike PC, Embedded systems are designed to perform some specific task and generally are
not designed for performing multiple tasks.
1.3.2 Block Diagram of an Embedded System:
1.3.3 “Components of a Computer”
Basic component of an embedded system is its controller which could be a microprocessor
unit (MPU) or a microcontroller unit (MCU). MPU needs more peripherals to accomplish a
task and hence results in complex circuit and higher power consumption, whereas MCU units
mostly have on chip peripherals that includes memory elements like ROM/RAM, basic
function elements like Timers/Counters/ Interrupts and special interfaces like UART/ SPI/
I2C/CAN etc. and thus resulting in lesser component count and lesser power consumption.
1.3.4 Re-programmable Embedded System (RES):- In its easiest definition, a re-
programmable embedded system is one which can be re programmed a number of times
easily while in system or in application and with minimum component requirement i.e. there
is no need to pull out MCU every time one wants to program it and hence provide flexibility
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26

Partial preview of the text

Download Es Prac explanation.docx and more Thesis Embedded Systems in PDF only on Docsity!

Embedded system practical

1.Design and develop a reprogrammable embedded computer using 8051 microcontrollers and to show the following aspects. a. a. Programming b. b. Execution c. c. Debugging

1.2.1 Software Requirement: Editor for schematic drawing like Eagle. https://www.cadsoftusa.com/download-eagle/freeware/ Or Protel. http://protel-pcb.software.informer.com/1.5/ 1.2.2 Hardware Requirement: Soldering Iron, Tweezer, Cutter, Multimeter, Components as per table1.1. 1.3 Description: 1.3.1 Embedded System:- Embedded systems are those systems that are similar to computer (they can be termed as computer on a chip) but are designed for some specific task, they may have lesser components (be in size or in count) associated to it, then PC. They may or may not contain all components of a computer system. Unlike PC, Embedded systems are designed to perform some specific task and generally are not designed for performing multiple tasks. 1.3.2 Block Diagram of an Embedded System:

1.3.3 “Components of a Computer” Basic component of an embedded system is its controller which could be a microprocessor unit (MPU) or a microcontroller unit (MCU). MPU needs more peripherals to accomplish a task and hence results in complex circuit and higher power consumption, whereas MCU units mostly have on chip peripherals that includes memory elements like ROM/RAM, basic function elements like Timers/Counters/ Interrupts and special interfaces like UART/ SPI/ I2C/CAN etc. and thus resulting in lesser component count and lesser power consumption.

1.3.4 Re-programmable Embedded System (RES):- In its easiest definition, a re- programmable embedded system is one which can be re programmed a number of times easily while in system or in application and with minimum component requirement i.e. there is no need to pull out MCU every time one wants to program it and hence provide flexibility

in programming and operations. It is developed using 8051 compatible microcontrollers manufactured by NXP/ Atmel. In addition to execution of intended program RES also provide debugging facility and chip programming for other users.

The Reprogrammable embedded system consists of: F 0 B 7F 0 2 0Sockets for placing microcontroller- 40 pin F 0 B 7F 0 2 0DC socket for external power supply (DC 5V) F 0 B 7F 0 2 01 LED for power on indication and 1 push button for reset F 0 B 7F 0 2 011.0592 MHz Quartz Crystal Oscillator F 0 B 7F 0 2 08 LEDs for output pin state indication at port P F 0 B 7F 0 2 01 DIP switch (8 switch) for input pin activation F 0 B 7F 0 2 0Connector and driver for serial communication RS F 0 B 7F 0 2 0Multiple-pin connectors for direct access to I/O ports F 0 B 7F 0 2 0Connector for SPI programming F 0 B 7F 0 2 01 Piezo buzzer for audio/frequency output F 0 B 7F 0 2 0Additional power supply connectors

1.4 Selection of component for a given application Every application circuit is build around some components which should be selected as per the functionality of the application, availability of components, cost of entire system,procurement time\for components and most importantly meeting of some critical parameters of intended application. 1.4.1 Selection of Processor: Selection should be based mainly on architecture, availability, cost, time to prototype and market,testability and debug-ability. As per the requirement a microcontroller will be suitable for this purpose.Intel/Atmel 8051 architecture is suitable for beginners due to its easy understandability, easy availability of architecture description and instruction set. Some advance controllers of 8051 architecture provide boot-loader, in system programming and in application programming. NXP’s P89V51RD2 and Atmel’s AT89S52 are such general purpose controllers, based on 8051 architecture. Re-programmability is achieved using ISP (In-System-Programming) feature provided by NXP P89V51RD2 or by Atmel AT89S52. P89V51RD2 uses ISP by Atmel AT89S52. P89V51RD2 provides ISP feature using UART pins (RxD, TxD, RST, PSEN) while AT89S52 uses SPI pins(MOSI, MISO, SCK, RST) for ISP functionality.

NXP’s P89V51RD2 and Atmel’s AT89S52 features include; F 0 B 7

F 0 2 08-bit, 40-pin controller in DIP package F 0 B 7

F 0 2 0Operating voltage +5V F 0 B 7

F 0 2 0Operating frequency 0 to 40 MHz F 0 B 7

F 0 2 032-Input / Output pins F 0 B 7

F 0 2 03-16 bit Timers F 0 B 7

F 0 2 08- Interrupt levels F 0 B 7

F 0 2 01-UART F 0 B 7

F 0 2 01-SPI F 0 B 7

F 0 2 01 KB of user RAM F 0 B 7

F 0 2 064 KB of Flash

1.4.2 Selection of other components: 1.4.2.1 Serial communication interface UART (Universal Asynchronous Receiver Transmitter) is required for boot-loader/ ISP/IAP

  1. A 11.0592 MHz crystal oscillator is connected between pin 18 and 19 of controller, with two 22pf ceramic capacitors connected between pin 18, 19 and GND.
  2. As controller requires logic high voltage for short duration to get itself reset, a reset circuit is connected at RST pin i.e. pin 9 of controller. It consists of a push-to-on switch connected between Vcc and pin 9, a 10K resistor connected between pin 9 and GND and an electrolytic capacitor of 10MFD/25V, connected between Vcc and pin9 of controller.
  3. For serial UART working, pin 10 of controller i.e. receive pin at port3 (P3.0) and pin 11 of controller i.e. transmit pin at port3 (P3.1) are connected with serial UART IC, MAX232 pin 9 and 10 respectively. Pin 9 of MAX232 is R2OUT i.e. receive out pin, which outputs data received from PC through serial cable via pin 8 i.e. R2IN of MAX232. Pin 10 of MAX232 is T2IN i.e. transmit input, which inputs data from controller. This input data is then sent to PC through serial cable via pin7 i.e. T2OUT of MAX232.
  4. IC MAX232 is biased with +5V supply at pin 16, GND at pin 15. Rest of its biasing is done as per recommended circuitry. Four number 10 MFD/63V electrolytic capacitors are connected as recommended.
  5. DB9 connector is connected between MAX232 and PC. Refer table 1 for complete list of components.

Figure 1.2: Pin diagram of P89V51RD2/AT89S

Figure 1.2: Pin diagram of P89V51RD2/AT89S *Note: Some instructions or names of SFRs may be changed in different processors of different manufacturers, e.g. ATMEL NXP for same architecture. Care must be taken here.

Figure 1.3: Bareboard PCB for Reprogrammable Embedded System

Figure 1.4: Components for Reprogrammable Embedded System

Figure 1.5: Assembled PCB for Reprogrammable Embedded System

Table 1. 1.7 LIST OF COMPONENTS FOR THE EMBEDDED DEVELOPMENT SYSTEM

SJMP START END

1.8 Result: Embedded system board ( as shown in figure 1.5) is soldered, checked and found

working. 1.9 Conclusion:- Target board of such types can be designed using very less amount of components and can be used for many applications. 1.10 Remarks:- Other controllers of 8051 architecture and having same pinouts can also be tested and used on same target board.

  1. A. Configure timer control registers of 8051 and develop a program to generate given time delay. Given Delay=15 sec TL0=0xFC TH0=0x

Code:

#include<REG51.H> //Header file for 8051

microcontroller

void T0Delay(void); //function prototype declaration

void main(void) // main function

while(1) //repeat forever

P1=0xFF; //make high all bits of port 1

T0Delay(); // call delay routine

P1=0x00; // make low all bits of port 1

T0Delay(); // call delay routine

} //End of main

void T0Delay() //delay function

TMOD=0x01; // use timer 0 , mode 1

//Load value "FC" in timer 0 lower byte & load

value "65" in timer 0 higher //byte

for 1 second delay

TL0=0xFC; // load TL

TH0=0x65; //load TH

TR0=1; // turn on Timer 0

while(TF0==0); //wait for TF0(timer 0 overflow flag)

to roll over(overflow)

TR0=0; //turn off timer 0 run control bit

TF0=0; // clear timer 0 overflow flag bit.

o/p

void delay(unsigned int time) { unsigned int i; for(i=0;i<time;i++); }

o/p

3. A .Port I / O: Use one of the four ports of 8051 for O/P interfaced to eight

LED’s. Simulate binary counter (8 bit) on LED’s.

Code:

#include<reg51.h>

void delay(int time);

void main(void)

P1=00000000;

while(1)

P1++;

delay(100);

void delay(int time)

int i,j;

for(i=0;i<time;i++)

for(j=0;j<23;j++);

o/p

B. To interface 8 LEDs at Input-output port and create different patterns. (four leds glow on and off) Code: #include<REG51.H> void ToDelay(void); void main(void) {

void send(char x);

void main(void)

TMOD = 0x20;

TH1 = 0xFD;

SCON = 0x50;

TR1 = 1;

send(‘H’);

send(‘E’);

send(‘L’);

send(‘L’);

send(‘O’);

send(‘\r’);

while(1);

void send(char x)

SBUF = x;

while(TI==0);

TI=0;

P1 = 0x00;

CS = 0;

while(1)

WR1 = 1;

XFER = 1;

P1 = 0xFF;

WR1 = 0;

XFER = 0;

delay(1);

WR1 = 1;

XFER = 1;

P1 = 0x00;

WR1 = 0;

XFER = 0;

delay(1);

void delay(int time)

int i,j;

for(i=0;i<=time;i++) for

(j=0;j<=2;j++);

o/p

sbit WR1 = P3^4;

sbit XFER = P3^5;

void main()

P1 = 0x00;

CS = 0;

while(1)

do

WR1 = 1;

XFER = 1;

P1 += 0x05;

WR1 = 0;

XFER = 0;

while(P1<0xFF);

do

WR1 = 1;

XFER = 1;

P1 -= 0x05;

WR1 = 0;

XFER = 0;

while(P1>0x00);

o/p