Академический Документы
Профессиональный Документы
Культура Документы
09-ece-57
The embedded system is a combination of computer hardware, software additional electrical & mechanical parts A computer is used in such devices primarily as a means to simplify the system design and to provide flexibility. Embedded systems employ the use of a RTOS (Real-Time Operating System).
Microcontroller
A smaller computer. On-chip RAM, ROM, I/O ports... Example:- Motorolas 6811, Intels 8051 and PIC 16X
CPU
RAM
ROM
A single chip
I/O Port Timer Serial COM Port
Microcontroller
Ground
DUAL FUNCTION
Used to access both data and address
External memory
reset
Add. Latch enable
7 segment display
Traffic Light
Interrupts in 8051
An interrupt is an external or internal event that interrupts the microcontroller to inform it that a device needs its service The advantage of interrupts is that the microcontroller can serve many devices (not all at the same time)
Program
Program
Interrupts in 8051
EA ET2 ES ET1 EX1 ET0 EX0
Internal Interrupts
Enables or disables external interrupt Enables or disables timer 0 overflow interrupt Enables or disables external interrupt 1 Enables or disables timer 1 overflow interrupt Enables or disables the serial port interrupt Enables or disables timer 2 overflow or capture interrupt Not implemented, reserved for future use Disables all interrupts
External Interrupts
Data Bus
RAM
ROM
I/O Port
Timer
The features of INTEL 8085 are : It is an 8 bit processor. It is a single chip N-MOS device with 40 pins. It has multiplexed address and data bus.(AD0-AD7). It works on 5 Volt dc power supply. The maximum clock frequency is 3 MHz while minimum frequency is 500kHz. It provides 74 instructions with 5 different addressing modes.
S0,S1: These are the status signals used to indicate type of operation.
RD: Read is active low input signal used to read data from I/O device or
memory.
WR: Write is an active low output signal used write data on memory or an
I/O device.
IO/M: This is output pin or signal used to indicate whether 8085 is working
in I/O mode(IO/M=1) or Memory mode(IO/M=0 ).
RESET IN: This is input signal. When RESET IN is low p restarts and starts
executing from location 0000H.
SID: Serial input data is input pin used to accept serial 1 bit data .
X1 & X2 : These are clock input signals and are connected to external LC,or
RC circuit.These are divide by two so if 6 MHz is connected to X1X2, the operating frequency becomes 3 MHz.
CPU is stand-alone, RAM, ROM, I/O, timer are separate designer can decide on the amount of ROM, RAM and I/O ports. expansive versatility general-purpose
CPU, RAM, ROM, I/O and timer are all on a single chip fix amount of on-chip ROM, RAM, I/O ports for applications in which cost, power and space are critical single-purpose
Temporary register:
All the arithmetic and logical operations are done in the temporary register but user cant access it.
Flag:
It is a group of 5 flip flops used to know status of various operations done.
The Flag Register along with Accumulator is called PSW or Program Status Word.
AC
CY
S: Sign flag is set when result of an operation is negative. Z: Zero flag is set when result of an operation is 0. Ac: Auxiliary carry flag is set when there is a carry out of lower nibble or
lower four bits of the operation.
CY: Carry flag is set when there is carry generated by an operation. P: Parity flag is set when result contains even number of 1s.
Rest are dont care flip flops.
Register Group
Temporary registers (W,Z): These are not available for user. These are loaded only
when there is an operation being performed.
General purpose: There are six general purpose registers in 8085 namely
PC: (Program Counter) It is 16 bit register used to point the location from which the
next instruction is to be fetched.
Register addressing:
Data is transferred from one register to other. Example : MOV A, C
Indirect addressing:
Data is transferred from address pointed by the data in a register to other register or vice-versa. Example: MOV A, M
Implied addressing:
These doesnt require any operand. The data is specified in Opcode itself. Example: RAL: Rotate left with carry.
Interrupts in 8085
An interrupt is considered to be an emergency signal that may be serviced. The Microprocessor may respond to it as soon as possible.
Interrupts can also be classified into: Maskable Interrupts (Can be delayed or Rejected)
The INTR input : INTR is mask-able using the EI/DI instruction pair.
RST 5.5, RST 6.5, RST 7.5 : They are all mask-able.
TRAP : is the only non-mask-able interrupt in the 8085
Interrupts in 8085
The 8085 recognizes 8 RESTART instructions: RST0 - RST7 . Each of these would send the execution to a predetermined hard-wired memory location:
Restart Instruction RST0 RST1 Equivalent to CALL 0000H CALL 0008H
RST2 RST3
RST4 RST5
RST6 RST7
The P operates with reference to clock signal. The rise and fall of the pulse of the clock gives one clock cycle. Each clock cycle is called a T state and a collection of several T states gives a machine cycle. Important machine cycles are :
1. 2. 3. 4. 5.
8051 Microcontroller
Design Softwares
Softwares Used
Keil Vision
Express PCB
combines project management, make facilities, source code editing, program debugging, and complete simulation in one powerful environment. The Vision development platform is easy-to-use and helping you quickly create embedded programs that work. The Vision editor and debugger are integrated in a single application that provides a seamless embedded project development environment.
A beginner can learn about 8051 based embedded solutions without any hardware. An experienced designer, you may find most of the required facilities built in the simulator that enabling you to complete your next project without waiting for the target hardware.
Express PCB
Express PCB allows you to design schematics and PCB's. It is ideal for those that are looking to design anywhere from a two to four layer circuit board. A drop and drag design allows users to pick the components of the circuit board and drop it onto the circuit board in the software program. The designer can then place various pins in the circuit board to show where things need to be connected. It also has the ability of the program to show the designer where there are flaws in their design.
Express PCB
This way we can include resistors
There are many things which we can do with our DC motor when interfaced
with microcontroller. For example: we can control the speed of motor, we can control the direction of rotation, we can also do encoding of the rotation made by DC motor i.e. keeping track of how many turns are made by our motors etc. Usually H-bridge is preffered way of interfacing a DC motor. L293D is most used H-Bridge driver IC.
Working of H-Bridge
The name "H-Bridge" is derived from the actual shape of the switching circuit which control the motion of the motor. It is also known as "Full Bridge". Basically there are four switching elements in the H-Bridge as shown
Off
On
On
Off
On Off
On Off
Off On
Off On
Stepper Motor
Of all motors, step motor is the easiest to control. It's handling simplicity is really hard to deny - all there is to do is to bring the sequence of rectangle impulses to one input of step controller and direction information to another input. Direction information is very simple and comes down to "left" for logical one on that pin and "right" for logical zero. Motor control is also very simple - every impulse makes the motor operating for one step and if there is no impulse the motor won't start. Pause between impulses can be shorter or longer and it defines revolution rate. This rate cannot be infinite because the motor won't be able to "catch up" with all the impulses (documentation on specific motor should contain such information)..